Instead of clearing these options by select boot targets prior to boot, let's instead clear them directly after the boot aborting. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- common/blspec.c | 1 - common/boot.c | 3 ++- common/fastboot.c | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/common/blspec.c b/common/blspec.c index ea334e18718a..8a7f996e78d2 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -81,7 +81,6 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun) .dryrun = dryrun, }; - globalvar_set_match("linux.bootargs.dyn.", ""); globalvar_set("bootm.image", ""); globalvar_set("bootm.oftree", ""); globalvar_set("bootm.initrd", ""); diff --git a/common/boot.c b/common/boot.c index ced3b3a3477c..42818c6e2154 100644 --- a/common/boot.c +++ b/common/boot.c @@ -83,7 +83,6 @@ static int bootscript_boot(struct bootentry *entry, int verbose, int dryrun) globalvar_add_simple("linux.bootargs.dyn.ip", NULL); globalvar_add_simple("linux.bootargs.dyn.root", NULL); - globalvar_set_match("linux.bootargs.dyn.", ""); ret = run_command(bs->scriptpath); if (ret) { @@ -162,6 +161,8 @@ int boot_entry(struct bootentry *be, int verbose, int dryrun) if (ret && ret != -ENOMEDIUM) pr_err("Booting entry '%s' failed: %pe\n", be->title, ERR_PTR(ret)); + globalvar_set_match("linux.bootargs.dyn.", ""); + return ret; } diff --git a/common/fastboot.c b/common/fastboot.c index 66b59ab9b0d7..acc91490a553 100644 --- a/common/fastboot.c +++ b/common/fastboot.c @@ -419,7 +419,6 @@ static void __maybe_unused cb_boot(struct fastboot *fb, const char *opt) fastboot_tx_print(fb, FASTBOOT_MSG_INFO, "Booting kernel..\n"); - globalvar_set_match("linux.bootargs.dyn.", ""); globalvar_set("bootm.image", ""); data.os_file = fb->tempname; -- 2.39.5