]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
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 d968f564bc7f929e30b165e655b6c40a7319020c..f522f03e3f32e44a336276119d9046ab427bf1a0 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 63939e95d94226b65cc822d79dc6f65b68db5cba..dba68171741f722b0ff3b70674c396bf038c7197 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 a682aa2e11f3057a121c4730a43f27b212b77992..1b4b53e1bffb3549eb018de56387096493ccc850 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 4189eaa7aeec7f6cb748732a9deb79b102291a33..8f08cd88a8f2569782fd8bb9e9e3cad707bd79f1 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 b79858b75658f3e9dd97f8afe54334a6019f9dbf..6dc85b8022e505ade2700b8638c6d25c502f997f 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 2160f4d952674e6b6bcf6d58bb64acc0b4cc687b..178bce53c2778a1cd21463518f0df8c24861eea9 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-[ "$1" != "-h" ] && exit 1
+[ "$1" = "-H" ] || [ "$1" = "--hostonly" ] && exit 1
index 3b2a4c3e8186bd71dd5d26d6f6e461031e08a360..1c54b34f35482bbc65a91b25cd6678ad3c2f29d2 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 b5330359415062d641107f70fc9c6e43e429bf9a..909b67f554ba646f8ba2284c67168a07d43753c7 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