summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-24 13:50:59 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-24 13:50:59 +0100
commite2af876c78d2b5ad8fd9b2e07b59a3444da98e05 (patch)
tree65a2a3bfa99ab23c636c2cb37d88e3e802c9c9df /nixos
parent2737365741406a2726e755c76390d8d2081119d7 (diff)
parent5cf823e1f48296b666eaa116dd153bd2fd10184c (diff)
downloadnixlib-e2af876c78d2b5ad8fd9b2e07b59a3444da98e05.tar
nixlib-e2af876c78d2b5ad8fd9b2e07b59a3444da98e05.tar.gz
nixlib-e2af876c78d2b5ad8fd9b2e07b59a3444da98e05.tar.bz2
nixlib-e2af876c78d2b5ad8fd9b2e07b59a3444da98e05.tar.lz
nixlib-e2af876c78d2b5ad8fd9b2e07b59a3444da98e05.tar.xz
nixlib-e2af876c78d2b5ad8fd9b2e07b59a3444da98e05.tar.zst
nixlib-e2af876c78d2b5ad8fd9b2e07b59a3444da98e05.zip
Merge pull request #13415 from MatrixAI/master
nixos/stage-1/2: Added -r option to read so that read interprets backslashes literally
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh5
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh4
2 files changed, 4 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index 7a4c93e8a0fa..c0c2b6a94164 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -71,14 +71,13 @@ mount -t devtmpfs -o "size=@devSize@" devtmpfs /dev
 mkdir -p /run
 mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run
 
-
-# Optionally log the script output to /dev/kmsg or /run/log/stage-1-init.log.
+# Log the script output to /dev/kmsg or /run/log/stage-1-init.log.
 mkdir -p /tmp
 mkfifo /tmp/stage-1-init.log.fifo
 logOutFd=8 && logErrFd=9
 eval "exec $logOutFd>&1 $logErrFd>&2"
 if test -w /dev/kmsg; then
-    tee -i < /tmp/stage-1-init.log.fifo /proc/self/fd/"$logOutFd" | while read line; do
+    tee -i < /tmp/stage-1-init.log.fifo /proc/self/fd/"$logOutFd" | while read -r line; do
         if test -n "$line"; then
             echo "<7>stage-1-init: $line" > /dev/kmsg
         fi
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 9b34d24bdbc5..1b5b22c2005a 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -155,11 +155,11 @@ mkdir -m 0755 -p /var/setuid-wrappers
 mount -t tmpfs -o "mode=0755" tmpfs /var/setuid-wrappers
 
 
-# Optionally log the script output to /dev/kmsg or /run/log/stage-2-init.log.
+# Log the script output to /dev/kmsg or /run/log/stage-2-init.log.
 # Only at this point are all the necessary prerequisites ready for these commands.
 exec {logOutFd}>&1 {logErrFd}>&2
 if test -w /dev/kmsg; then
-    exec > >(tee -i /proc/self/fd/"$logOutFd" | while read line; do
+    exec > >(tee -i /proc/self/fd/"$logOutFd" | while read -r line; do
         if test -n "$line"; then
             echo "<7>stage-2-init: $line" > /dev/kmsg
         fi