diff --git a/build b/build index 256e977..c0a19db 100755 --- a/build +++ b/build @@ -106,7 +106,6 @@ BUILD_DEPENCIES_LIST_EOF ) BUILD_STAGES=$(cat << BUILD_STAGES_END -build_modules install_packages install_from_git_repos build_setupgui @@ -117,7 +116,6 @@ build_dmconfig build_chusr build_lbi_gui install_nomadbsd_reset -build_unionfs install_ports build_nvidia_drivers post_pkg_config @@ -798,6 +796,14 @@ install_ports() build_kernel() { + # Respect BUILD_KERNEL here as well, not only in build_nomadbsd(): + # resume_build() runs every stage after the failed one unconditionally, + # which would otherwise rebuild the custom kernel (and apply the src + # patches) on resume even with BUILD_KERNEL="NO". + case "${BUILD_KERNEL}" in + [yY][eE][sS]) ;; + *) return 0;; + esac local makeopts="KERNCONF=NOMADBSD ${BUILDKERNEL_OPTS}" makeopts="${makeopts} WITHOUT_MODULES=\"${WITHOUT_KMODS}\"" local regx="/DEBUG=-g/d; /WITH_CTF=1/d; /^ident.*GENERIC/d;" diff --git a/build.cfg b/build.cfg index a941ca2..a83ca29 100644 --- a/build.cfg +++ b/build.cfg @@ -1,8 +1,9 @@ -# amd64, i386, or mac +# amd64, or mac (i386 was retired as a FreeBSD release platform in 15.0) ARCH=amd64 # UFS, or ZFS FILESYSTEM=UFS -RELEASE=14.3-RELEASE +# RELEASE=14.3-RELEASE +RELEASE=15.1-RELEASE BASEURL="http://download.freebsd.org/ftp" WORKDIR="${PWD}/work" # Where the FreeBSD installation resides. @@ -25,7 +26,12 @@ UFS_MINFREE=8 BASEFS_EXTRA=100 # Size in MiB required for the base system without uzip, EFI partition, and # BASEFS_EXTRA. Adjust as needed. -BASESIZE=1960 +# 1960 sufficed for the pruned custom kernel on 14.x. The stock 15.1 +# GENERIC kernel ships every module (~450 MiB /boot/kernel vs ~150 MiB +# pruned), and 15.1 world grew as well; 2960 leaves comfortable headroom +# over the ~2500 MiB observed footprint. Don't go below ~2700. +#BASESIZE=1960 +BASESIZE=2960 # ZFS pool name ZFS_POOL=nomadbsd_zroot @@ -85,30 +91,41 @@ ZFS_SYSCTL_SETTINGS_END } # Whether to build a custom kernel -BUILD_KERNEL="YES" +# BUILD_KERNEL="YES" +BUILD_KERNEL="NO" -# Don't build the following kernel modules -WITHOUT_KMODS="drm drm2 i915kms mach64 mga r128 radeonkms savage sis tdfx via" +# Don't build the following kernel modules. +# NOTE (15.1): the old list ("drm drm2 i915kms mach64 mga r128 radeonkms +# savage sis tdfx via") referred to base-system graphics modules that were +# all removed from sys/modules years ago. Do not re-add "sis": in 15.1 +# that name matches the sis(4) *ethernet* driver module, not graphics. +WITHOUT_KMODS="" # Options passed to "make" BUILDKERNEL_OPTS="-j$(sysctl -n hw.ncpu)" KERNELOPTS() { COMMON_KERNELOPTS - [ "${ARCH}" = "i386" ] && I386_KERNELOPTS } -# Lines added to the kernel config file. +# Lines added to the kernel config file. Only used when BUILD_KERNEL="YES". +# All option names below were verified against releng/15.1 +# (sys/conf/options and sys/amd64/conf/GENERIC). COMMON_KERNELOPTS() { cat << COMMON_KERNELOPTS_END ident NOMADBSD options TERMINAL_NORM_ATTR=(FG_LIGHTBLUE|BG_BLACK) options TERMINAL_KERN_ATTR=(FG_LIGHTCYAN|BG_BLACK) +# Old-binary compatibility shims - still enabled in 15.1 GENERIC, so +# these nooptions actively shrink the kernel: nooptions COMPAT_FREEBSD4 nooptions COMPAT_FREEBSD5 nooptions COMPAT_FREEBSD6 nooptions COMPAT_FREEBSD7 nooptions COMPAT_FREEBSD9 +# Debugger support - KDB, KDB_TRACE, DDB_CTF, and NETGDB are set in +# 15.1 release GENERIC; the rest are only set when building from +# -CURRENT sources, where these lines keep them disabled: nooptions INVARIANTS nooptions INVARIANT_SUPPORT nooptions WITNESS @@ -121,17 +138,12 @@ nooptions KCOV nooptions KDB nooptions KDB_TRACE nooptions GDB +nooptions NETGDB nooptions DDB_CTF nooptions DDB COMMON_KERNELOPTS_END } -I386_KERNELOPTS() { -cat << I386_KERNELOPTS_END -I386_KERNELOPTS_END -} - - # Because of special options, some packages must be installed using the # ports tree. Add each port as category/portname to PORTSLIST. The port's # options can be defined by setting portname_OPTS. Dashes (``-ยดยด) @@ -168,15 +180,6 @@ NVIDIA_DRIVERS="340 390 470 latest" # Path to the local ports tree. It will be mounted to ${SYSDIR}/usr/ports. PORTSTREE=/usr/ports -# List of packages to ignore when building a i386 image -PKG_EXCLUDE_i386() { -cat << PKG_EXCLUDE_I386_END -graphics/xsane -print/gimp-gutenprint -emulators/virtualbox-ose-additions -PKG_EXCLUDE_I386_END -} - # Software packages which install from git repos. GIT_SITE="https://github.com/mrclksr" GIT_REPOS=$(cat </dev/null fi # @@ -102,13 +117,18 @@ do_mount_unionfs() fi [ ! -d "${rwdir}" ] && mkdir -p "${rwdir}" fi - kldstat -q -n fusefs && kldunload fusefs - if (! kldstat -q -n fusefs2 && ! kldstat -q -n fusefs); then - kldload fusefs2 2>/dev/null || kldload fusefs 2>/dev/null + if (! kldstat -q -n fusefs); then + kldload fusefs || \ + echo "${name}: failed to load fusefs.ko" >&2 + fi + if [ ! -x "${path_unionfs}" ]; then + echo "${name}: ${path_unionfs} not found;" \ + "/usr/local will stay read-only" >&2 + return fi - unionfs -o cow,max_files=${unionfs_maxfiles} \ - -o allow_other,use_ino,suid,nonempty,kernel_cache \ - "${rwdir}"=RW:/unionfs/usr/local=RO /usr/local + LD_LIBRARY_PATH="${path_unionfs_libs}" "${path_unionfs}" \ + -o "${mount_uzip_unionfs_opts}" \ + "${rwdir}"=RW:/unionfs/usr/local=RO /usr/local service ldconfig start } diff --git a/pkg.list b/pkg.list index 8d0ee70..c0d4675 100644 --- a/pkg.list +++ b/pkg.list @@ -69,7 +69,6 @@ security/sudo shells/bash shells/fish shells/zsh -sysutils/bsdstats sysutils/catfish sysutils/ddrescue sysutils/dsbdriverd @@ -80,6 +79,7 @@ sysutils/dunst filesystems/ext2 filesystems/hfsfuse filesystems/sshfs +filesystems/unionfs sysutils/powerdxx sysutils/sleuthkit sysutils/smartmontools