Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

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

Roger Qiu 5cf823e1 3ef63227

+4 -5
+2 -3
nixos/modules/system/boot/stage-1-init.sh
··· 71 71 mkdir -p /run 72 72 mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run 73 73 74 - 75 - # Optionally log the script output to /dev/kmsg or /run/log/stage-1-init.log. 74 + # Log the script output to /dev/kmsg or /run/log/stage-1-init.log. 76 75 mkdir -p /tmp 77 76 mkfifo /tmp/stage-1-init.log.fifo 78 77 logOutFd=8 && logErrFd=9 79 78 eval "exec $logOutFd>&1 $logErrFd>&2" 80 79 if test -w /dev/kmsg; then 81 - tee -i < /tmp/stage-1-init.log.fifo /proc/self/fd/"$logOutFd" | while read line; do 80 + tee -i < /tmp/stage-1-init.log.fifo /proc/self/fd/"$logOutFd" | while read -r line; do 82 81 if test -n "$line"; then 83 82 echo "<7>stage-1-init: $line" > /dev/kmsg 84 83 fi
+2 -2
nixos/modules/system/boot/stage-2-init.sh
··· 155 155 mount -t tmpfs -o "mode=0755" tmpfs /var/setuid-wrappers 156 156 157 157 158 - # Optionally log the script output to /dev/kmsg or /run/log/stage-2-init.log. 158 + # Log the script output to /dev/kmsg or /run/log/stage-2-init.log. 159 159 # Only at this point are all the necessary prerequisites ready for these commands. 160 160 exec {logOutFd}>&1 {logErrFd}>&2 161 161 if test -w /dev/kmsg; then 162 - exec > >(tee -i /proc/self/fd/"$logOutFd" | while read line; do 162 + exec > >(tee -i /proc/self/fd/"$logOutFd" | while read -r line; do 163 163 if test -n "$line"; then 164 164 echo "<7>stage-2-init: $line" > /dev/kmsg 165 165 fi