From bedcce1a1f13a84126b9d8e8d9120ef8db515d4b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Sep 2025 10:17:00 +0200 Subject: [PATCH] firstboot: drop waiting for key when starting We only show this blurb on the first question, but the first question is interactive anyway, hence no need to wait for input first explicitly, we won't progress anyway without user input. (similar for homectl's firstboot) --- src/firstboot/firstboot.c | 4 +--- src/home/homectl.c | 7 +------ test/units/TEST-74-AUX-UTILS.firstboot.sh | 12 ++++++------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 6a2e8ee2841..9637d9f8f6b 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -147,9 +147,7 @@ static void print_welcome(int rfd, sd_varlink **mute_console_link) { fputs(glyph(GLYPH_SPARKLES), stdout); putchar(' '); } - printf("Please configure your new system!\n"); - - any_key_to_proceed(); + printf("Please configure your new system!\n\n"); done = true; } diff --git a/src/home/homectl.c b/src/home/homectl.c index 8c99120ea61..6c83765766b 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -2888,12 +2888,7 @@ static int create_interactively(void) { fputs(glyph(GLYPH_HOME), stdout); putchar(' '); } - printf("Please create your user account!\n"); - - if (!any_key_to_proceed()) { - log_notice("Skipping."); - return 0; - } + printf("Please create your user account!\n\n"); r = prompt_loop("Please enter user name to create", GLYPH_IDCARD, diff --git a/test/units/TEST-74-AUX-UTILS.firstboot.sh b/test/units/TEST-74-AUX-UTILS.firstboot.sh index 3c1ee5ed163..5f7209231ad 100755 --- a/test/units/TEST-74-AUX-UTILS.firstboot.sh +++ b/test/units/TEST-74-AUX-UTILS.firstboot.sh @@ -211,7 +211,7 @@ set +o pipefail # We can do only limited testing here, since it's all an interactive stuff, so # --prompt is skipped on purpose and only limited --prompt-root-password # testing can be done. -echo -ne "\nfoo\nbar\n" | systemd-firstboot --root="$ROOT" --prompt-locale +echo -ne "foo\nbar\n" | systemd-firstboot --root="$ROOT" --prompt-locale grep -q "LANG=foo" "$ROOT$LOCALE_PATH" grep -q "LC_MESSAGES=bar" "$ROOT$LOCALE_PATH" # systemd-firstboot in prompt-keymap mode requires keymaps to be installed so @@ -219,22 +219,22 @@ grep -q "LC_MESSAGES=bar" "$ROOT$LOCALE_PATH" # compatible keymaps (from the kbd package), skip this test if the keymaps are # missing. if [ -d "/usr/share/keymaps/" ] || [ -d "/usr/share/kbd/keymaps/" ] || [ -d "/usr/lib/kbd/keymaps/" ] ; then - echo -ne "\nfoo\n" | systemd-firstboot --root="$ROOT" --prompt-keymap + echo -ne "foo\n" | systemd-firstboot --root="$ROOT" --prompt-keymap grep -q "KEYMAP=foo" "$ROOT/etc/vconsole.conf" fi -echo -ne "\nEurope/Berlin\n" | systemd-firstboot --root="$ROOT" --prompt-timezone +echo -ne "Europe/Berlin\n" | systemd-firstboot --root="$ROOT" --prompt-timezone readlink "$ROOT/etc/localtime" | grep -q "Europe/Berlin$" -echo -ne "\nfoobar\n" | systemd-firstboot --root="$ROOT" --prompt-hostname +echo -ne "foobar\n" | systemd-firstboot --root="$ROOT" --prompt-hostname grep -q "foobar" "$ROOT/etc/hostname" # With no root password provided, a locked account should be created. systemd-firstboot --root="$ROOT" --prompt-root-password