]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-gencmdline: add missing functions
authorHarald Hoyer <harald@redhat.com>
Fri, 18 Sep 2009 07:08:23 +0000 (09:08 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 18 Sep 2009 07:08:23 +0000 (09:08 +0200)
dracut-gencmdline

index bab102f45b15071c6d1383c47e13838911e88f29..f3cbee146ba57668c7763dafae41c326c50c4205 100755 (executable)
 #
 #. /usr/libexec/initrd-functions
 
+IF_verbose=""
+function set_verbose() {
+    case $1 in
+        1|true|yes|on)
+            IF_verbose="-v"
+            ;;
+        0|false|no|off)
+            IF_verbose=""
+            ;;
+    esac
+}
+
+function is_verbose() {
+    [ -n "$IF_verbose" ] && return 0
+    return 1
+}
+
+function get_verbose() {
+    echo "$IF_verbose"
+    is_verbose
+}
+
+
+function get_numeric_dev() {
+(
+    fmt="%d:%d"
+    if [ "$1" == "hex" ]; then
+        fmt="%x:%x"
+    fi
+    ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
+) 2>/dev/null
+}
+
 
 function error() {
     echo "$@" >&2