* Linux kernel: updated to 2.6.18.1.
* Kernel: accept a list of kernel patches through the kernelPatches argument. The names of the patches are added to the description attribute (e.g., "The Linux kernel (with patches: skas-2.6.18-v9-pre9)"). * Generic builder (forked in setup-new.sh): support patches that are compressed using gzip or bzip2. svn path=/nixpkgs/trunk/; revision=6913
This commit is contained in:
@@ -3,18 +3,19 @@ source $stdenv/setup
|
||||
|
||||
configurePhase=configurePhase
|
||||
configurePhase() {
|
||||
cp $config .config
|
||||
#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
|
||||
#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
|
||||
|
||||
export INSTALL_PATH=$out
|
||||
export INSTALL_MOD_PATH=$out
|
||||
|
||||
cp $config .config
|
||||
make oldconfig
|
||||
}
|
||||
|
||||
@@ -40,16 +41,15 @@ installPhase() {
|
||||
|
||||
# move this to install later on
|
||||
# largely copied from early FC3 kernel spec files
|
||||
stripHash $out
|
||||
version=$(echo $strippedName | cut -c 7-)-$hashname
|
||||
version=$(cd $out/lib/modules && ls -d *)
|
||||
|
||||
# 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
|
||||
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
|
||||
# copy all Makefiles and Kconfig files
|
||||
cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $out/lib/modules/${version}/build
|
||||
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
|
||||
@@ -58,33 +58,26 @@ installPhase() {
|
||||
rm -rf $out/lib/modules/$version/build/include
|
||||
|
||||
# copy config
|
||||
cp $config $out/lib/modules/${version}/build/.config
|
||||
cp .config $out/lib/modules/$version/build/.config
|
||||
|
||||
# copy architecture dependent files
|
||||
|
||||
cp -a arch/$arch/scripts $out/lib/modules/${version}/build || :
|
||||
cp -a arch/$arch/*lds $out/lib/modules/${version}/build || :
|
||||
cp -a arch/$arch/Makefile.cpu $out/lib/modules/${version}/build/arch/$arch || :
|
||||
cp -a --parents arch/$arch/kernel/asm-offsets.s $out/lib/modules/${version}/build/arch/$arch/kernel || :
|
||||
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
|
||||
|
||||
# copy scripts
|
||||
rm -rf scripts/*.o
|
||||
rm -rf scripts/*/.o
|
||||
cp -a scripts $out/lib/modules/${version}/build
|
||||
rm -f scripts/*.o
|
||||
rm -f scripts/*/*.o
|
||||
cp -a scripts $out/lib/modules/$version/build
|
||||
|
||||
# copy include files
|
||||
mkdir -p $out/lib/modules/${version}/build/include
|
||||
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
|
||||
cd ..
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
||||
{stdenv, fetchurl, perl, mktemp}:
|
||||
|
||||
assert stdenv.system == "i686-linux";
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "linux-2.6.17.13";
|
||||
builder = ./builder.sh;
|
||||
src = fetchurl {
|
||||
url = http://nix.cs.uu.nl/dist/tarballs/linux-2.6.17.13.tar.bz2;
|
||||
md5 = "834885b3ad9988b966570bee92459572";
|
||||
};
|
||||
config = ./config-2.6.17.1;
|
||||
inherit perl;
|
||||
buildInputs = [perl mktemp];
|
||||
arch="i386";
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{ stdenv, fetchurl, perl, mktemp
|
||||
|
||||
# A list of patches to apply to the kernel. Each element of this list
|
||||
# should be an attribute set {name, patch} where `name' is a
|
||||
# symbolic name and `patch' is the actual patch. The patch may
|
||||
# optionally be compressed with gzip or bzip2.
|
||||
, kernelPatches ? []
|
||||
}:
|
||||
|
||||
assert stdenv.system == "i686-linux";
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "linux-2.6.18.1";
|
||||
builder = ./builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = ftp://ftp.nl.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.1.tar.bz2;
|
||||
md5 = "38f00633b02f07819d17bcd87d03eb3a";
|
||||
};
|
||||
|
||||
patches = map (p: p.patch) kernelPatches;
|
||||
|
||||
config = ./config-2.6.18.1-up;
|
||||
|
||||
buildInputs = [perl mktemp];
|
||||
arch="i386";
|
||||
|
||||
meta = {
|
||||
description =
|
||||
"The Linux kernel" +
|
||||
(if kernelPatches == [] then "" else
|
||||
" (with patches: "
|
||||
+ (let lib = import ../../../lib;
|
||||
in lib.concatStrings (lib.intersperse ", " (map (x: x.name) kernelPatches)))
|
||||
+ ")");
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user