Blame 0053-base-dracut-lib.sh-change-output-of-info-and-warn-fo.patch

Harald Hoyer e3ef57
From d9087a2d85dd65e1e33c8c2247d4fccfd7fbc5da Mon Sep 17 00:00:00 2001
Harald Hoyer e3ef57
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer e3ef57
Date: Thu, 21 Jun 2012 01:09:38 +0200
Harald Hoyer e3ef57
Subject: [PATCH] base/dracut-lib.sh: change output of info() and warn() for
Harald Hoyer e3ef57
 systemd
Harald Hoyer e3ef57
Harald Hoyer e3ef57
---
Harald Hoyer e3ef57
 modules.d/99base/dracut-lib.sh |   36 +++++++++++++++++++++++++-----------
Harald Hoyer e3ef57
 1 file changed, 25 insertions(+), 11 deletions(-)
Harald Hoyer e3ef57
Harald Hoyer e3ef57
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
Harald Hoyer e3ef57
index 8cfd7b3..e0c4c19 100755
Harald Hoyer e3ef57
--- a/modules.d/99base/dracut-lib.sh
Harald Hoyer e3ef57
+++ b/modules.d/99base/dracut-lib.sh
Harald Hoyer e3ef57
@@ -323,18 +323,32 @@ check_quiet() {
Harald Hoyer e3ef57
     fi
Harald Hoyer e3ef57
 }
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
-warn() {
Harald Hoyer e3ef57
-    check_quiet
Harald Hoyer e3ef57
-    echo "<28>dracut Warning: $@" > /dev/kmsg
Harald Hoyer e3ef57
-    echo "dracut Warning: $@" >&2
Harald Hoyer e3ef57
-}
Harald Hoyer e3ef57
+if [ ! -x /lib/systemd/systemd ]; then
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
-info() {
Harald Hoyer e3ef57
-    check_quiet
Harald Hoyer e3ef57
-    echo "<30>dracut: $@" > /dev/kmsg
Harald Hoyer e3ef57
-    [ "$DRACUT_QUIET" != "yes" ] && \
Harald Hoyer e3ef57
-        echo "dracut: $@"
Harald Hoyer e3ef57
-}
Harald Hoyer e3ef57
+    warn() {
Harald Hoyer e3ef57
+        check_quiet
Harald Hoyer e3ef57
+        echo "<28>dracut Warning: $@" > /dev/kmsg
Harald Hoyer e3ef57
+        echo "dracut Warning: $@" >&2
Harald Hoyer e3ef57
+    }
Harald Hoyer e3ef57
+
Harald Hoyer e3ef57
+    info() {
Harald Hoyer e3ef57
+        check_quiet
Harald Hoyer e3ef57
+        echo "<30>dracut: $@" > /dev/kmsg
Harald Hoyer e3ef57
+        [ "$DRACUT_QUIET" != "yes" ] && \
Harald Hoyer e3ef57
+            echo "dracut: $@"
Harald Hoyer e3ef57
+    }
Harald Hoyer e3ef57
+
Harald Hoyer e3ef57
+else
Harald Hoyer e3ef57
+
Harald Hoyer e3ef57
+    warn() {
Harald Hoyer e3ef57
+        echo "Warning: $@" >&2
Harald Hoyer e3ef57
+    }
Harald Hoyer e3ef57
+
Harald Hoyer e3ef57
+    info() {
Harald Hoyer e3ef57
+        echo "$@"
Harald Hoyer e3ef57
+    }
Harald Hoyer e3ef57
+
Harald Hoyer e3ef57
+fi
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
 vwarn() {
Harald Hoyer e3ef57
     while read line; do