Source-Changes-HG archive

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

[src/trunk]: src add an installmodules=<dir> command to build.sh



details:   https://anonhg.NetBSD.org/src/rev/0e1012683416
branches:  trunk
changeset: 768104:0e1012683416
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Aug 08 22:15:42 2011 +0000

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

diffstat:

 Makefile |  25 ++++++++++++++++++++++++-
 build.sh |  27 ++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 4 deletions(-)

diffs (116 lines):

diff -r cc5619865d19 -r 0e1012683416 Makefile
--- a/Makefile  Mon Aug 08 19:50:17 2011 +0000
+++ b/Makefile  Mon Aug 08 22:15:42 2011 +0000
@@ -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
 #
 
diff -r cc5619865d19 -r 0e1012683416 build.sh
--- a/build.sh  Mon Aug 08 19:50:17 2011 +0000
+++ b/build.sh  Mon Aug 08 22:15:42 2011 +0000
@@ -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}" = "/" ] && \



Home | Main Index | Thread Index | Old Index