2005-12-05 15:11:09 +01:00
|
|
|
source $stdenv/setup
|
2005-06-15 14:30:34 +02:00
|
|
|
|
2006-09-19 00:09:47 +02:00
|
|
|
|
|
|
|
configurePhase=configurePhase
|
|
|
|
configurePhase() {
|
2006-10-31 12:40:35 +01:00
|
|
|
|
|
|
|
#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-19 00:09:47 +02:00
|
|
|
export INSTALL_PATH=$out
|
2005-06-15 16:21:48 +02:00
|
|
|
export INSTALL_MOD_PATH=$out
|
2006-09-19 00:09:47 +02:00
|
|
|
|
2006-10-31 12:40:35 +01:00
|
|
|
cp $config .config
|
2006-09-19 00:09:47 +02:00
|
|
|
make oldconfig
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
buildPhase=buildPhase
|
|
|
|
buildPhase() {
|
2005-06-15 14:30:34 +02:00
|
|
|
make
|
2006-09-19 00:09:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
installPhase=installPhase
|
|
|
|
installPhase() {
|
|
|
|
|
|
|
|
ensureDir $out
|
|
|
|
|
|
|
|
make install
|
|
|
|
|
2006-11-03 09:32:23 +01:00
|
|
|
# Install the modules in $out/lib/modules with matching paths
|
|
|
|
# in modules.dep (i.e., refererring to $out/lib/modules, not
|
|
|
|
# /lib/modules). The depmod_opts= is to prevent the kernel
|
|
|
|
# from passing `-b PATH' to depmod.
|
|
|
|
export MODULE_DIR=$out/lib/modules/
|
|
|
|
make modules_install DEPMOD=$module_init_tools/sbin/depmod depmod_opts=
|
2005-08-20 00:43:51 +02:00
|
|
|
|
2006-09-19 00:09:47 +02:00
|
|
|
# Strip the kernel modules.
|
|
|
|
echo "Stripping kernel modules..."
|
|
|
|
find $out -name "*.ko" -print0 | xargs -0 strip -S
|
|
|
|
|
2005-08-20 00:43:51 +02:00
|
|
|
# move this to install later on
|
|
|
|
# largely copied from early FC3 kernel spec files
|
2006-10-31 12:40:35 +01:00
|
|
|
version=$(cd $out/lib/modules && ls -d *)
|
2005-08-20 00:43:51 +02:00
|
|
|
|
|
|
|
# remove symlinks and create directories
|
2006-10-31 12:40:35 +01:00
|
|
|
rm -f $out/lib/modules/$version/build
|
|
|
|
rm -f $out/lib/modules/$version/source
|
|
|
|
mkdir $out/lib/modules/$version/build
|
|
|
|
ln -s $out/lib/modules/$version/build $out/lib/modules/$version/source
|
2005-08-20 00:43:51 +02:00
|
|
|
# copy all Makefiles and Kconfig files
|
2006-10-31 12:40:35 +01:00
|
|
|
cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/$version/build
|
2005-08-20 00:43:51 +02:00
|
|
|
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
|
2006-10-31 12:40:35 +01:00
|
|
|
cp .config $out/lib/modules/$version/build/.config
|
2005-08-20 00:43:51 +02:00
|
|
|
|
|
|
|
# copy architecture dependent files
|
|
|
|
|
2006-10-31 12:40:35 +01:00
|
|
|
cp -a arch/$arch/scripts $out/lib/modules/$version/build || true
|
|
|
|
cp -a arch/$arch/*lds $out/lib/modules/$version/build || true
|
|
|
|
cp -a arch/$arch/Makefile.cpu $out/lib/modules/$version/build/arch/$arch || true
|
|
|
|
cp -a --parents arch/$arch/kernel/asm-offsets.s $out/lib/modules/$version/build/arch/$arch/kernel || true
|
2005-08-20 00:43:51 +02:00
|
|
|
|
|
|
|
# copy scripts
|
2006-10-31 12:40:35 +01:00
|
|
|
rm -f scripts/*.o
|
|
|
|
rm -f scripts/*/*.o
|
|
|
|
cp -a scripts $out/lib/modules/$version/build
|
2005-08-20 00:43:51 +02:00
|
|
|
|
|
|
|
# copy include files
|
2006-10-31 12:40:35 +01:00
|
|
|
mkdir -p $out/lib/modules/$version/build/include
|
2005-08-20 00:43:51 +02:00
|
|
|
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 19:40:37 +02:00
|
|
|
cd ..
|
2005-06-15 14:30:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
genericBuild
|