summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-2-init.sh
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-04-05 00:27:25 +0200
committerJörg Thalheim <joerg@thalheim.io>2017-04-05 09:05:18 +0200
commita17344c2adf7082b90b315eed3d954df0a4fd575 (patch)
treee07ca76ea271800519002908aaee665941fc18a8 /nixos/modules/system/boot/stage-2-init.sh
parentb42af252238d8e5a4b737ad39fda503f9d93c36f (diff)
downloadnixpkgs-a17344c2adf7082b90b315eed3d954df0a4fd575.tar
nixpkgs-a17344c2adf7082b90b315eed3d954df0a4fd575.tar.gz
nixpkgs-a17344c2adf7082b90b315eed3d954df0a4fd575.tar.bz2
nixpkgs-a17344c2adf7082b90b315eed3d954df0a4fd575.tar.lz
nixpkgs-a17344c2adf7082b90b315eed3d954df0a4fd575.tar.xz
nixpkgs-a17344c2adf7082b90b315eed3d954df0a4fd575.tar.zst
nixpkgs-a17344c2adf7082b90b315eed3d954df0a4fd575.zip
stage-2: process options as first action
this way `set -x` is set early
Diffstat (limited to 'nixos/modules/system/boot/stage-2-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index b5b2acf86ab..19e0877d364 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -5,6 +5,21 @@ systemConfig=@systemConfig@
 export HOME=/root PATH="@path@"
 
 
+# Process the kernel command line.
+for o in $(cat /proc/cmdline); do
+    case $o in
+        boot.debugtrace)
+            # Show each command.
+            set -x
+            ;;
+        resume=*)
+            set -- $(IFS==; echo $o)
+            resumeDevice=$2
+            ;;
+    esac
+done
+
+
 # Print a greeting.
 echo
 echo -e "\e[1;32m<<< NixOS Stage 2 >>>\e[0m"
@@ -62,21 +77,6 @@ rm -f /etc/mtab* # not that we care about stale locks
 ln -s /proc/mounts /etc/mtab
 
 
-# Process the kernel command line.
-for o in $(cat /proc/cmdline); do
-    case $o in
-        boot.debugtrace)
-            # Show each command.
-            set -x
-            ;;
-        resume=*)
-            set -- $(IFS==; echo $o)
-            resumeDevice=$2
-            ;;
-    esac
-done
-
-
 # More special file systems, initialise required directories.
 [ -e /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb # UML doesn't have USB by default
 mkdir -m 01777 -p /tmp