X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fcommon.sh.in;h=f087f443108d207a33d8793a33281320c5adf3c0;hb=ddc07fa57a2e002822ae30f2e18c5427f4e3eb74;hp=71a6b18a06f7401cefc2a57353a4253e66a4e63b;hpb=93648f314c258897a0fa72b0d0b164e1937a5b63;p=zfs.git diff --git a/scripts/common.sh.in b/scripts/common.sh.in index 71a6b18..f087f44 100644 --- a/scripts/common.sh.in +++ b/scripts/common.sh.in @@ -124,7 +124,7 @@ init() { # set to ensure the udev rule is correctly replaced on exit. local RULE=${udevruledir}/90-zfs.rules if test -e ${RULE}; then - trap "mv ${RULE}.disabled ${RULE}; exit $?" INT TERM EXIT + trap "mv ${RULE}.disabled ${RULE}" INT TERM EXIT mv ${RULE} ${RULE}.disabled fi } @@ -263,7 +263,7 @@ check_loop_utils() { # Find and return an unused loopback device. # unused_loop_device() { - for DEVICE in `ls -1 /dev/loop* 2>/dev/null`; do + for DEVICE in `ls -1 /dev/loop[0-9]* 2>/dev/null`; do ${LOSETUP} ${DEVICE} &>/dev/null if [ $? -ne 0 ]; then echo ${DEVICE} @@ -342,7 +342,9 @@ format() { local DEVICE=$1 local FSTYPE=$2 - /sbin/mkfs.${FSTYPE} -q ${DEVICE} || return 1 + # Force 4K blocksize, else mkfs.ext2 tries to use 8K, which + # won't mount + /sbin/mkfs.${FSTYPE} -b 4096 -F -q ${DEVICE} || return 1 return 0 }