From 0f399f48ff1e6c07d88a7ef18b27df84e8cbac6a Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Mon, 30 Apr 2012 12:39:04 -0400 Subject: [PATCH] Verify that binaries exist before startVolumes calls them --- defaults/initrd.scripts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 4aad686..02843c5 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -599,7 +599,12 @@ startVolumes() { if [ "${USE_MDADM}" = '1' ] then - /sbin/mdadm --assemble --scan + if [ -e '/sbin/mdadm' ] + then + /sbin/mdadm --assemble --scan + else + bad_msg "mdadm not found: skipping mdadm raid assembly!" + fi fi if [ "${USE_DMRAID_NORMAL}" = '1' ] @@ -649,7 +654,12 @@ startVolumes() { if [ "${USE_ZFS}" = '1' ] then - /sbin/zpool import -N -a ${ZPOOL_FORCE} + if [ -e '/sbin/zpool' ] + then + /sbin/zpool import -N -a ${ZPOOL_FORCE} + else + bad_msg "zpool not found: skipping ZFS pool import!" + fi fi } -- 2.26.2