712866
From 74c9df58f25736aea0da8c56e15d047dc6a9cb5a Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Wed, 22 Jan 2014 11:48:45 +0100
712866
Subject: [PATCH] dracut-logger.sh: systemd-cat only understands prio 0-7
712866
712866
---
712866
 dracut-logger.sh | 4 ++--
712866
 1 file changed, 2 insertions(+), 2 deletions(-)
712866
712866
diff --git a/dracut-logger.sh b/dracut-logger.sh
5c6c2a
index f679dc94..70b0da4c 100755
712866
--- a/dracut-logger.sh
712866
+++ b/dracut-logger.sh
712866
@@ -154,7 +154,7 @@ dlog_init() {
712866
             readonly _systemdcatfile="$_dlogdir/systemd-cat"
712866
             mkfifo "$_systemdcatfile"
712866
             readonly _dlogfd=15
712866
-            systemd-cat -t 'dracut' <"$_systemdcatfile" &
712866
+            systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
712866
             exec 15>"$_systemdcatfile"
712866
         elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
712866
             # We cannot log to syslog, so turn this facility off.
712866
@@ -330,7 +330,7 @@ _do_dlog() {
712866
 
712866
     if (( $lvl <= $sysloglvl )); then
712866
         if [[ "$_dlogfd" ]]; then
712866
-            echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd
712866
+            printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd
712866
         else
712866
             logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
712866
         fi