2005-12-05 14:11:09 +00:00
|
|
|
source $stdenv/setup
|
2005-06-15 12:30:34 +00:00
|
|
|
|
2006-09-18 22:09:47 +00:00
|
|
|
|
|
|
|
configurePhase=configurePhase
|
|
|
|
configurePhase() {
|
2007-03-27 11:11:58 +00:00
|
|
|
export INSTALL_PATH=$out
|
|
|
|
export INSTALL_MOD_PATH=$out
|
2006-09-18 22:09:47 +00:00
|
|
|
|
2007-05-15 12:53:03 +00:00
|
|
|
|
|
|
|
# Get rid of any "localversion" files installed by patches.
|
|
|
|
if test -z "$allowLocalVersion"; then
|
|
|
|
rm -f localversion*
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set our own localversion, if specified.
|
|
|
|
if test -n "$localVersion"; then
|
|
|
|
echo "$localVersion" > localversion-nix
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Create the config file.
|
2007-03-27 11:11:58 +00:00
|
|
|
cp $config .config
|
|
|
|
chmod u+w .config
|
2007-01-22 15:18:30 +00:00
|
|
|
|
2007-03-27 11:11:58 +00:00
|
|
|
echo "$extraConfig" >> .config
|
2007-01-01 13:42:23 +00:00
|
|
|
|
2007-03-27 11:11:58 +00:00
|
|
|
#substituteInPlace scripts/kconfig/lxdialog/check-lxdialog.sh \
|
|
|
|
# --replace /usr /no-such-path
|
2007-01-01 14:17:06 +00:00
|
|
|
|
2007-03-27 11:11:58 +00:00
|
|
|
# Necessary until NIXPKGS-38 is fixed:
|
|
|
|
echo "#! $SHELL" > scripts/kconfig/lxdialog/check-lxdialog.sh
|
|
|
|
chmod +x scripts/kconfig/lxdialog/check-lxdialog.sh
|
|
|
|
|
|
|
|
make oldconfig \
|
|
|
|
$makeFlags "${makeFlagsArray[@]}"
|
2006-09-18 22:09:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
installPhase=installPhase
|
|
|
|
installPhase() {
|
|
|
|
|
2007-03-27 11:11:58 +00:00
|
|
|
ensureDir $out
|
2007-02-08 14:28:49 +00:00
|
|
|
|
2007-03-27 11:11:58 +00:00
|
|
|
# Copy the bzImage and System.map.
|
|
|
|
cp System.map $out
|
|
|
|
if test "$arch" = um; then
|
|
|
|
ensureDir $out/bin
|
|
|
|
cp linux $out/bin
|
|
|
|
else
|
2007-02-08 15:32:14 +00:00
|
|
|
cp arch/$arch/boot/bzImage $out/vmlinuz
|
2007-03-27 11:11:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# 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= \
|
|
|
|
$makeFlags "${makeFlagsArray[@]}" \
|
|
|
|
$installFlags "${installFlagsArray[@]}"
|
|
|
|
|
|
|
|
# Strip the kernel modules.
|
|
|
|
echo "Stripping kernel modules..."
|
|
|
|
find $out -name "*.ko" -print0 | xargs -0 strip -S
|
|
|
|
|
|
|
|
# move this to install later on
|
|
|
|
# largely copied from early FC3 kernel spec files
|
|
|
|
version=$(cd $out/lib/modules && ls -d *)
|
|
|
|
|
|
|
|
# remove symlinks and create directories
|
|
|
|
rm -f $out/lib/modules/$version/build
|
|
|
|
rm -f $out/lib/modules/$version/source
|
|
|
|
mkdir $out/lib/modules/$version/build
|
|
|
|
|
|
|
|
# copy config
|
|
|
|
cp .config $out/lib/modules/$version/build/.config
|
|
|
|
|
|
|
|
if test "$arch" != um; then
|
2005-08-19 22:43:51 +00:00
|
|
|
# copy all Makefiles and Kconfig files
|
2007-03-27 11:11:58 +00:00
|
|
|
ln -s $out/lib/modules/$version/build $out/lib/modules/$version/source
|
2006-10-31 11:40:35 +00:00
|
|
|
cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/$version/build
|
2005-08-19 22:43:51 +00: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 architecture dependent files
|
2006-10-31 11:40:35 +00: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-19 22:43:51 +00:00
|
|
|
|
|
|
|
# copy scripts
|
2006-10-31 11:40:35 +00:00
|
|
|
rm -f scripts/*.o
|
|
|
|
rm -f scripts/*/*.o
|
|
|
|
cp -a scripts $out/lib/modules/$version/build
|
2005-08-19 22:43:51 +00:00
|
|
|
|
|
|
|
# copy include files
|
2006-10-31 11:40:35 +00:00
|
|
|
mkdir -p $out/lib/modules/$version/build/include
|
2005-08-19 22:43:51 +00: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 17:40:37 +00:00
|
|
|
cd ..
|
2007-03-27 11:11:58 +00:00
|
|
|
fi
|
2005-06-15 12:30:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
genericBuild
|