From: Lennart Poettering Date: Thu, 30 Nov 2023 17:25:53 +0000 (+0100) Subject: firstboot: adjust what systemd.firstboot=no on the kernel cmdline does X-Git-Tag: v256-rc1~1474^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a9c4a108258ce91edd27d224b0c52b431a75d87;p=thirdparty%2Fsystemd.git firstboot: adjust what systemd.firstboot=no on the kernel cmdline does So far by setting systemd.firstboot=no simply short-cut the whole tool and made it exit early. This is against what the docs say though: they just claim the user isn't asked for questions anymore. Let's change behaviour so that the code actually matches the docs, or more specifically: if credentials are passed into firstboot, then honour them, regardless of the kernel cmdline option. After all, if we get explicit data passed in we should operate on it, and then leave systemd.firstboot=no just affect the interactivity. I think this was actually mostly a bug introduced because the credential stuff was added after the kernel cmdline option, hence this just catches up with the new addition. --- diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 17d344e9803..129b73c80c5 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -1655,8 +1655,8 @@ static int run(int argc, char *argv[]) { if (r < 0) return log_error_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring: %m"); if (r > 0 && !enabled) { - log_debug("Found systemd.firstboot=no kernel command line argument, terminating."); - return 0; /* disabled */ + log_debug("Found systemd.firstboot=no kernel command line argument, turning off all prompts."); + arg_prompt_locale = arg_prompt_keymap = arg_prompt_timezone = arg_prompt_hostname = arg_prompt_root_password = arg_prompt_root_shell = false; } }