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

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