Author: gjb
Date: Wed Aug  9 19:16:54 2017
New Revision: 322327
URL: https://svnweb.freebsd.org/changeset/base/322327

Log:
  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

Modified:
  head/Makefile.inc1
  head/release/packages/kernel.ucl
  head/release/packages/runtime.ucl

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1  Wed Aug  9 19:09:23 2017        (r322326)
+++ head/Makefile.inc1  Wed Aug  9 19:16:54 2017        (r322327)
@@ -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 \

Modified: head/release/packages/kernel.ucl
==============================================================================
--- head/release/packages/kernel.ucl    Wed Aug  9 19:09:23 2017        
(r322326)
+++ head/release/packages/kernel.ucl    Wed Aug  9 19:16:54 2017        
(r322327)
@@ -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

Modified: head/release/packages/runtime.ucl
==============================================================================
--- head/release/packages/runtime.ucl   Wed Aug  9 19:09:23 2017        
(r322326)
+++ head/release/packages/runtime.ucl   Wed Aug  9 19:16:54 2017        
(r322327)
@@ -27,6 +27,10 @@ deps: {
     "FreeBSD-clibs": {
         origin: "base"
         version: "%VERSION%"
+    },
+    "FreeBSD-kernel-%KERNCONF%": {
+        origin: "base"
+        version: "%VERSION%"
     }
 }
 directories {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to