From: Warren Togami Date: Fri, 29 May 2009 22:38:49 +0000 (-0400) Subject: Properly detect -H and --hostonly mode X-Git-Tag: 0.1~153^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d7d2fdbbbd8dbd3817a1c4f12a5b6fdae3690d0;p=thirdparty%2Fdracut.git Properly detect -H and --hostonly mode --- diff --git a/README.modules b/README.modules index d968f564b..f522f03e3 100644 --- a/README.modules +++ b/README.modules @@ -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 63939e95d..dba681717 100755 --- 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 diff --git a/modules.d/40nfsroot/check b/modules.d/40nfsroot/check index a682aa2e1..1b4b53e1b 100755 --- a/modules.d/40nfsroot/check +++ b/modules.d/40nfsroot/check @@ -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 diff --git a/modules.d/90crypt/check b/modules.d/90crypt/check index 4189eaa7a..8f08cd88a 100755 --- a/modules.d/90crypt/check +++ b/modules.d/90crypt/check @@ -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 diff --git a/modules.d/90dmraid/check b/modules.d/90dmraid/check index b79858b75..6dc85b802 100755 --- a/modules.d/90dmraid/check +++ b/modules.d/90dmraid/check @@ -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 diff --git a/modules.d/90kernel-modules-loaded/check b/modules.d/90kernel-modules-loaded/check index 2160f4d95..178bce53c 100755 --- a/modules.d/90kernel-modules-loaded/check +++ b/modules.d/90kernel-modules-loaded/check @@ -1,3 +1,3 @@ #!/bin/sh -[ "$1" != "-h" ] && exit 1 +[ "$1" = "-H" ] || [ "$1" = "--hostonly" ] && exit 1 diff --git a/modules.d/90lvm/check b/modules.d/90lvm/check index 3b2a4c3e8..1c54b34f3 100755 --- a/modules.d/90lvm/check +++ b/modules.d/90lvm/check @@ -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 diff --git a/modules.d/90mdraid/check b/modules.d/90mdraid/check index b53303594..909b67f55 100755 --- a/modules.d/90mdraid/check +++ b/modules.d/90mdraid/check @@ -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