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
This commit is contained in:
Warner Losh committed 2025-09-09 15:49:06 -06:00
1 parent 0833a3fe5b
commit 90593b1bdb
2 files changed
+17 -5

No files matched your search

+7 -3
View File
@@ -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
+10 -2
View File
@@ -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