The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=90593b1bdb80a41b499b47437b4f545c24666b2d

commit 90593b1bdb80a41b499b47437b4f545c24666b2d
Author:     Warner Losh <i...@freebsd.org>
AuthorDate: 2025-09-09 16:00:14 +0000
Commit:     Warner Losh <i...@freebsd.org>
CommitDate: 2025-09-09 21:49:06 +0000

    nanobsd: Expose do_image_prep on command line
    
    do_image_prep will skip the customizations and other image prep that's
    the same each time. It was just set before for -I. Expose it now with -p
    which doesn't have the other side effects. Also, fix a bug where early
    customization was run in this case. We don't want that run multiple
    times when building an image from an existing tree or when skipping
    image prep (there's no reason to make it a separate hook). Also change
    example small media from Compact Flash to SD Card (though maybe it
    should be microSD card, eMMC or similar, but that's getting too
    verbose).
    
    Sponsored by:           Netflix
---
 share/man/man8/nanobsd.8       | 10 +++++++---
 tools/tools/nanobsd/nanobsd.sh | 12 ++++++++++--
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/share/man/man8/nanobsd.8 b/share/man/man8/nanobsd.8
index 838f9ddc9afa..8a1f44af6900 100644
--- a/share/man/man8/nanobsd.8
+++ b/share/man/man8/nanobsd.8
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd July 14, 2025
+.Dd September 9, 2025
 .Dt NANOBSD 8
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 .Nd create an embedded FreeBSD system image
 .Sh SYNOPSIS
 .Nm
-.Op Fl BbfhIiKknqvWwX
+.Op Fl BbfhIiKknpqvWwX
 .Op Fl c Ar config-file
 .Sh DESCRIPTION
 The
@@ -42,7 +42,7 @@ utility is a script which produces a minimal implementation of
 .Fx
 (called
 .Nm NanoBSD ) ,
-which typically fits on a small media such as a Compact Flash card,
+which typically fits on a small media such as an SD card,
 or other mass storage medium.
 It can be used to build specialized install images, designed for easy
 installation and maintenance.
@@ -77,6 +77,10 @@ This suppresses the normal cleanup work done before the
 .Cm buildworld
 stage and adds -DNO_CLEAN to the make command line
 used for each build stage (world and kernel).
+.It Fl r
+Don't prepare the image.
+Skip running of the customization and early customization scripts for
+incremental image refinement from world, kernel, or packages.
 .It Fl q
 Make output more quiet.
 .It Fl v
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh
index 3a09468176cf..208bc646122d 100755
--- a/tools/tools/nanobsd/nanobsd.sh
+++ b/tools/tools/nanobsd/nanobsd.sh
@@ -49,7 +49,7 @@ do_prep_image=true
 . "${topdir}/legacy.sh"
 
 set +e
-args=`getopt BKXWbc:fhiIknqvw $*`
+args=`getopt BKXWbc:fhiIknpqvw $*`
 if [ $? -ne 0 ] ; then
        usage
        exit 2
@@ -121,6 +121,10 @@ do
                do_clean=false
                shift
                ;;
+       -p)
+               do_prep_image=false
+               shift
+               ;;
        -q)
                PPLEVEL=$(($PPLEVEL - 1))
                shift
@@ -158,7 +162,11 @@ fi
 
 pprint 1 "NanoBSD image ${NANO_NAME} build starting"
 
-run_early_customize
+if $do_prep_image ; then
+       run_early_customize
+else
+       pprint 2 "Skipping early customization for image prep (as instructed)"
+fi
 
 if $do_world ; then
        if $do_clean ; then

Reply via email to