Author: kevans
Date: Wed Mar 14 14:45:57 2018
New Revision: 330929
URL: https://svnweb.freebsd.org/changeset/base/330929

Log:
  pkgbase: Fix post-install script for kernel packages
  
  kernel.ucl uses a hardcoded boot/kernel for kldxref, which is the incorrect
  directory when we're installing extra kernels that aren't the "default"
  kernel (placed at boot/kernel).
  
  Fix this by instead using a new %KERNELDIR% that we now replace in
  Makefile.inc1 with "kernel" for the default kernel and "kernel.${_kernel}"
  for these extra kernels so that, e.g. /boot/kernel.SHIVA, will get properly
  kldxref'd upon update and avoid outdated linker.hints.
  
  Reviewed by:  gjb
  MFC after:    1 week
  Differential Revision:        https://reviews.freebsd.org/D14689

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

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1  Wed Mar 14 14:32:01 2018        (r330928)
+++ head/Makefile.inc1  Wed Mar 14 14:45:57 2018        (r330929)
@@ -1698,6 +1698,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul
        pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
        sed -e "s/%VERSION%/${PKG_VERSION}/" \
                -e "s/%PKGNAME%/kernel-${INSTALLKERNEL:tl}${flavor}/" \
+               -e "s/%KERNELDIR%/kernel/" \
                -e "s/%COMMENT%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
                -e "s/%DESC%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
                -e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \
@@ -1733,6 +1734,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_
        pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \
        sed -e "s/%VERSION%/${PKG_VERSION}/" \
                -e "s/%PKGNAME%/kernel-${_kernel:tl}${flavor}/" \
+               -e "s/%KERNELDIR%/kernel.${_kernel}/" \
                -e "s/%COMMENT%/FreeBSD ${_kernel} kernel ${flavor}/" \
                -e "s/%DESC%/FreeBSD ${_kernel} kernel ${flavor}/" \
                -e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \

Modified: head/release/packages/kernel.ucl
==============================================================================
--- head/release/packages/kernel.ucl    Wed Mar 14 14:32:01 2018        
(r330928)
+++ head/release/packages/kernel.ucl    Wed Mar 14 14:45:57 2018        
(r330929)
@@ -17,6 +17,6 @@ desc = <<EOD
 EOD
 scripts: {
        post-install = <<EOD
-       /usr/sbin/kldxref ${PKG_ROOTDIR}/boot/kernel
+       /usr/sbin/kldxref ${PKG_ROOTDIR}/boot/%KERNELDIR%
 EOD
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to