Blame SOURCES/0088-dracut-logger.sh-systemd-cat-only-understands-prio-0.patch

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