Verify that binaries exist before startVolumes calls them
authorRichard Yao <ryao@cs.stonybrook.edu>
Mon, 30 Apr 2012 16:39:04 +0000 (12:39 -0400)
committerRichard Yao <ryao@cs.stonybrook.edu>
Mon, 30 Apr 2012 19:08:37 +0000 (15:08 -0400)
defaults/initrd.scripts

index 4aad686e8825959714e30a7d76b10a655a24bb24..02843c57becc5d13f66b0f9a7af83add56aaa342 100755 (executable)
@@ -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
 }