]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
firstboot: drop waiting for key when starting
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Sep 2025 08:17:00 +0000 (10:17 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 26 Sep 2025 14:27:53 +0000 (16:27 +0200)
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
src/home/homectl.c
test/units/TEST-74-AUX-UTILS.firstboot.sh

index 6a2e8ee2841443993c5cb4ec752fc2d13822c431..9637d9f8f6b355475d768f02f1332abfe44fdece 100644 (file)
@@ -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;
 }
index 8c99120ea61fbe0a439794478d22604d5abefd5a..6c83765766b84265ce2b5295b56c5e8331f92f63 100644 (file)
@@ -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,
index 3c1ee5ed16382f577ee83b84860a85258036da17..5f7209231ad106190d638a6c141c3d514e86286e 100755 (executable)
@@ -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 </dev/null
 grep -q "^root:x:0:0:" "$ROOT/etc/passwd"
 grep -q "^root:!\*:" "$ROOT/etc/shadow"
 rm -fv "$ROOT/etc/passwd" "$ROOT/etc/shadow"
-echo -ne "\n/bin/fooshell\n" | systemd-firstboot --root="$ROOT" --prompt-root-shell
+echo -ne "/bin/fooshell\n" | systemd-firstboot --root="$ROOT" --prompt-root-shell
 grep -q "^root:.*:0:0:.*:/bin/fooshell$" "$ROOT/etc/passwd"
 # Existing files should not get overwritten
-echo -ne "\n/bin/barshell\n" | systemd-firstboot --root="$ROOT" --prompt-root-shell
+echo -ne "/bin/barshell\n" | systemd-firstboot --root="$ROOT" --prompt-root-shell
 grep -q "^root:.*:0:0:.*:/bin/fooshell$" "$ROOT/etc/passwd"
 # Now without the welcome screen but with force
 echo -ne "/bin/barshell\n" | systemd-firstboot --root="$ROOT" --force --prompt-root-shell --welcome=no