make packages: Fix edge case of no kernel

When NO_INSTALLKERNEL and NO_INSTALLEXTRAKERNELS are set, or when
BUILDKERNELS is empty, we can fail to define the create-kernel-packages
make target, which we call unconditionally. So if do not have a kernel
staging dir, go ahead and provide an empty create-kernel-packages so
that when it's used elsewhere, the build succeeds.

This lets me build a tree and package it when I don't have a kernel, for
jails and other similar environments. There's no change if any kernels
are built, since that will provide the necessary make target that does
useful things for that case.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh
2025-09-24 12:41:29 -06:00
parent c7a4cdd09f
commit d466cb731a
+3
View File
@@ -2314,6 +2314,9 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap
-r ${KSTAGEDIR}/${DISTDIR} \
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
. endfor
.else
create-kernel-packages: .PHONY
.endif
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
. for _kernel in ${BUILDKERNELS:[2..-1]}