]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
base/dracut-lib.sh: change output of info() and warn() for systemd
authorHarald Hoyer <harald@redhat.com>
Wed, 20 Jun 2012 23:09:38 +0000 (01:09 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 20 Jun 2012 23:11:44 +0000 (01:11 +0200)
modules.d/99base/dracut-lib.sh

index 8cfd7b34aefa541a94a557ae52014115fdef4736..e0c4c19aaaed0743c31635bb0ad5c4495db62578 100755 (executable)
@@ -323,18 +323,32 @@ check_quiet() {
     fi
 }
 
-warn() {
-    check_quiet
-    echo "<28>dracut Warning: $@" > /dev/kmsg
-    echo "dracut Warning: $@" >&2
-}
+if [ ! -x /lib/systemd/systemd ]; then
 
-info() {
-    check_quiet
-    echo "<30>dracut: $@" > /dev/kmsg
-    [ "$DRACUT_QUIET" != "yes" ] && \
-        echo "dracut: $@"
-}
+    warn() {
+        check_quiet
+        echo "<28>dracut Warning: $@" > /dev/kmsg
+        echo "dracut Warning: $@" >&2
+    }
+
+    info() {
+        check_quiet
+        echo "<30>dracut: $@" > /dev/kmsg
+        [ "$DRACUT_QUIET" != "yes" ] && \
+            echo "dracut: $@"
+    }
+
+else
+
+    warn() {
+        echo "Warning: $@" >&2
+    }
+
+    info() {
+        echo "$@"
+    }
+
+fi
 
 vwarn() {
     while read line; do