[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: News: prebuilt kernel modules
- From: Flavio Stanchina <flavio at stanchina dot net>
- Date: Mon, 18 Apr 2005 00:45:25 +0200
Matthew Tippett wrote:
Are you using modules-assistant?
No; I had it working with m-a, but I didn't like the zillions of logs it
leaves around so I wrote a small script (that I'm attaching). It's a quick
hack really, but it Works For Me and besides it doesn't require anything
strange except fakeroot and the kernel-headers packages you want to build
against. When I have confirmation that the packages work fine, I'll see if
there are improvements to be made, but I don't think so.
Are there changes that is needed to simplify building multiple modules?
No, I didn't need to do any changes besides the patches I already apply to
my packages.
--
Ciao, Flavio
#!/bin/sh
# build this module for all available kernel sources (or headers)
# - parameter: destination dir for .debs
# TODO
# - check if include/linux/version.h actually exists, else complain
set -e
if [ ! -x debian/rules ]; then
echo "no debian/rules here"
exit 1
fi
if [ -z "$1" ]; then
echo "usage: $0 output-directory"
exit 1
fi
for dir in /lib/modules/*/build; do
realdir="$(readlink $dir)"
if [ -d "$realdir" ]; then
echo "===== building for $realdir"
eval $(grep -o 'UTS_RELEASE ".*"' "$realdir/include/linux/version.h" | sed 's/ /=/')
if [ -f "$realdir/debian/changelog" ]; then
KDREV="$(cd "$realdir" && dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2)"
else
KDREV="$(apt-cache policy $(basename "$realdir") | grep -o 'Installed: .*$' | cut -d' ' -f2)"
fi
fakeroot debian/rules kdist_clean
fakeroot debian/rules KVERS="$UTS_RELEASE" KSRC="$realdir" KDREV="$KDREV" KPKG_DEST_DIR="$1" kdist_image
else
echo "===== NOT: $dir -> $realdir"
fi
done