svn commit: r375621 - in head: Keywords Mk/Uses

Baptiste Daroussin bapt at FreeBSD.org
Fri Dec 26 12:43:46 UTC 2014


Author: bapt
Date: Fri Dec 26 12:43:44 2014
New Revision: 375621
URL: https://svnweb.freebsd.org/changeset/ports/375621
QAT: https://qat.redports.org/buildarchive/r375621/

Log:
  Use a custom keyword for kldxref, that allows to control exactly when it is run
  and work nicer with automatic directly support from pkg
  
  Differential Revision:	https://reviews.freebsd.org/D1377
  Reviewed by:	rene, antoine
  Approved by:	rene

Added:
  head/Keywords/kld.ucl   (contents, props changed)
Modified:
  head/Mk/Uses/kmod.mk

Added: head/Keywords/kld.ucl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/Keywords/kld.ucl	Fri Dec 26 12:43:44 2014	(r375621)
@@ -0,0 +1,24 @@
+# $FreeBSD$
+#
+# MAINTAINER: rene at FreeBSD.org
+
+actions: []
+post-install: <<EOD
+  case "%@" in
+  /*) kmoddir="%@" ;;
+  *) kmoddir="%D/%@" ;;
+  esac
+  /usr/sbin/kldxref ${kmoddir}
+EOD
+post-deinstall: <<EOD
+  case "%@" in
+  /*) kmoddir="%@" ;;
+  *) kmoddir="%D/%@" ;;
+  esac
+  /usr/sbin/kldxref ${kmoddir}
+  case "${kmoddir}" in
+  %D/*) ;;
+  /boot/modules) ;;
+  *) rmdir -p ${kmoddir} 2>/dev/null || true ;;
+  esac
+EOD

Modified: head/Mk/Uses/kmod.mk
==============================================================================
--- head/Mk/Uses/kmod.mk	Fri Dec 26 12:42:28 2014	(r375620)
+++ head/Mk/Uses/kmod.mk	Fri Dec 26 12:43:44 2014	(r375621)
@@ -31,6 +31,7 @@ KMODDIR=	/boot/modules
 .endif
 PLIST_SUB+=	KMODDIR="${KMODDIR:C,^/,,}"
 MAKE_ENV+=	KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" NO_XREF=yes
+PLIST_FILES+=	"@kld ${KMODDIR}"
 
 STRIP_CMD+=	--strip-debug # do not strip kernel symbols
 .endif
@@ -42,12 +43,4 @@ pre-install: ${STAGEDIR}${KMODDIR}
 ${STAGEDIR}${KMODDIR}:
 	@${MKDIR} ${.TARGET}
 
-kmod-post-install:
-	@${ECHO_CMD} "@exec /usr/sbin/kldxref ${KMODDIR}" >> ${TMPPLIST}
-	@${ECHO_CMD} "@unexec /usr/sbin/kldxref ${KMODDIR}" >> ${TMPPLIST}
-.if ${KMODDIR} != /boot/modules
-	@${ECHO_CMD} "@unexec rmdir -p ${KMODDIR} 2>/dev/null || true" \
-		>> ${TMPPLIST}
-.endif
-
 .endif


More information about the svn-ports-head mailing list