From 4d551448da353d2e1ecce2665fe021c2fe5919c9 Mon Sep 17 00:00:00 2001 From: "Christian S.J. Peron" Date: Thu, 8 Oct 2026 22:59:36 -0500 Subject: [PATCH 1/3] Dont install headers --- examples/fbsd-lite/src.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/fbsd-lite/src.conf b/examples/fbsd-lite/src.conf index 393a5be..5298f01 100644 --- a/examples/fbsd-lite/src.conf +++ b/examples/fbsd-lite/src.conf @@ -18,6 +18,11 @@ WITHOUT_TOOLCHAIN=yes WITHOUT_OPENMP=yes WITHOUT_GOOGLETEST=yes +# Headers -- nothing compiles inside the image. Remove this if ports or +# native extensions will be built in the container; pkg does not ship the +# base headers. Like TOOLCHAIN, this does not affect buildworld. +WITHOUT_INCLUDES=yes + # Documentation WITHOUT_MAN=yes WITHOUT_HTML=yes From 2595848759fee2ef63098df5c0a2165965b1a943 Mon Sep 17 00:00:00 2001 From: "Christian S.J. Peron" Date: Thu, 8 Oct 2026 23:13:15 -0500 Subject: [PATCH 2/3] Further optimize this container --- examples/fbsd-lite/src.conf | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/fbsd-lite/src.conf b/examples/fbsd-lite/src.conf index 5298f01..a4a4a74 100644 --- a/examples/fbsd-lite/src.conf +++ b/examples/fbsd-lite/src.conf @@ -18,10 +18,13 @@ WITHOUT_TOOLCHAIN=yes WITHOUT_OPENMP=yes WITHOUT_GOOGLETEST=yes -# Headers -- nothing compiles inside the image. Remove this if ports or -# native extensions will be built in the container; pkg does not ship the -# base headers. Like TOOLCHAIN, this does not affect buildworld. +# Headers and static libraries -- nothing compiles inside the image. +# Remove these if ports or native extensions will be built in the +# container; pkg does not ship the base headers or static libraries. +# Like TOOLCHAIN, these do not affect buildworld. INSTALLLIB also drops +# the lib*.so linker symlinks. WITHOUT_INCLUDES=yes +WITHOUT_INSTALLLIB=yes # Documentation WITHOUT_MAN=yes @@ -29,10 +32,12 @@ WITHOUT_HTML=yes WITHOUT_DICT=yes WITHOUT_EXAMPLES=yes WITHOUT_SHAREDOCS=yes +WITHOUT_MAN_UTILS=yes # Locales -- pkg does not need them; add WITH_LOCALES if ports require them WITHOUT_LOCALES=yes WITHOUT_ICONV=yes +WITHOUT_NLS=yes # Mail -- MAIL also turns off SENDMAIL, DMAGENT and MAILWRAPPER WITHOUT_MAIL=yes @@ -97,6 +102,8 @@ WITHOUT_PMC=yes WITHOUT_LEGACY_CONSOLE=yes WITHOUT_SYSCONS=yes WITHOUT_VT=yes +# Wireless firmware in /boot/firmware -- WIRELESS does not cover it +WITHOUT_SOURCELESS_UCODE=yes # Installer and updates -- images are rebuilt, not updated in place WITHOUT_BSDINSTALL=yes @@ -121,3 +128,6 @@ WITHOUT_LPR=yes WITHOUT_TESTS=yes WITHOUT_RESCUE=yes WITHOUT_DEBUG_FILES=yes +# /var/db/services.db -- nsswitch.conf uses "services: files", so libc +# reads /etc/services directly. /etc/services is still installed. +WITHOUT_SERVICESDB=yes From be4e3d773e3be15e44aea058ebd71d4d80b671fd Mon Sep 17 00:00:00 2001 From: "Christian S.J. Peron" Date: Thu, 8 Oct 2026 23:17:38 -0500 Subject: [PATCH 3/3] back put last commit partially --- examples/fbsd-lite/Cblockfile | 6 +++++- examples/fbsd-lite/src.conf | 15 +++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/fbsd-lite/Cblockfile b/examples/fbsd-lite/Cblockfile index e652726..10a19ca 100644 --- a/examples/fbsd-lite/Cblockfile +++ b/examples/fbsd-lite/Cblockfile @@ -25,7 +25,11 @@ COPY src.conf /usr/src/src-lite.conf WORKDIR "/usr/src" RUN "make -j $(sysctl -n hw.ncpu) buildworld SRCCONF=/usr/src/src-lite.conf" RUN "mkdir -p /new/root" -RUN "make installworld SRCCONF=/usr/src/src-lite.conf DESTDIR=/new/root" +# +# Leave out headers and static libraries -- nothing compiles inside the +# image. Drop these two if ports or native extensions will be built in the +# container. They only work here: buildworld fails if they are in src.conf. +RUN "make installworld SRCCONF=/usr/src/src-lite.conf DESTDIR=/new/root WITHOUT_INCLUDES=yes WITHOUT_INSTALLLIB=yes" # # Prepare /etc diff --git a/examples/fbsd-lite/src.conf b/examples/fbsd-lite/src.conf index a4a4a74..d2b6baa 100644 --- a/examples/fbsd-lite/src.conf +++ b/examples/fbsd-lite/src.conf @@ -8,7 +8,9 @@ # # Usage: # make -j$(sysctl -n hw.ncpu) buildworld SRCCONF=/path/to/src.conf -# make installworld distribution SRCCONF=/path/to/src.conf DESTDIR=... +# make installworld SRCCONF=/path/to/src.conf DESTDIR=... \ +# WITHOUT_INCLUDES=yes WITHOUT_INSTALLLIB=yes +# make distribution SRCCONF=/path/to/src.conf DESTDIR=... # # Compiler toolchain -- not needed inside a container image. TOOLCHAIN @@ -18,13 +20,10 @@ WITHOUT_TOOLCHAIN=yes WITHOUT_OPENMP=yes WITHOUT_GOOGLETEST=yes -# Headers and static libraries -- nothing compiles inside the image. -# Remove these if ports or native extensions will be built in the -# container; pkg does not ship the base headers or static libraries. -# Like TOOLCHAIN, these do not affect buildworld. INSTALLLIB also drops -# the lib*.so linker symlinks. -WITHOUT_INCLUDES=yes -WITHOUT_INSTALLLIB=yes +# Headers and static libraries are left out at installworld time; see the +# Cblockfile. WITHOUT_INCLUDES and WITHOUT_INSTALLLIB must not be set here: +# buildworld installs its own bootstrap headers and libraries (liblegacy.a) +# and fails without them. # Documentation WITHOUT_MAN=yes