git: 03c9ad37b497 - stable/15 - Makefile.inc1: Fix INSTALLEXTRAKERNELS for one-kernel case
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Feb 2026 01:11:23 UTC
The branch stable/15 has been updated by ivy:
URL: https://cgit.FreeBSD.org/src/commit/?id=03c9ad37b497bd59dc3fb9ec86310b95e5d1abbe
commit 03c9ad37b497bd59dc3fb9ec86310b95e5d1abbe
Author: Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2026-01-06 01:48:04 +0000
Commit: Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2026-02-22 00:57:33 +0000
Makefile.inc1: Fix INSTALLEXTRAKERNELS for one-kernel case
If BUILDKERNELS contains a single kernel, and NO_INSTALLEXTRAKERNELS=no,
then ${BUILDKERNELS:[2..-1]} returns the first kernel in the list and
that kernel ends up in both INSTALLKERNEL and INSTALLEXTRAKERNELS.
This breaks the package build because it means we generate that package
twice, once with an incorrect install path of /boot/kernel.NAME instead
of /boot/kernel.
Only set INSTALLEXTRAKERNELS if we're building at least two kernels.
Fixes: 2c0e9a76c1ce ("Makefile.inc1: Make NO_INSTALLKERNEL less of a hack")
Reviewed by: jrtc27
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D54539
(cherry picked from commit 0b298e314a8b47c1f2bf8a9ff86c050accbd744d)
---
Makefile.inc1 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.inc1 b/Makefile.inc1
index ea7e417992e0..631c12543b3a 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1884,10 +1884,12 @@ NO_INSTALLEXTRAKERNELS?= no
.if ${NO_INSTALLEXTRAKERNELS} != "yes"
.if defined(NO_INSTALLKERNEL)
INSTALLEXTRAKERNELS= ${BUILDKERNELS}
-.else
+.elif ${BUILDKERNELS:[#]} > 1
# First kernel is installed separately by INSTALLKERNEL, typically to
# /boot/kernel, rather than to a config-suffixed directory.
INSTALLEXTRAKERNELS= ${BUILDKERNELS:[2..-1]}
+.else
+INSTALLEXTRAKERNELS=
.endif
.endif