esac
}
-setup_hotplug() {
- if [ "${KV_2_6_OR_GREATER}" ]
- then
- echo /sbin/mdev > /proc/sys/kernel/hotplug
- fi
-}
-
setup_slowusb() {
# This function removes unset DO_slowusb if there is no usb-storage attached.
# If noslowusb is set, skip this function
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' ]
if [ "${USE_ZFS}" = '1' ]
then
- /sbin/zpool import -N -a ${ZPOOL_FORCE}
+ if [ -z "${ZFS_POOL}" ]
+ then
+ good_msg "Importing ZFS pools"
+
+ /sbin/zpool import -N -a "${ZPOOL_FORCE}"
+
+ if [ "$?" = '0' ]
+ then
+ good_msg "Importing ZFS pools succeeded"
+ else
+ bad_msg "Imported ZFS pools failed"
+ fi
+ else
+
+ if [ "$(zpool list -H -o name ${ZFS_POOL} 2>&1)" = "$ZFS_POOL" ]
+ then
+ good_msg "ZFS pool ${ZFS_POOL} already imported"
+ else
+ good_msg "Importing ZFS pool ${ZFS_POOL}"
+
+ /sbin/zpool import -N "${ZPOOL_FORCE}" "${ZFS_POOL}"
+
+ if [ "$?" = '0' ]
+ then
+ good_msg "Importing ${ZFS_POOL} succeeded"
+ else
+ bad_msg "Importing ${ZFS_POOL} failed"
+ fi
+ fi
+ fi
fi
}
fi
if [ "${retval}" -ne 0 ]; then
- REAL_LUKS=`blkid -l -t "${LUKS_DEVICE}" | cut -d ":" -f 1 2>/dev/null`
+ REAL_LUKS=`blkid -o device -l -t "${LUKS_DEVICE}"`
retval=$?
fi