- # if dm-mod isn't available then kpartx will fail with
- # "Is device-mapper driver missing from kernel? [...]"
- if ! kpartx -av "$TARGET" >/dev/null 2>&1 || ! grep -q 'device-mapper' /proc/misc >/dev/null 2>&1 ; then
- einfo "Device-mapper not ready yet, trying to load dm-mod module."
- modprobe dm-mod ; eend $?
- fi
-
- # make sure loop module is present
- if ! losetup -f >/dev/null 2>&1; then
- einfo "Can not find a usable loop device, retrying after loading loop module."
- modprobe loop
- if losetup -f >/dev/null 2>&1; then
- einfo "Found a usable loop device now, continuing."
- else
- eerror "Error finding usable loop device" ; eend 1
- bailout 1
- fi
- fi
-