summaryrefslogtreecommitdiffstats
path: root/mkmodloop
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-02 12:04:35 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-02 12:04:35 +0000
commit29c9030dcdc8a309f606fb816779353a87395604 (patch)
treeb30374d94a0604e9ae5f3158065be2f3c7990b23 /mkmodloop
parentebfe2cf1a71bddfa2f4d61b47a933ca5cd27f267 (diff)
downloadabuild-29c9030dcdc8a309f606fb816779353a87395604.tar.bz2
abuild-29c9030dcdc8a309f606fb816779353a87395604.tar.xz
mk*: build and include modloop
try also mount modloop during boot and run a second pass hardware detect.
Diffstat (limited to 'mkmodloop')
-rw-r--r--mkmodloop39
1 files changed, 39 insertions, 0 deletions
diff --git a/mkmodloop b/mkmodloop
new file mode 100644
index 0000000..a3723cc
--- /dev/null
+++ b/mkmodloop
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+msg() {
+ echo "==>" $@
+}
+
+die() {
+ echo $@
+ exit 1
+}
+
+image=$PWD/modloop
+dest=$PWD/modloop.cmg
+init=init
+
+
+kernel=$1
+# if no kernel specified, then guess...
+if [ -z "$kernel" ]; then
+ kernel=$(ls /lib/modules 2>/dev/null | tail -n 1)
+fi
+
+if [ ! -d /lib/modules/$kernel ]; then
+ die "modules dir /lib/modules/$kernel was not found"
+fi
+msg "Using kernel $kernel"
+
+
+rm -rf "$image"
+mkdir -p "$image/lib/modules" "$image/lib"
+
+cp -alf /lib/firmware $image/lib/
+cp -alf /lib/modules/$kernel $image/lib/modules/
+
+depmod -b "$image" $kernel
+
+rm -f $image/lib/modules/$kernel/source $image/lib/modules/$kernel/build
+
+mkcramfs $image $dest