2005-12-05 14:11:09 +00:00
|
|
|
source $stdenv/setup
|
2005-06-15 13:30:34 +01:00
|
|
|
|
2006-09-18 23:09:47 +01:00
|
|
|
|
|
|
|
configurePhase=configurePhase
|
|
|
|
configurePhase() {
|
2005-06-15 13:30:34 +01:00
|
|
|
cp $config .config
|
2005-08-23 20:13:00 +01:00
|
|
|
#mkdir $out
|
|
|
|
hashname=$(basename $out)
|
|
|
|
if echo "$hashname" | grep -q '^[a-z0-9]\{32\}-'; then
|
|
|
|
hashname=$(echo "$hashname" | cut -c -32)
|
|
|
|
fi
|
|
|
|
|
|
|
|
extraname=$(grep ^EXTRAVERSION Makefile)
|
|
|
|
perl -p -i -e "s/^EXTRAVERSION.*/$extraname-$hashname/" Makefile
|
2006-09-18 23:09:47 +01:00
|
|
|
export INSTALL_PATH=$out
|
2005-06-15 15:21:48 +01:00
|
|
|
export INSTALL_MOD_PATH=$out
|
2006-09-18 23:09:47 +01:00
|
|
|
|
|
|
|
make oldconfig
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
buildPhase=buildPhase
|
|
|
|
buildPhase() {
|
2005-06-15 13:30:34 +01:00
|
|
|
make
|
2006-09-18 23:09:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
installPhase=installPhase
|
|
|
|
installPhase() {
|
|
|
|
|
|
|
|
ensureDir $out
|
|
|
|
|
|
|
|
make install
|
|
|
|
|
2005-06-17 00:33:59 +01:00
|
|
|
make modules_install
|
2005-08-19 23:43:51 +01:00
|
|
|
|
2006-09-18 23:09:47 +01:00
|
|
|
# Strip the kernel modules.
|
|
|
|
echo "Stripping kernel modules..."
|
|
|
|
find $out -name "*.ko" -print0 | xargs -0 strip -S
|
|
|
|
|
2005-08-19 23:43:51 +01:00
|
|
|
# move this to install later on
|
|
|
|
# largely copied from early FC3 kernel spec files
|
|
|
|
stripHash $out
|
2005-08-23 20:13:00 +01:00
|
|
|
version=$(echo $strippedName | cut -c 7-)-$hashname
|
2005-08-19 23:43:51 +01:00
|
|
|
|
|
|
|
# remove symlinks and create directories
|
|
|
|
rm $out/lib/modules/${version}/build
|
|
|
|
rm $out/lib/modules/${version}/source
|
|
|
|
mkdir $out/lib/modules/${version}/build
|
|
|
|
ln -s $out/lib/modules/${version}/build $out/lib/modules/${version}/source
|
|
|
|
# copy all Makefiles and Kconfig files
|
|
|
|
cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/${version}/build
|
|
|
|
cp Module.symvers $out/lib/modules/$version/build
|
|
|
|
|
|
|
|
# weed out unneeded stuff
|
|
|
|
rm -rf $out/lib/modules/$version/build/Documentation
|
|
|
|
rm -rf $out/lib/modules/$version/build/scripts
|
|
|
|
rm -rf $out/lib/modules/$version/build/include
|
|
|
|
|
|
|
|
# copy config
|
|
|
|
cp $config $out/lib/modules/${version}/build/.config
|
|
|
|
|
|
|
|
# copy architecture dependent files
|
|
|
|
|
2005-08-20 00:09:42 +01:00
|
|
|
cp -a arch/$arch/scripts $out/lib/modules/${version}/build || :
|
|
|
|
cp -a arch/$arch/*lds $out/lib/modules/${version}/build || :
|
2006-07-16 19:57:45 +01:00
|
|
|
cp -a arch/$arch/Makefile.cpu $out/lib/modules/${version}/build/arch/$arch || :
|
2005-08-20 00:09:42 +01:00
|
|
|
cp -a --parents arch/$arch/kernel/asm-offsets.s $out/lib/modules/${version}/build/arch/$arch/kernel || :
|
2005-08-19 23:43:51 +01:00
|
|
|
|
|
|
|
# copy scripts
|
|
|
|
rm -rf scripts/*.o
|
|
|
|
rm -rf scripts/*/.o
|
|
|
|
cp -a scripts $out/lib/modules/${version}/build
|
|
|
|
|
|
|
|
# copy include files
|
|
|
|
mkdir -p $out/lib/modules/${version}/build/include
|
|
|
|
cd include
|
|
|
|
cp -a acpi config linux math-emu media net pcmcia rxrpc scsi sound video asm asm-generic $out/lib/modules/$version/build/include
|
|
|
|
cp -a `readlink asm` $out/lib/modules/$version/build/include
|
2005-08-20 18:40:37 +01:00
|
|
|
cd ..
|
2005-08-19 23:43:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Make sure the Makefile and version.h have a matching timestamp so that
|
|
|
|
# external modules can be built
|
|
|
|
touch -r $out/lib/modules/$version/build/Makefile $out/lib/modules/$version/build/include/linux/version.h
|
|
|
|
touch -r $out/lib/modules/$version/build/.config $out/lib/modules/$version/build/include/linux/autoconf.h
|
|
|
|
|
2005-06-15 13:30:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
genericBuild
|