Add a dependency on the kernel package for the runtime package.

The idea here is that, provided upstream pkg(8) maintainers accept
the proposed change, the kernel.ucl will contain a post-install
script causing pkg(8) to emit a message informing to reboot the
system after the kernel is upgraded using 'pkg upgrade', so the
new userland is installed on the running new kernel.  At present,
this functionality does not exist in pkg(8), but will help ensure
the upgrade path follows that from UPDATING.  To work around this
for now, evaluate ASSUME_ALWAYS_YES, and prompt the user if they
wish to proceed if not set to true.

Since there is a kernel dependency, and a non-GENERIC kernel may
be in use, update Makefile.inc1 to replace '%KERNCONF%' in the
runtime.ucl with the first-built kernel set either via command line
or in make.conf(5).

MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2017-08-09 19:16:54 +00:00
parent 39901227a5
commit 16398a1141
3 changed files with 41 additions and 1 deletions

View File

@ -1618,7 +1618,10 @@ create-world-package-${pkgname}: .PHONY
@awk -F\" ' \
/^name/ { printf("===> Creating %s-", $$2); next } \
/^version/ { print $$2; next } \
' ${WSTAGEDIR}/${pkgname}.ucl ; \
' ${WSTAGEDIR}/${pkgname}.ucl ;
@if [ "${pkgname}" == "runtime" ]; then \
sed -i '' -e "s/%KERNCONF%/${INSTALLKERNEL:tl}/" ${WSTAGEDIR}/${pkgname}.ucl ; \
fi
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
create -M ${WSTAGEDIR}/${pkgname}.ucl \
-p ${WSTAGEDIR}/${pkgname}.plist \

View File

@ -16,6 +16,39 @@ desc = <<EOD
%DESC%
EOD
scripts: {
pre-install = <<EOD
case ${ASSUME_ALWAYS_YES} in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee])
exit 0
;;
*)
continue
;;
esac
echo "****************************************************************"
echo "It is recommended to install the FreeBSD-%PKGNAME% package"
echo "with:"
echo
echo " pkg install FreeBSD-%PKGNAME%"
echo
echo "and rebooting the system into the new kernel before upgrading"
echo "with:"
echo
echo " pkg upgrade"
echo
echo "****************************************************************"
echo
echo "Do you want to continue anyway?"
echo "[Enter] to continue, ^C to cancel."
echo
read ANSWER
case ${ANSWER} in
*)
continue
;;
esac
EOD
post-install = <<EOD
/usr/sbin/kldxref ${PKG_ROOTDIR}/boot/kernel
EOD

View File

@ -27,6 +27,10 @@ deps: {
"FreeBSD-clibs": {
origin: "base"
version: "%VERSION%"
},
"FreeBSD-kernel-%KERNCONF%": {
origin: "base"
version: "%VERSION%"
}
}
directories {