Module Name:    src
Committed By:   jmcneill
Date:           Mon Aug  8 22:15:42 UTC 2011

Modified Files:
        src: Makefile build.sh

Log Message:
add an installmodules=<dir> command to build.sh


To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 src/Makefile
cvs rdiff -u -r1.244 -r1.245 src/build.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/Makefile
diff -u src/Makefile:1.286 src/Makefile:1.287
--- src/Makefile:1.286	Wed Jun 29 02:05:24 2011
+++ src/Makefile	Mon Aug  8 22:15:42 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.286 2011/06/29 02:05:24 mrg Exp $
+#	$NetBSD: Makefile,v 1.287 2011/08/08 22:15:42 jmcneill Exp $
 
 #
 # This is the top-level makefile for building NetBSD. For an outline of
@@ -342,6 +342,29 @@
 	@printf "make ${.TARGET} finished at: " && date
 
 #
+# Install modules from $DESTDIR to $INSTALLMODULESDIR
+#
+installmodules: .PHONY .MAKE
+.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
+	@echo "Can't make ${.TARGET} to DESTDIR=/"
+	@false
+.endif
+.if !defined(INSTALLMODULESDIR) || \
+    ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
+.if (${HOST_UNAME_S} != "NetBSD")
+	@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
+	@false
+.endif
+.if (${HOST_UNAME_M} != ${MACHINE})
+	@echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
+	@false
+.endif
+.endif
+	${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:*/}
+	@echo   "make ${.TARGET} started at:  ${START_TIME}"
+	@printf "make ${.TARGET} finished at: " && date
+
+#
 # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
 #
 

Index: src/build.sh
diff -u src/build.sh:1.244 src/build.sh:1.245
--- src/build.sh:1.244	Wed Jan 26 01:18:43 2011
+++ src/build.sh	Mon Aug  8 22:15:42 2011
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.244 2011/01/26 01:18:43 pooka Exp $
+#	$NetBSD: build.sh,v 1.245 2011/08/08 22:15:42 jmcneill Exp $
 #
 # Copyright (c) 2001-2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -258,6 +258,7 @@
 	do_kernel=false
 	do_releasekernel=false
 	do_modules=false
+	do_installmodules=false
 	do_install=false
 	do_sets=false
 	do_sourcesets=false
@@ -618,6 +619,8 @@
                         except \`etc'.  Useful after "distribution" or "release"
     kernel=conf         Build kernel with config file \`conf'
     releasekernel=conf  Install kernel built by kernel=conf to RELEASEDIR.
+    installmodules=idir Run "make installmodules" to \`idir' to install all
+                        kernel modules.
     modules             Build kernel modules.
     rumptest            Do a linktest for rump (for developers).
     sets                Create binary sets in
@@ -910,7 +913,7 @@
 			op=modules
 			;;
 
-		install=*)
+		install=*|installmodules=*)
 			arg=${op#*=}
 			op=${op%%=*}
 			[ -n "${arg}" ] ||
@@ -1384,7 +1387,7 @@
 	eval cat <<EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.244 2011/01/26 01:18:43 pooka Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.245 2011/08/08 22:15:42 jmcneill Exp $
 # with these arguments: ${_args}
 #
 
@@ -1547,6 +1550,14 @@
 	statusmsg "Successful build of kernel modules for NetBSD/${MACHINE} ${DISTRIBVER}"
 }
 
+installmodules()
+{
+	dir="$1"
+	${runcmd} "${makewrapper}" INSTALLMODULESDIR="${dir}" installmodules ||
+	    bomb "Failed to make installmodules to ${dir}"
+	statusmsg "Successful installmodules to ${dir}"
+}
+
 installworld()
 {
 	dir="$1"
@@ -1718,6 +1729,16 @@
 			buildmodules
 			;;
 
+		installmodules=*)
+			arg=${op#*=}
+			if [ "${arg}" = "/" ] && \
+			    (	[ "${uname_s}" != "NetBSD" ] || \
+				[ "${uname_m}" != "${MACHINE}" ] ); then
+				bomb "'${op}' must != / for cross builds."
+			fi
+			installmodules "${arg}"
+			;;
+
 		install=*)
 			arg=${op#*=}
 			if [ "${arg}" = "/" ] && \

Reply via email to