mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
Merge pull request #28606 from DaanDeMeyer/kernel-install
Kernel install fixes
This commit is contained in:
@@ -999,6 +999,19 @@ static int context_execute(Context *c) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool bypass(void) {
|
||||
int r;
|
||||
|
||||
r = getenv_bool("KERNEL_INSTALL_BYPASS");
|
||||
if (r < 0 && r != -ENXIO)
|
||||
log_debug_errno(r, "Failed to parse $KERNEL_INSTALL_BYPASS, assuming no.");
|
||||
if (r <= 0)
|
||||
return false;
|
||||
|
||||
log_debug("$KERNEL_INSTALL_BYPASS is enabled, skipping execution.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static int verb_add(int argc, char *argv[], void *userdata) {
|
||||
Context *c = ASSERT_PTR(userdata);
|
||||
int r;
|
||||
@@ -1006,6 +1019,9 @@ static int verb_add(int argc, char *argv[], void *userdata) {
|
||||
assert(argc >= 3);
|
||||
assert(argv);
|
||||
|
||||
if (bypass())
|
||||
return 0;
|
||||
|
||||
c->action = ACTION_ADD;
|
||||
|
||||
r = context_set_version(c, argv[1]);
|
||||
@@ -1048,6 +1064,9 @@ static int verb_remove(int argc, char *argv[], void *userdata) {
|
||||
log_debug("Too many arguments specified. 'kernel-install remove' takes only kernel version. "
|
||||
"Ignoring residual arguments.");
|
||||
|
||||
if (bypass())
|
||||
return 0;
|
||||
|
||||
c->action = ACTION_REMOVE;
|
||||
|
||||
r = context_set_version(c, argv[1]);
|
||||
@@ -1098,19 +1117,6 @@ static int verb_inspect(int argc, char *argv[], void *userdata) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool bypass(void) {
|
||||
int r;
|
||||
|
||||
r = getenv_bool("KERNEL_INSTALL_BYPASS");
|
||||
if (r < 0 && r != -ENXIO)
|
||||
log_debug_errno(r, "Failed to parse $KERNEL_INSTALL_BYPASS, assuming no.");
|
||||
if (r <= 0)
|
||||
return false;
|
||||
|
||||
log_debug("$KERNEL_INSTALL_BYPASS is enabled, skipping execution.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static int help(void) {
|
||||
_cleanup_free_ char *link = NULL;
|
||||
int r;
|
||||
@@ -1239,9 +1245,6 @@ static int run(int argc, char* argv[]) {
|
||||
|
||||
log_setup();
|
||||
|
||||
if (bypass())
|
||||
return 0;
|
||||
|
||||
r = parse_argv(argc, argv, &c);
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
@@ -48,6 +48,7 @@ export MACHINE_ID='3e0484f3634a418b8e6a39e8828b03e3'
|
||||
export KERNEL_INSTALL_UKIFY="$ukify"
|
||||
export KERNEL_INSTALL_BOOT_STUB="$boot_stub"
|
||||
export KERNEL_INSTALL_READ_MACHINE_INFO="no"
|
||||
export KERNEL_INSTALL_BYPASS="no"
|
||||
|
||||
# Test type#1 installation
|
||||
"$kernel_install" -v add 1.1.1 "$D/sources/linux" "$D/sources/initrd"
|
||||
|
||||
Reference in New Issue
Block a user