diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2016-05-15 23:49:40 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2016-05-15 23:49:40 -0700 |
commit | 493af2b716fe55a37139858c9f1e8ddb44df4e71 (patch) | |
tree | 87d647d44b3042611f0b601394c6efd5cdf9e8af | |
parent | defaults/linuxrc: bug #232733: implement rootwait. (diff) | |
download | genkernel-493af2b716fe55a37139858c9f1e8ddb44df4e71.tar.gz genkernel-493af2b716fe55a37139858c9f1e8ddb44df4e71.tar.bz2 genkernel-493af2b716fe55a37139858c9f1e8ddb44df4e71.zip |
gen_cmdline: bug #544172: sanity check on mdadm/dmraid.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | gen_cmdline.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/gen_cmdline.sh b/gen_cmdline.sh index e9e74017..24cb6077 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -297,6 +297,12 @@ parse_cmdline() { --mdadm|--no-mdadm) CMD_MDADM=`parse_optbool "$*"` print_info 2 "CMD_MDADM: $CMD_MDADM" + if [ "$CMD_MDADM" = "1" -a ! -e /sbin/mdadm ] + then + echo 'Error: --multipath requires sys-fs/mdadm' + echo ' to be installed on the host system.' + exit 1 + fi ;; --mdadm-config=*) CMD_MDADM_CONFIG=`parse_opt "$*"` @@ -320,10 +326,16 @@ parse_cmdline() { ;; --dmraid|--no-dmraid) CMD_DMRAID=`parse_optbool "$*"` + if [ "$CMD_DMRAID" = "1" -a ! -e /usr/sbin/dmraid ] + then + echo 'Error: --dmraid requires sys-fs/dmraid' + echo ' to be installed on the host system.' + exit 1 + fi if [ "$CMD_DMRAID" = "1" -a ! -e /usr/include/libdevmapper.h ] then - echo 'Error: --dmraid requires LVM2 to be installed' - echo ' on the host system; try "emerge lvm2".' + echo 'Error: --dmraid requires sys-fs/lvm2' + echo ' to be installed on the host system.' exit 1 fi print_info 2 "CMD_DMRAID: ${CMD_DMRAID}" @@ -346,10 +358,16 @@ parse_cmdline() { ;; --multipath|--no-multipath) CMD_MULTIPATH=`parse_optbool "$*"` + if [ "$CMD_MULTIPATH" = "1" -a ! -e /sbin/multipath ] + then + echo 'Error: --multipath requires sys-fs/multipath-tools' + echo ' to be installed on the host system.' + exit 1 + fi if [ "$CMD_MULTIPATH" = "1" -a ! -e /usr/include/libdevmapper.h ] then - echo 'Error: --multipath requires LVM2 to be installed' - echo ' on the host;system; try "emerge lvm2".' + echo 'Error: --multipath requires sys-fs/lvm2' + echo ' to be installed on the host system.' exit 1 fi print_info 2 "CMD_MULTIPATH: ${CMD_MULTIPATH}" |