Properly detect -H and --hostonly mode
authorWarren Togami <wtogami@redhat.com>
Fri, 29 May 2009 22:38:49 +0000 (18:38 -0400)
committerWarren Togami <wtogami@redhat.com>
Fri, 29 May 2009 22:38:49 +0000 (18:38 -0400)
README.modules
dracut
modules.d/40nfsroot/check
modules.d/90crypt/check
modules.d/90dmraid/check
modules.d/90kernel-modules-loaded/check
modules.d/90lvm/check
modules.d/90mdraid/check

index d968f56..f522f03 100644 (file)
@@ -35,7 +35,7 @@ check: Dracut calls this program to check and see if a module can be installed
        are present.  It should exit with a 0 if they are, and a 1 if they are
        not.
 
-       When called with -h, it should perform the same check that it would
+       When called with -H, it should perform the same check that it would
        without any options, and it should also check to see if the 
        functionality the module implements is being used on the host system.
        For example, if this module handles installing support for LUKS
@@ -49,4 +49,4 @@ check: Dracut calls this program to check and see if a module can be installed
 
 Any other files in the module will not be touched by dracut directly. 
 
-You are encouraged to provide a README that descrobes what the module is for.
\ No newline at end of file
+You are encouraged to provide a README that descrobes what the module is for.
diff --git a/dracut b/dracut
index 63939e9..dba6817 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -84,13 +84,14 @@ dracutfunctions=$dsrc/dracut-functions
 export dracutfunctions
 
 # this logic is weird and convoluted.  We should simplify it.
+# seriously, wtf?
 case $dracutmodules in
        ""|auto)
                dracutmodules="all"
                ;;
        hostonly)
                dracutmodules="all"
-               hostonly="-h"
+               hostonly="-H"
                ;;
 esac
 
index a682aa2..1b4b53e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 [ "$1" = "-d" ] && echo network
-[ "$1" = "-h" ] && ! egrep -q '/ nfs[34 ]' /proc/mounts && exit 1
+[ "$1" = "-H" ] || [ "$1" = "--hostonly" ] && ! egrep -q '/ nfs[34 ]' /proc/mounts && exit 1
 which rpcbind rpc.statd mount.nfs mount.nfs4 umount >/dev/null 2>&1 || exit 1
 exit 0
index 4189eaa..8f08cd8 100755 (executable)
@@ -2,7 +2,7 @@
 
 which cryptsetup >/dev/null 2>&1 || exit 1
 
-if [ "$1" = "-h" ]; then
+if [ "$1" = "-H" ] || [ "$1" = "--hostonly" ]; then
     blkid | grep -q crypt_LUKS || exit 1
 fi
 
index b79858b..6dc85b8 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 which dmraid >/dev/null 2>&1 || exit 1
 
-if [ "$1" = "-h" ]; then
+if [ "$1" = "-H" ] || [ "$1" = "--hostonly" ]; then
     dmraid -r | grep -q ok || exit 1
 fi
 
-exit 0
\ No newline at end of file
+exit 0
index 2160f4d..178bce5 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-[ "$1" != "-h" ] && exit 1
+[ "$1" = "-H" ] || [ "$1" = "--hostonly" ] && exit 1
index 3b2a4c3..1c54b34 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 which lvm >/dev/null 2>&1 || exit 1
 
-if [ "$1" = "-h" ]; then
+if [ "$1" = "-H" ] || [ "$1" = "--hostonly" ]; then
     blkid | grep -q lvm2pv || exit 1
 fi
 
index b533035..909b67f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 which mdadm >/dev/null 2>&1 || exit 1
 
-if [ "$1" = "-h" ]; then
+if [ "$1" = "-H" ] || [ "$1" = "--hostonly" ]; then
     blkid | grep -q linux_raid || exit 1
 fi