From owner-svn-ports-all@FreeBSD.ORG Thu Oct 31 11:34:47 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2E4C7B4B; Thu, 31 Oct 2013 11:34:47 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3552505; Thu, 31 Oct 2013 11:34:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VBYkPQ059852; Thu, 31 Oct 2013 11:34:46 GMT (envelope-from rene@svn.freebsd.org) Received: (from rene@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VBYkAB059851; Thu, 31 Oct 2013 11:34:46 GMT (envelope-from rene@svn.freebsd.org) Message-Id: <201310311134.r9VBYkAB059851@svn.freebsd.org> From: Rene Ladan Date: Thu, 31 Oct 2013 11:34:46 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r332228 - head/Mk/Uses X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2013 11:34:47 -0000 Author: rene Date: Thu Oct 31 11:34:46 2013 New Revision: 332228 URL: http://svnweb.freebsd.org/changeset/ports/332228 Log: Add a new USES for kernel module ports. USES=kmod takes no arguments and: - adds kld to CATEGORIES - sets SSP_UNSAFE - sets IGNORE if the kernel sources are not found - defines KMODDIR to /boot/modules by default, add it to PLIST_SUB and MAKE_ENV, and create it upon installation - handles cross-referencing kernel modules upon installation and deinstallation Approved by: bapt Added: head/Mk/Uses/kmod.mk (contents, props changed) Added: head/Mk/Uses/kmod.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/Uses/kmod.mk Thu Oct 31 11:34:46 2013 (r332228) @@ -0,0 +1,47 @@ +# $FreeBSD$ +# +# Handles dependency on kernel sources +# +# MAINTAINER: rene@FreeBSD.org +# +# Feature: kmod +# Usage: USES=kmod +# Valid ARGS: none +# +.if !defined(_INCLUDE_USES_KMOD_MK) +_INCLUDE_USES_KMOD_MK= yes + +.if defined(kmod_ARGS) +IGNORE= USES=kmod takes no arguments +.endif + +.if !exists(${SRC_BASE}/sys/Makefile) +IGNORE= requires kernel source files in ${SRC_BASE} +.endif + +CATEGORIES+= kld + +SSP_UNSAFE= kernel module does not support SSP + +KMODDIR?= /boot/modules +PLIST_SUB+= KMODDIR="${KMODDIR:C,^/,,}" +MAKE_ENV+= KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" + +pre-install: kmod-pre-install +kmod-pre-install: +.if defined(NO_STAGE) + ${MKDIR} ${KMODDIR} +.else + ${MKDIR} ${STAGEDIR}${KMODDIR} +.endif + +post-install: kmod-post-install +kmod-post-install: + ${ECHO_CMD} "@exec /usr/sbin/kldxref ${KMODDIR}" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec /usr/sbin/kldxref ${KMODDIR}" >> ${TMPPLIST} + ${ECHO_CMD} "@dirrmtry ${KMODDIR}" >> ${TMPPLIST} +.if defined(NO_STAGE) + /usr/sbin/kldxref ${KMODDIR} +.endif + +.endif