Make the labels match the device name that's mounted, not just the

slice they are on.  When NANO_LABEL is not defined, the fstab
generates entries that specify /dev/ad0s1a.  When NANO_LABEL is
defined, it generates /dev/usb/${NANO_LABEL}s1a.  The prior code
created the file system with a label of ${NANO_LABEL}s1, leading to
problems on boot.

Pointy hat to: imp@
This commit is contained in:
Warner Losh 2010-09-22 04:48:39 +00:00
parent 5df4b6be91
commit 12d455a6b1

View File

@ -501,7 +501,7 @@ create_i386_diskimage ( ) (
bsdlabel ${MD}s1
# Create first image
populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1"
populate_slice /dev/${MD}s1a ${NANO_WORLDDIR} ${MNT} "s1a"
mount /dev/${MD}s1a ${MNT}
echo "Generating mtree..."
( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree
@ -518,8 +518,10 @@ create_i386_diskimage ( ) (
sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f
done
umount ${MNT}
# Override the label from the first partition so we
# don't confuse glabel with duplicates.
if [ ! -z ${NANO_LABEL} ]; then
tunefs -L ${NANO_LABEL}"s2" /dev/${MD}s2a
tunefs -L ${NANO_LABEL}"s2a" /dev/${MD}s2a
fi
fi