Skip to content

Commit

Permalink
release: install multiple kernels if specified
Browse files Browse the repository at this point in the history
If release.conf sets KERNEL to a space-separate list, release.sh will
now install all of them into the release media, building separate .txz
archives for each.

Sponsored by:	ConnectWise
  • Loading branch information
asomers committed Jan 5, 2025
1 parent ebc8be8 commit 9a03677
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
18 changes: 14 additions & 4 deletions release/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# WORLDDIR: location of src tree -- must have built world and default kernel
# (by default, the directory above this one)
# PORTSDIR: location of ports tree to distribute (default: /usr/ports)
# INSTALLEXTRAKERNELS: if set, install all kernels in the KERNCONF variable
# XTRADIR: xtra-bits-dir argument for <arch>/mkisoimages.sh
# NOPKG: if set, do not distribute third-party packages
# NOPORTS: if set, do not distribute ports tree
Expand All @@ -36,6 +37,7 @@
# TARGET/TARGET_ARCH: architecture of built release
#

INSTALLEXTRAKERNELS?= no
WORLDDIR?= ${.CURDIR}/..
PORTSDIR?= /usr/ports

Expand Down Expand Up @@ -173,7 +175,9 @@ disc1: packagesystem
# Install system
mkdir -p ${.TARGET}
( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
DESTDIR=${.OBJDIR}/${.TARGET} \
INSTALLEXTRAKERNELS=${INSTALLEXTRAKERNELS} \
MK_AT=no \
MK_INSTALLLIB=no MK_MAIL=no \
${_ALL_LIBCOMPATS:@v@MK_LIB$v=no@} \
MK_TOOLCHAIN=no \
Expand Down Expand Up @@ -218,7 +222,9 @@ bootonly: packagesystem
# Install system
mkdir -p ${.TARGET}
( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
DESTDIR=${.OBJDIR}/${.TARGET} \
INSTALLEXTRAKERNELS=${INSTALLEXTRAKERNELS} \
MK_AT=no \
MK_GAMES=no \
MK_INSTALLLIB=no MK_MAIL=no \
${_ALL_LIBCOMPATS:@v@MK_LIB$v=no@} \
Expand Down Expand Up @@ -254,8 +260,12 @@ dvd: packagesystem
# Install system
mkdir -p ${.TARGET}
( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
MK_TESTS=no MK_DEBUG_FILES=no \
DESTDIR=${.OBJDIR}/${.TARGET} \
INSTALLEXTRAKERNELS=${INSTALLEXTRAKERNELS} \
MK_RESCUE=no \
MK_KERNEL_SYMBOLS=no \
MK_TESTS=no \
MK_DEBUG_FILES=no \
-DDB_FROM_SRC )
# Copy distfiles
mkdir -p ${.TARGET}/usr/freebsd-dist
Expand Down
4 changes: 2 additions & 2 deletions release/Makefile.vm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ cw-${_CW:tl}-${_FS}-${_FMT}: ${QEMUTGT}
QEMUSTATIC=${QEMUSTATIC} \
${.CURDIR}/scripts/mk-vmimage.sh \
-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} -F ${_FS} \
-i ${.OBJDIR}/${_CW:tl}.${_FS}.${_FMT}.img -s ${VMSIZE} -f ${_FMT} \
-i ${.OBJDIR}/${_CW:tl}.${_FS}.${_FMT}.img -K -s ${VMSIZE} -f ${_FMT} \
-S ${WORLDDIR} -o ${.OBJDIR}/${${_CW:tu}${_FS:tu}${_FMT:tu}IMAGE} -c ${${_CW:tu}CONF}
touch ${.TARGET}
. endfor
Expand Down Expand Up @@ -172,7 +172,7 @@ vm-image: ${QEMUTGT}
${.CURDIR}/scripts/mk-vmimage.sh \
-C ${.CURDIR}/tools/vmimage.subr \
-d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \
-i ${.OBJDIR}/${FORMAT}.${FS}.img -s ${VMSIZE} -f ${FORMAT} \
-i ${.OBJDIR}/${FORMAT}.${FS}.img -K -s ${VMSIZE} -f ${FORMAT} \
-S ${WORLDDIR} -o ${.OBJDIR}/${VMBASE}.${FS}.${FORMAT}
. endfor
. endfor
Expand Down
4 changes: 3 additions & 1 deletion release/release.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ PORTBRANCH="main"
#TARGET="amd64"
#TARGET_ARCH="amd64"
#KERNEL="GENERIC"
## Multiple kernels may be set.
## Multiple kernels may be set. Kernels after the first will be installed to
## an alternate location. In this example, they'll be installed to /boot/kernel
## and /boot/kernel.XENHVM .
#KERNEL="GENERIC XENHVM"

## Set to specify a custom make.conf and/or src.conf
Expand Down
1 change: 1 addition & 0 deletions release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ env_check() {
RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \
KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
RELEASE_RMAKEFLAGS="${ARCH_FLAGS} ${RELEASE_FLAGS} \
INSTALLEXTRAKERNELS=\"yes\" \
KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${SRCPORTS} \
WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \
WITH_CLOUDWARE=${WITH_CLOUDWARE} WITH_OCIIMAGES=${WITH_OCIIMAGES} \
Expand Down
6 changes: 5 additions & 1 deletion release/scripts/mk-vmimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ usage() {
main() {
local arg
VMCONFIG="/dev/null"
while getopts "C:c:d:F:f:i:o:s:S:" arg; do
INSTALLEXTRAKERNELS="no"
while getopts "C:c:d:F:f:i:Ko:s:S:" arg; do
case "${arg}" in
C)
VMBUILDCONF="${OPTARG}"
Expand All @@ -59,6 +60,9 @@ main() {
i)
VMBASE="${OPTARG}"
;;
K)
INSTALLEXTRAKERNELS="yes"
;;
o)
VMIMAGE="${OPTARG}"
;;
Expand Down
1 change: 1 addition & 0 deletions release/tools/vmimage.subr
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ vm_install_base() {

cd ${WORLDDIR} && \
make DESTDIR=${DESTDIR} ${INSTALLOPTS} \
INSTALLEXTRAKERNELS=${INSTALLEXTRAKERNELS} \
installworld installkernel distribution || \
err "\n\nCannot install the base system to ${DESTDIR}."

Expand Down

0 comments on commit 9a03677

Please sign in to comment.