Module Name:    src
Committed By:   jnemeth
Date:           Mon Sep  7 04:14:17 UTC 2009

Modified Files:
        src: BUILDING build.sh

Log Message:
Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolch...@.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/BUILDING
cvs rdiff -u -r1.206 -r1.207 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/BUILDING
diff -u src/BUILDING:1.85 src/BUILDING:1.86
--- src/BUILDING:1.85	Sun Jul 12 14:17:18 2009
+++ src/BUILDING	Mon Sep  7 04:14:17 2009
@@ -688,6 +688,9 @@
                    This command will run ``make cleandir'' on the kernel in
                    question first unless the -u option is given.
 
+     modules       This command will build kernel modules and install them
+                   into DESTDIR.
+
      releasekernel=kconf
                    Install a gzip(1)ed copy of the kernel previously built by
                    kernel=kconf into

Index: src/build.sh
diff -u src/build.sh:1.206 src/build.sh:1.207
--- src/build.sh:1.206	Fri Mar 13 16:23:31 2009
+++ src/build.sh	Mon Sep  7 04:14:17 2009
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.206 2009/03/13 16:23:31 perry Exp $
+#	$NetBSD: build.sh,v 1.207 2009/09/07 04:14:17 jnemeth Exp $
 #
 # Copyright (c) 2001-2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -231,6 +231,7 @@
 	do_release=false
 	do_kernel=false
 	do_releasekernel=false
+	do_modules=false
 	do_install=false
 	do_sets=false
 	do_sourcesets=false
@@ -565,6 +566,7 @@
                         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.
+    modules             Build and install kernel modules.
     sets                Create binary sets in
                         RELEASEDIR/RELEASEMACHINEDIR/binary/sets.
                         DESTDIR should be populated beforehand.
@@ -824,6 +826,10 @@
 			    bomb "Must supply a kernel name with \`${op}=...'"
 			;;
 
+		modules)
+			op=modules
+			;;
+
 		install=*)
 			arg=${op#*=}
 			op=${op%%=*}
@@ -1217,7 +1223,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.206 2009/03/13 16:23:31 perry Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.207 2009/09/07 04:14:17 jnemeth Exp $
 # with these arguments: ${_args}
 #
 
@@ -1356,6 +1362,30 @@
 	done
 }
 
+buildmodules()
+{
+	if ! ${do_tools} && ! ${buildmoduleswarned:-false}; then
+		# Building tools every time we build modules is clearly
+		# unnecessary as well as a kernel.
+		#
+		statusmsg "Building modules without building new tools"
+		buildmoduleswarned=true
+	fi
+
+	statusmsg "Building kernel modules for NetBSD/${MACHINE} ${DISTRIBVER}"
+	if [ "${MKOBJDIRS}" != "no" ]; then
+		make_in_dir sys/modules obj ||
+		    bomb "Failed to make obj in sys/modules"
+	fi
+	if [ "${MKUPDATE}" = "no" ]; then
+		make_in_dir sys/modules cleandir
+	fi
+	${runcmd} "${makewrapper}" ${parallel} do-sys-modules ||
+	    bomb "Failed to make do-sys-modules"
+
+	statusmsg "Successful build kernel modules for NetBSD/${MACHINE} ${DISTRIBVER}"
+}
+
 installworld()
 {
 	dir="$1"
@@ -1430,6 +1460,10 @@
 			releasekernel "${arg}"
 			;;
 
+		modules)
+			buildmodules
+			;;
+
 		install=*)
 			arg=${op#*=}
 			if [ "${arg}" = "/" ] && \

Reply via email to