Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2026 16:15:28 +0000
From:      Jose Luis Duran <jlduran@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 728b3b7c437e - main - nanobsd: Restore boot0cfg functionality
Message-ID:  <6a6a2720.30e26.65d4324a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=728b3b7c437e9cf3fc5073341a78dd763801489f

commit 728b3b7c437e9cf3fc5073341a78dd763801489f
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2026-07-29 16:12:29 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2026-07-29 16:15:15 +0000

    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
---
 tools/tools/nanobsd/legacy.sh | 4 ++++
 1 file changed, 4 insertions(+)

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"


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a6a2720.30e26.65d4324a>