The branch main has been updated by jlduran:

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

commit 728b3b7c437e9cf3fc5073341a78dd763801489f
Author:     Jose Luis Duran <[email protected]>
AuthorDate: 2026-07-29 16:12:29 +0000
Commit:     Jose Luis Duran <[email protected]>
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"

Reply via email to