Skip to content

Commit

Permalink
ash_functions: make sure newlines are passed, fix error redirection
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Laurion <[email protected]>
  • Loading branch information
tlaurion committed Sep 1, 2024
1 parent cba46e4 commit 91cbc66
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions initrd/etc/ash_functions
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@

die() {
if [ "$CONFIG_DEBUG_OUTPUT" = "y" ];then
echo " !!! ERROR: $* !!!" | tee -a /tmp/debug.log /dev/kmsg > /dev/null;
echo -e " !!! ERROR: $* !!!" | tee -a /tmp/debug.log /dev/kmsg > /dev/null;
else
echo >&2 "!!! ERROR: $* !!!";
echo -e "!!! ERROR: $* !!!" > &2;
fi
sleep 2;
exit 1;
}

warn() {
if [ "$CONFIG_DEBUG_OUTPUT" = "y" ];then
echo " *** WARNING: $* ***" | tee -a /tmp/debug.log /dev/kmsg > /dev/null;
echo -e " *** WARNING: $* ***" | tee -a /tmp/debug.log /dev/kmsg > /dev/null;
else
echo >&2 " *** WARNING: $* ***";
echo -e " *** WARNING: $* ***" > &2;
fi
sleep 1;
}
Expand Down

0 comments on commit 91cbc66

Please sign in to comment.