From nobody Tue Sep 9 21:49:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cLyBv3htmz66VSc; Tue, 09 Sep 2025 21:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cLyBv2N49z3Ndx; Tue, 09 Sep 2025 21:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757454551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Li/mCPGqitzZt1byg4UswmkptgcPX7ai2O/e4a6nu4k=; b=p4cEH8pHgZHpH6BLuyM8Axr/dUyfFs1BFTbJOOCTpIYPlB/pEgjUQlMbpBVevXLzZs/cl7 wz9Tzab/7w4ld3KX4jz9a7AqTjiL7NQVkqhbtHImlbX60OSsZ0gtzwRA8woiaiYn/T/ifD 8gdpq0IZ6BaRjydW65BfWZ1PWih4W1FFfQQ+SNgMnzDoIAKOVcUwBkYNob/ByDPCKLbuWQ jLi4j8QELcGIOezwbrREgjSC4FzGVqgFfIIZ2JpOs4qadB2pjaJds928JPfwCOtgcxzixu pEaO5v1/HO92ZH0dvyOH3H3V5CLMOKBBFPFT8SaGGOoYaEAzzoG1WPr/4tiuZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757454551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Li/mCPGqitzZt1byg4UswmkptgcPX7ai2O/e4a6nu4k=; b=O6gjT9KU8NhpOlecny0GtNwqi/OHjvaD8UgduiXNBDc+22OFCGOP10bWuDWOO7zlR8VkPE +NTNaUOva2n2+Tx4CO4WwJnah9aDrS8+AG5v5oakLeDyLuGK5/LpeAvmGXeWcpf4c7pS0C 5kzvkN/B+vCLb3CtCKZ2hHx+tPLoJePzO8aaD1XL8i67TzM3RX1TAr0xQCG1MSMyYQGGPk xFA7gT60d7zgGjz6OOMztWjfBi8viU2UYx3KD7hKF+gPp6FoBuXS7ZOAtft0fpzlW50WkJ 2jFvHlNlPDY+ajKDKaDqTM7h6ImJnvIIp+zp1NOPhjwqd/EPSkf99W5+cOvVWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757454551; a=rsa-sha256; cv=none; b=hTaohRXBJm66V9H/zNCsqgm3TnuNv6YBbfmwmhxIF1YQS0UeCQd/fRaxF+YbyIPQUfYoKr UD7rzPOLCKd5IMIVzJ1sFwFe+nHRIo4ywz3GPMf7KfK5eF3Ir5HJeWcA0lNgSi+wdcoZQp qiUF1GDhVSBQ6I+H2LjY+zJpqOYua7TZRE68P6sDC/WkQZN9eWkMHUexiW9m0FKUrcbVAO dCku4Aw44swGinceCZ0ybnSLS03pcD/vNweMH6Zrn42M3uAjh+iSh2A1+YuF5OuW/l69eh VRIhqFhj2hTHgMAI4O9gBXSmmZboYlXgUT2KA0H3Q+2Fc1ULc+Bo0zfvmN7Gfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cLyBv1zgHztBL; Tue, 09 Sep 2025 21:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 589LnB2V099986; Tue, 9 Sep 2025 21:49:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 589LnBrg099983; Tue, 9 Sep 2025 21:49:11 GMT (envelope-from git) Date: Tue, 9 Sep 2025 21:49:11 GMT Message-Id: <202509092149.589LnBrg099983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 90593b1bdb80 - main - nanobsd: Expose do_image_prep on command line List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90593b1bdb80a41b499b47437b4f545c24666b2d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=90593b1bdb80a41b499b47437b4f545c24666b2d commit 90593b1bdb80a41b499b47437b4f545c24666b2d Author: Warner Losh AuthorDate: 2025-09-09 16:00:14 +0000 Commit: Warner Losh 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