summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1-init.sh
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2019-07-25 18:23:32 +0300
committerNikolay Amiantov <ab@fmap.me>2019-08-19 19:54:00 +0300
commitfca97dfebccd1c68f03fef916f4dc1e0b4e57e74 (patch)
tree145914f86ce37a4e7c85c141ffb5d52a92cdb0dd /nixos/modules/system/boot/stage-1-init.sh
parentc3a6c8de88889c7679b88d867c618a250befec78 (diff)
downloadnixpkgs-fca97dfebccd1c68f03fef916f4dc1e0b4e57e74.tar
nixpkgs-fca97dfebccd1c68f03fef916f4dc1e0b4e57e74.tar.gz
nixpkgs-fca97dfebccd1c68f03fef916f4dc1e0b4e57e74.tar.bz2
nixpkgs-fca97dfebccd1c68f03fef916f4dc1e0b4e57e74.tar.lz
nixpkgs-fca97dfebccd1c68f03fef916f4dc1e0b4e57e74.tar.xz
nixpkgs-fca97dfebccd1c68f03fef916f4dc1e0b4e57e74.tar.zst
nixpkgs-fca97dfebccd1c68f03fef916f4dc1e0b4e57e74.zip
stage-1 init: fix debug menu
* Read one char at a time, so user doesn't have to enter "i<ENTER>"
  contrary to the menu;
* Exec shell inside setsid.
Diffstat (limited to 'nixos/modules/system/boot/stage-1-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index 67cbe720ddc..b817a45deba 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -44,13 +44,13 @@ EOF
   *) to ignore the error and continue
 EOF
 
-    read reply
+    read -n 1 reply
 
     if [ -n "$allowShell" -a "$reply" = f ]; then
         exec setsid @shell@ -c "exec @shell@ < /dev/$console >/dev/$console 2>/dev/$console"
     elif [ -n "$allowShell" -a "$reply" = i ]; then
         echo "Starting interactive shell..."
-        setsid @shell@ -c "@shell@ < /dev/$console >/dev/$console 2>/dev/$console" || fail
+        setsid @shell@ -c "exec @shell@ < /dev/$console >/dev/$console 2>/dev/$console" || fail
     elif [ "$reply" = r ]; then
         echo "Rebooting..."
         reboot -f