Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add a modules operation to build.sh, which builds and instal...



details:   https://anonhg.NetBSD.org/src/rev/fb18fb458fbf
branches:  trunk
changeset: 747244:fb18fb458fbf
user:      jnemeth <jnemeth%NetBSD.org@localhost>
date:      Mon Sep 07 04:14:17 2009 +0000

description:
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-toolchain@.

diffstat:

 BUILDING |   3 +++
 build.sh |  38 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 39 insertions(+), 2 deletions(-)

diffs (101 lines):

diff -r 4b5dd3cce813 -r fb18fb458fbf BUILDING
--- a/BUILDING  Mon Sep 07 02:31:53 2009 +0000
+++ b/BUILDING  Mon Sep 07 04:14:17 2009 +0000
@@ -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
diff -r 4b5dd3cce813 -r fb18fb458fbf build.sh
--- a/build.sh  Mon Sep 07 02:31:53 2009 +0000
+++ b/build.sh  Mon Sep 07 04:14:17 2009 +0000
@@ -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}" = "/" ] && \



Home | Main Index | Thread Index | Old Index