The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=6c0c5c03413bf69756fa19ac7f2bcd4270bdb01b
commit 6c0c5c03413bf69756fa19ac7f2bcd4270bdb01b Author: Jessica Clarke <[email protected]> AuthorDate: 2025-12-31 17:36:10 +0000 Commit: Lexi Winter <[email protected]> CommitDate: 2026-02-22 00:57:19 +0000 Makefile.inc1: Make NO_INSTALLKERNEL less of a hack Rather than adding a dummy entry which requires everyone to know to skip it, introduce a new INSTALLEXTRAKERNELS which contains the set of kernels to install as kernel.KERNCONF. Reviewed by: ivy MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54291 (cherry picked from commit 2c0e9a76c1cee8766245a0b5bdad73e995b790c6) --- Makefile.inc1 | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index dd47b53bf681..ea7e417992e0 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1773,10 +1773,6 @@ KERNCONF?= ${GENERIC_KERNCONF} BUILDKERNELS= INSTALLKERNEL= -.if defined(NO_INSTALLKERNEL) -# All of the BUILDKERNELS loops start at index 1. -BUILDKERNELS+= dummy -.endif .for _kernel in ${KERNCONF} .if !defined(_MKSHOWCONFIG) && exists(${KERNCONFDIR}/${_kernel}) BUILDKERNELS+= ${_kernel} @@ -1818,12 +1814,12 @@ _BUILDKERNEL_START!= date '+%s' # Builds all kernels defined by BUILDKERNELS. # buildkernel: .MAKE .PHONY -.if empty(BUILDKERNELS:Ndummy) +.if empty(BUILDKERNELS) @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ false .endif @echo -.for _kernel in ${BUILDKERNELS:Ndummy} +.for _kernel in ${BUILDKERNELS} @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`" @echo "--------------------------------------------------------------" @@ -1885,6 +1881,16 @@ NO_INSTALLEXTRAKERNELS?= yes NO_INSTALLEXTRAKERNELS?= no .endif +.if ${NO_INSTALLEXTRAKERNELS} != "yes" +.if defined(NO_INSTALLKERNEL) +INSTALLEXTRAKERNELS= ${BUILDKERNELS} +.else +# First kernel is installed separately by INSTALLKERNEL, typically to +# /boot/kernel, rather than to a config-suffixed directory. +INSTALLEXTRAKERNELS= ${BUILDKERNELS:[2..-1]} +.endif +.endif + # # installkernel, etc. # @@ -1911,8 +1917,8 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY echo ">>> Install kernel(s) ${INSTALLKERNEL} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}" @echo "--------------------------------------------------------------" .endif -.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" -.for _kernel in ${BUILDKERNELS:[2..-1]} +.if !empty(INSTALLEXTRAKERNELS) +.for _kernel in ${INSTALLEXTRAKERNELS} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel} $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" @@ -1949,8 +1955,8 @@ distributekernel distributekernel.debug: .PHONY ${METALOG_SORT_CMD} >> ${DESTDIR}/${DISTDIR}/kernel.meta .endif .endif -.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" -.for _kernel in ${BUILDKERNELS:[2..-1]} +.if !empty(INSTALLEXTRAKERNELS) +.for _kernel in ${INSTALLEXTRAKERNELS} rm -f ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ @@ -1981,8 +1987,8 @@ packagekernel: .PHONY @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz .endif -.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" -.for _kernel in ${BUILDKERNELS:[2..-1]} +.if !empty(INSTALLEXTRAKERNELS) +.for _kernel in ${INSTALLEXTRAKERNELS} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ ${TAR_CMD} cvf - --exclude '*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ @@ -2350,8 +2356,8 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} . endfor .endif -.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" -. for _kernel in ${BUILDKERNELS:[2..-1]} +.if !empty(INSTALLEXTRAKERNELS) +.for _kernel in ${INSTALLEXTRAKERNELS} . if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) . if ${MK_DEBUG_FILES} != "no" _debug=-dbg
