diff --git a/build.sh b/build.sh index 85c4f5ca45..7e5f794796 100755 --- a/build.sh +++ b/build.sh @@ -381,6 +381,9 @@ if [ -z "${_SKIP_REBUILD_PRESTAGE}" ]; then echo ">>> Building kernel configs: $BUILD_KERNELS for FreeBSD: $FREEBSD_BRANCH ..." build_all_kernels + # Install kernel on installer + installkernel ${INSTALLER_CHROOT_DIR} + # Prepare pre-final staging area clone_to_staging_area diff --git a/tools/builder_common.sh b/tools/builder_common.sh index f8054807f5..877aed7702 100644 --- a/tools/builder_common.sh +++ b/tools/builder_common.sh @@ -1659,6 +1659,8 @@ buildkernel() { # Imported from FreeSBIE installkernel() { + local _destdir=${1:-${KERNEL_DESTDIR}} + if [ -z "${KERNCONF}" ]; then echo ">>> ERROR: No kernel configuration defined probably this is not what you want! STOPPING!" | tee -a ${LOGFILE} print_error_pfS @@ -1670,10 +1672,10 @@ installkernel() { fi mkdir -p ${STAGE_CHROOT_DIR}/boot - makeargs="${MAKEJ} DESTDIR=${KERNEL_DESTDIR}" + makeargs="${MAKEJ} DESTDIR=${_destdir}" echo ">>> Builder is running the command: script -aq $LOGFILE make ${makeargs} installkernel KERNCONF=${KERNCONF}" | tee -a $LOGFILE (script -aq $LOGFILE make -C ${FREEBSD_SRC_DIR} ${makeargs} installkernel KERNCONF=${KERNCONF} || print_error_pfS;) | egrep '^>>>' - gzip -f9 $KERNEL_DESTDIR/boot/kernel/kernel + gzip -f9 ${_destdir}/boot/kernel/kernel } # Launch is ran first to setup a few variables that we need