tech-toolchain archive

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

building modules by build.sh (Re: exec: /sbin/init: error 8)



<20090505092347.GA3545%drowsy.duskware.de@localhost> on current-users
Martin Husemann wrote:

> On Tue, May 05, 2009 at 05:46:35PM +0900, Izumi Tsutsui wrote:
> > Yes, I agree adding "modules" target into build.sh and
> > building it also on kernel=foo target is good idea.
> 
> The latter only if the kernel is MODULAR though :-}

It's trivial to just add "modules" target to build.sh.
(attached, though I'm afraid there might be better syntax)

I'm not sure if it's a good idea to handle dependencies
between kernel and modules in build.sh.

> > I'm also thinking if it's worth to split module files
> > from base.tgz into an independent module.tgz or so.
> > (though we also have to modify sysinst(8) too)
> 
> Yes, we should have a separate set for that.

I've already prepared modules.* list files in
src/distrib/sets/lists/base so it should be trivial
to create independent modules.tgz in
src/distrib/sets/set.subr etc.

But for sysinst(8) we have to modify all files under
distrib/utils/sysinst/arch and it will take some more time
for confirmation.

---
Index: build.sh
===================================================================
RCS file: /cvsroot/src/build.sh,v
retrieving revision 1.206
diff -u -r1.206 build.sh
--- build.sh    13 Mar 2009 16:23:31 -0000      1.206
+++ build.sh    5 May 2009 10:17:40 -0000
@@ -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%%=*}
@@ -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}" = "/" ] && \

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index