aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@FreeBSD.org>2026-07-29 16:12:29 +0000
committerJose Luis Duran <jlduran@FreeBSD.org>2026-07-29 16:15:15 +0000
commit728b3b7c437e9cf3fc5073341a78dd763801489f (patch)
tree4a89a05baed709b0ec09c4388dbda4ab2f4d1e7e
parent4007d914e7973bca8ac488ab50aca56964eed90f (diff)
nanobsd: Restore boot0cfg functionality
The need for this step is fading, now is mostly used to allow the selection of just the two code partitions in the boot0 boot manager, instead of the default of allowing all four MBR slices (the other two being cfg and data, which cannot boot). Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D57311
-rw-r--r--tools/tools/nanobsd/legacy.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh
index 467c7b845672..aef34a2cf77d 100644
--- a/tools/tools/nanobsd/legacy.sh
+++ b/tools/tools/nanobsd/legacy.sh
@@ -220,6 +220,7 @@ create_diskimage() {
# XXX: pick up cached boot* files, they may not be in image anymore.
if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then
gpart bootcode -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOTFLAGS} ${MD}
+ boot0cfg ${NANO_BOOT0CFG} ${MD}
fi
echo "Writing code image..."
@@ -288,6 +289,9 @@ _create_diskimage() {
IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
if [ -f "${NANO_WORLDDIR}/${NANO_BOOTLOADER}" ]; then
+ [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 ${NANO_WORLDDIR}/${NANO_BOOTLOADER}
+ boot0cfg ${NANO_BOOT0CFG} ${NANO_WORLDDIR}/${NANO_BOOTLOADER}
+ [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 ${NANO_WORLDDIR}/${NANO_BOOTLOADER}
bootloader="-b ${NANO_WORLDDIR}/${NANO_BOOTLOADER}"
else
echo "Image will not be bootable"