Fixing the nanonote kernel expressions so they work.

In fact only 2.6.34 boots fine, while 2.6.35 needs a fetchsvn new revision,
waiting for an upstream patch.

svn path=/nixpkgs/branches/stdenv-updates/; revision=23039
This commit is contained in:
Lluís Batlle i Rossell 2010-08-08 18:46:57 +00:00
parent f2de89336b
commit eddc9d6ab5
5 changed files with 146 additions and 81 deletions

View File

@ -74,6 +74,7 @@ installPhase() {
cp vmlinux $out
if grep -q "CONFIG_MODULES=y" .config; then
# 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
@ -144,6 +145,11 @@ installPhase() {
(cd arch/$archDir/include && cp -a asm/* $includeDir/asm/ || true)
(cd arch/$archDir/include/asm/mach-generic && cp -a * $includeDir/ || true)
fi
fi
if test -n "$postInstall"; then
eval "$postInstall";
fi
}

View File

@ -37,6 +37,7 @@
, preConfigure ? ""
, extraMeta ? {}
, ubootChooser ? null
, postInstall ? ""
, ...
}:
@ -70,7 +71,7 @@ stdenv.mkDerivation {
generateConfig = ./generate-config.pl;
inherit preConfigure src module_init_tools localVersion;
inherit preConfigure src module_init_tools localVersion postInstall;
patches = map (p: p.patch) kernelPatches;

View File

@ -1,4 +1,4 @@
args @ { stdenv, fetchgit, userModeLinux ? false, extraConfig ? ""
args @ { stdenv, fetchurl, fetchsvn, userModeLinux ? false, extraConfig ? ""
, ... }:
let
@ -194,14 +194,43 @@ in
import ./generic.nix (
rec {
version = "jz-2.6.34";
version = "qi_lb60-2.6.34.1-openwrt-22513";
src = fetchgit {
url = "git://projects.qi-hardware.com/qi-kernel.git";
rev = "f42d987a04d6f9366c47edf794f66796151867b9";
sha256 = "bc9da0af30d5bf4c7be7495e052b328e72ab6a7f8a57e201720e3198cd6afb22";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v2.6/linux-2.6.34.1.tar.bz2";
sha256 = "0v78yvkwr100v7bnrkkabxmpv5hjg1ngrjbr5d0kkzsw4d7bmm5x";
};
srcPatch = fetchsvn {
url = "svn://svn.openwrt.org/openwrt/trunk/target/linux";
rev = 22513;
sha256 = "0b7wzgqnbq8sq32z9ik08n1b7fnc9v9d91zwvb6qz7vj3dlrxw3g";
};
preConfigure = ''
cp -R ${srcPatch}/generic/files/* .
chmod +w -R *
GLOBIGNORE='.:..:*preinit_as_init*'
for a in ${srcPatch}/generic/patches-2.6.34/* ${srcPatch}/xburst/patches-2.6.34/* ; do
echo applying patch $a
patch -p1 < $a
done
unset GLOBIGNORE
cat ${srcPatch}/generic/config-2.6.34 ${srcPatch}/xburst/config-2.6.34 \
${srcPatch}/xburst/qi_lb60/config-2.6.34 > arch/mips/configs/qi_lb60_defconfig
'';
postInstall = ''
set -x
gzip -9 -c $out/vmlinux.bin > $out/vmlinux.bin.gz
KERNEL_ENTRY="0x`$crossConfig-nm $out/vmlinux 2>/dev/null |
grep " kernel_entry" | cut -f1 -d ' '`"
mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip \
-e $KERNEL_ENTRY -n "MIPS Nix Linux-2.6.34" \
-d $out/vmlinux.bin.gz $out/uImage
set +x
'';
config = configWithPlatform stdenv.platform;
configCross = configWithPlatform stdenv.cross.platform;

View File

@ -1,4 +1,4 @@
args @ { stdenv, fetchgit, userModeLinux ? false, extraConfig ? ""
args @ { stdenv, fetchurl, fetchsvn, userModeLinux ? false, extraConfig ? ""
, ... }:
let
@ -194,14 +194,43 @@ in
import ./generic.nix (
rec {
version = "jz-2.6.35";
version = "qi_lb60-2.6.35-openwrt-22513";
src = fetchgit {
url = "git://projects.qi-hardware.com/qi-kernel.git";
rev = "4a5edaeef89037e288d8ae6c81eca1c6bda753da";
sha256 = "42778cf871473bebc609eb26441591318b8396b03671360193bbe0e50cc29082";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v2.6/linux-2.6.35.tar.bz2";
sha256 = "1kxz87nwksx4hvq1i45i9w1zq1fb09rvf8i6jin3cbh36v1y5chq";
};
srcPatch = fetchsvn {
url = "svn://svn.openwrt.org/openwrt/trunk/target/linux";
rev = 22513;
sha256 = "0b7wzgqnbq8sq32z9ik08n1b7fnc9v9d91zwvb6qz7vj3dlrxw3g";
};
preConfigure = ''
cp -R ${srcPatch}/generic/files/* .
chmod +w -R *
GLOBIGNORE='.:..:*preinit_as_init*'
for a in ${srcPatch}/generic/patches-2.6.35/* ${srcPatch}/xburst/patches-2.6.35/* ; do
echo applying patch $a
patch -p1 < $a
done
unset GLOBIGNORE
cat ${srcPatch}/generic/config-2.6.35 ${srcPatch}/xburst/config-2.6.35 \
${srcPatch}/xburst/qi_lb60/config-2.6.35 > arch/mips/configs/qi_lb60_defconfig
'';
postInstall = ''
set -x
gzip -9 -c $out/vmlinux.bin > $out/vmlinux.bin.gz
KERNEL_ENTRY="0x`$crossConfig-nm $out/vmlinux 2>/dev/null |
grep " kernel_entry" | cut -f1 -d ' '`"
mkimage -A mips -O linux -T kernel -a 0x80010000 -C gzip \
-e $KERNEL_ENTRY -n "MIPS Nix Linux-2.6.35" \
-d $out/vmlinux.bin.gz $out/uImage
set +x
'';
config = configWithPlatform stdenv.platform;
configCross = configWithPlatform stdenv.cross.platform;

View File

@ -4497,12 +4497,12 @@ let
linux_nanonote_jz_2_6_34 = makeOverridable
(import ../os-specific/linux/kernel/linux-nanonote-jz-2.6.34.nix) {
inherit fetchurl fetchgit stdenv perl mktemp module_init_tools ubootChooser;
inherit fetchurl fetchsvn stdenv perl mktemp module_init_tools ubootChooser;
};
linux_nanonote_jz_2_6_35 = makeOverridable
(import ../os-specific/linux/kernel/linux-nanonote-jz-2.6.35.nix) {
inherit fetchurl fetchgit stdenv perl mktemp module_init_tools ubootChooser;
inherit fetchurl fetchsvn stdenv perl mktemp module_init_tools ubootChooser;
};
/* Linux kernel modules are inherently tied to a specific kernel. So