From 648b17197ff0812c9f94816e134001ce918a26c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 10 Mar 2010 20:44:48 +0000 Subject: [PATCH] Adding linux 2.4 kernel headers for cross builds. (I'm thinking of OpenWRT machines out there, mips, with linux 2.4) svn path=/nixpkgs/trunk/; revision=20539 --- pkgs/top-level/all-packages.nix | 15 ++++++++++++++- pkgs/top-level/platforms.nix | 3 +++ pkgs/top-level/release-cross.nix | 10 ++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dfa4928b2d34..37c6e5238b1e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5891,11 +5891,24 @@ let linuxHeaders = linuxHeaders_2_6_28; - linuxHeadersCross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix { + linuxHeaders26Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix { inherit stdenv fetchurl perl; cross = assert crossSystem != null; crossSystem; }); + linuxHeaders24Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.4.nix { + inherit stdenv fetchurl perl; + cross = assert crossSystem != null; crossSystem; + }); + + # We can choose: + linuxHeadersCrossChooser = ver : if (ver == "2.4") then linuxHeaders24Cross + else if (ver == "2.6") then linuxHeaders26Cross + else throw "Unknown linux kernel version"; + + linuxHeadersCross = assert crossSystem != null; + linuxHeadersCrossChooser crossSystem.platform.kernelMajor; + linuxHeaders_2_6_18 = import ../os-specific/linux/kernel-headers/2.6.18.5.nix { inherit fetchurl stdenv unifdef; }; diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index 3c680cac9e40..eb2943f8c70c 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -26,6 +26,7 @@ rec { sheevaplug = { name = "sheevaplug"; + kernelMajor = "2.6"; kernelHeadersBaseConfig = "kirkwood_defconfig"; kernelBaseConfig = "kirkwood_defconfig"; kernelArch = "arm"; @@ -69,6 +70,7 @@ rec { versatileARM = { name = "versatileARM"; + kernelMajor = "2.6"; kernelHeadersBaseConfig = "versatile_defconfig"; kernelBaseConfig = "versatile_defconfig"; kernelArch = "arm"; @@ -106,6 +108,7 @@ rec { integratorCP = { name = "integratorCP"; + kernelMajor = "2.6"; kernelHeadersBaseConfig = "integrator_defconfig"; kernelBaseConfig = "integrator_defconfig"; kernelArch = "arm"; diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index 7d4173bd988b..37ecda0e0276 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -80,20 +80,21 @@ let arch = "mips"; float = "soft"; withTLS = true; - libc = "glibc"; + libc = "uclibc"; platform = { name = "malta"; + kernelMajor = "2.4"; kernelBaseConfig = "malta_defconfig"; - kernelHeadersBaseConfig = "malta_defconfig"; + kernelHeadersBaseConfig = "defconfig-malta"; uboot = null; kernelArch = "mips"; kernelAutoModules = false; - kernelTarget = "vmlinux.bin"; + kernelTarget = "vmlinux"; }; openssl.system = "linux-generic32"; }; in { - crossMipselLinux = mapTestOnCross crossSystem basic; + crossMipselLinux24 = mapTestOnCross crossSystem basic; }) // ( /* Test some cross builds to the ultrasparc */ @@ -108,6 +109,7 @@ let libc = "glibc"; platform = { name = "ultrasparc"; + kernelMajor = "2.6"; kernelHeadersBaseConfig = "sparc64_defconfig"; kernelBaseConfig = "sparc64_defconfig"; kernelArch = "sparc";