diff --git a/release/ia64/doFS.sh b/release/ia64/doFS.sh index f75b7242315a..054beebd2749 100644 --- a/release/ia64/doFS.sh +++ b/release/ia64/doFS.sh @@ -47,6 +47,8 @@ if [ ! -c /dev/${MDDEVICE} ] ; then (cd /dev && sh MAKEDEV ${MDDEVICE}) fi +trap "umount ${MNT}; mdconfig -d -u ${MDDEVICE}" EXIT + EFI_SIZE=$((${FSSIZE}-68)) gpt create ${MDDEVICE} @@ -68,9 +70,5 @@ df -ki ${MNT} set `df -ki ${MNT} | tail -1` -umount ${MNT} - -mdconfig -d -u ${MDDEVICE} 2>/dev/null || true - echo "*** Filesystem is ${FSSIZE} K, $4 left" echo "*** ${FSINODE} bytes/inode, $7 left" diff --git a/release/scripts/doFS.sh b/release/scripts/doFS.sh index 8d870fba71ff..08d97a6aa2f6 100644 --- a/release/scripts/doFS.sh +++ b/release/scripts/doFS.sh @@ -58,6 +58,9 @@ dofs_vn () { dd of=${FSIMG} if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null vnconfig -s labels -c /dev/r${VNDEVICE} ${FSIMG} + + trap "umount ${MNT}; vnconfig -u /dev/r${VNDEVICE}" EXIT + disklabel -w ${BOOT} ${VNDEVICE} ${FSLABEL} newfs -i ${FSINODE} -o space -m 0 /dev/r${VNDEVICE}c @@ -73,9 +76,6 @@ dofs_vn () { set `df -ki ${MNT} | tail -1` - umount ${MNT} - vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true - echo "*** Filesystem is ${FSSIZE} K, $4 left" echo "*** ${FSINODE} bytes/inode, $7 left" break; @@ -102,6 +102,9 @@ dofs_md () { echo "No /dev/$MDDEVICE" 1>&2 exit 1 fi + + trap "umount ${MNT}; mdconfig -d -u ${MDDEVICE}" EXIT + disklabel ${MACHINE} -w ${BOOT} ${MDDEVICE} ${FSLABEL} newfs -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE}c @@ -117,9 +120,6 @@ dofs_md () { set `df -ki ${MNT} | tail -1` - umount ${MNT} - mdconfig -d -u ${MDDEVICE} 2>/dev/null || true - echo "*** Filesystem is ${FSSIZE} K, $4 left" echo "*** ${FSINODE} bytes/inode, $7 left" break;