summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1-init.sh
diff options
context:
space:
mode:
authorRoger Qiu <roger.qiu@polycademy.com>2016-02-24 18:54:25 +1100
committerRoger Qiu <roger.qiu@polycademy.com>2016-02-24 18:54:25 +1100
commit5cf823e1f48296b666eaa116dd153bd2fd10184c (patch)
tree62fa5a84f344993791664075938f84d13953a290 /nixos/modules/system/boot/stage-1-init.sh
parent3ef63227dd580d97cd6052bb03ec05a878fd6e93 (diff)
downloadnixlib-5cf823e1f48296b666eaa116dd153bd2fd10184c.tar
nixlib-5cf823e1f48296b666eaa116dd153bd2fd10184c.tar.gz
nixlib-5cf823e1f48296b666eaa116dd153bd2fd10184c.tar.bz2
nixlib-5cf823e1f48296b666eaa116dd153bd2fd10184c.tar.lz
nixlib-5cf823e1f48296b666eaa116dd153bd2fd10184c.tar.xz
nixlib-5cf823e1f48296b666eaa116dd153bd2fd10184c.tar.zst
nixlib-5cf823e1f48296b666eaa116dd153bd2fd10184c.zip
nixos/stage-1/2: Added -r option to read so that read interprets backslashes literally, and corrected the comment about optional logging.
Diffstat (limited to 'nixos/modules/system/boot/stage-1-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh5
1 files changed, 2 insertions, 3 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