nanobsd: Remove dependency on bsdlabel

The bsdlabel utility is deprecated, gpart should be used instead:

  - Offset the first 16 sectors, just like bsdlabel did (used for
    metadata)
  - Use a freebsd-ufs partition type (regardless bsdlabel creating a
    '!0')

Reviewed by:	emaste, imp
Approved by:	emaste (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47653
This commit is contained in:
Jose Luis Duran 2024-11-18 00:16:50 +00:00
parent accf71534c
commit 87e87fecb1
No known key found for this signature in database
GPG Key ID: 5415E244477475CC

View File

@ -116,14 +116,15 @@ create_code_slice ( ) (
trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT
bsdlabel -w ${MD}
gpart create -s bsd "${MD}"
gpart add -t freebsd-ufs -b 16 "${MD}"
if [ -f ${NANO_WORLDDIR}/boot/boot ]; then
echo "Making bootable partition"
gpart bootcode -b ${NANO_WORLDDIR}/boot/boot ${MD}
else
echo "Partition will not be bootable"
fi
bsdlabel ${MD}
gpart list ${MD}
# Create first image
populate_slice /dev/${MD}${NANO_PARTITION_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}"