nixos/stage-1/2: Added -r option to read so that read interprets backslashes literally, and corrected the comment about optional logging.

Changed files
+4 -5
nixos
modules
+2 -3
nixos/modules/system/boot/stage-1-init.sh
···
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.
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
if test -n "$line"; then
echo "<7>stage-1-init: $line" > /dev/kmsg
fi
···
mkdir -p /run
mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run
+
# 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 -r line; do
if test -n "$line"; then
echo "<7>stage-1-init: $line" > /dev/kmsg
fi
+2 -2
nixos/modules/system/boot/stage-2-init.sh
···
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.
# 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
if test -n "$line"; then
echo "<7>stage-2-init: $line" > /dev/kmsg
fi
···
mount -t tmpfs -o "mode=0755" tmpfs /var/setuid-wrappers
+
# 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 -r line; do
if test -n "$line"; then
echo "<7>stage-2-init: $line" > /dev/kmsg
fi