Blob Blame History Raw
From c411899e9dbc3071e7da68b023d532c69c79a05f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 22 Jan 2014 11:48:45 +0100
Subject: [PATCH] dracut-logger.sh: systemd-cat only understands prio 0-7

---
 dracut-logger.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dracut-logger.sh b/dracut-logger.sh
index f679dc9..70b0da4 100755
--- a/dracut-logger.sh
+++ b/dracut-logger.sh
@@ -154,7 +154,7 @@ dlog_init() {
             readonly _systemdcatfile="$_dlogdir/systemd-cat"
             mkfifo "$_systemdcatfile"
             readonly _dlogfd=15
-            systemd-cat -t 'dracut' <"$_systemdcatfile" &
+            systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
             exec 15>"$_systemdcatfile"
         elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
             # We cannot log to syslog, so turn this facility off.
@@ -330,7 +330,7 @@ _do_dlog() {
 
     if (( $lvl <= $sysloglvl )); then
         if [[ "$_dlogfd" ]]; then
-            echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd
+            printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd
         else
             logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
         fi