2009-01-02 12:04:35 +00:00
|
|
|
#!/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"
|
2009-01-02 13:30:48 +00:00
|
|
|
mkdir -p "$image/lib/modules"
|
2009-01-02 12:04:35 +00:00
|
|
|
cp -alf /lib/modules/$kernel $image/lib/modules/
|
|
|
|
|
|
|
|
depmod -b "$image" $kernel
|
|
|
|
|
|
|
|
rm -f $image/lib/modules/$kernel/source $image/lib/modules/$kernel/build
|
|
|
|
|
2009-01-02 13:30:48 +00:00
|
|
|
mkcramfs $image/lib $dest
|