Made the linux kernel expressions support 'platform' again (thinking on reusing

most of the kernel expressions for the sheevaplug).
I still have not added anything in the kernels about cross compilation.
I moved the platform definitions out of all-packages.
I have not written good platform definitions for the sheevaplug - only for the
PC.
Only the linux-2.6.32 expression uses the platforms kernelConfig.
The linux-2.6.31 was broken, and I left it broken.


svn path=/nixpkgs/branches/stdenv-updates/; revision=19046
This commit is contained in:
Lluís Batlle i Rossell 2009-12-19 12:12:24 +00:00
parent 5bae851b1e
commit 9ef11e4c4d
5 changed files with 45 additions and 30 deletions

View file

@ -24,6 +24,9 @@ configurePhase() {
# generate-config.pl can answer them.
sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c
# Get a basic config file for later refinement with $generateConfig
make $kernelBaseConfig ARCH=$arch
# Create the config file.
echo "generating kernel configuration..."
echo "$kernelConfig" > kernel-config

View file

@ -33,7 +33,7 @@
, preConfigure ? ""
, extraMeta ? {}
, platform ? { name = "pc"; uboot = null; }
, platform ? { name = "pc"; uboot = null; kernelBaseConfig = "defconfig"; }
, ...
}:
@ -80,13 +80,14 @@ stdenv.mkDerivation {
++ lib.optional (platform.uboot != null) [platform.uboot];
platformName = platform.name;
kernelBaseConfig = platform.kernelBaseConfig;
arch =
if xen then "xen" else
if userModeLinux then "um" else
if platform ? kernelArch then platform.kernelArch else
if stdenv.system == "i686-linux" then "i386" else
if stdenv.system == "x86_64-linux" then "x86_64" else
if stdenv.system == "armv5tel-linux" then "arm" else
abort "Platform ${stdenv.system} is not supported.";
meta = {

View file

@ -1,4 +1,5 @@
args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? "", ... }:
args @ { stdenv, fetchurl, platform, userModeLinux ? false, extraConfig ? ""
, ... }:
import ./generic.nix (
@ -11,7 +12,7 @@ import ./generic.nix (
};
features.iwlwifi = true;
config =
''
# Don't include any debug features.
@ -26,16 +27,6 @@ import ./generic.nix (
# Optimize with -O2, not -Os.
CC_OPTIMIZE_FOR_SIZE n
# Virtualisation (KVM, Xen...).
PARAVIRT_GUEST y
KVM_CLOCK y
KVM_GUEST y
XEN y
KSM y
# We need 64 GB (PAE) support for Xen guest support.
HIGHMEM64G? y
# Enable the kernel's built-in memory tester.
MEMTEST y
@ -207,6 +198,7 @@ import ./generic.nix (
X86_CHECK_BIOS_CORRUPTION y
X86_MCE y
${if platform ? kernelExtraConfig then platform.kernelExtraConfig else ""}
${extraConfig}
'';
}

View file

@ -310,23 +310,11 @@ let
inherit pkgs lib;
};
platformPC = assert system == "i686-linux" || system == "x86_64-linux"; {
name = "pc";
uboot = null;
platforms = import ./platforms.nix {
inherit system pkgs;
};
platformSheevaplug = assert system == "armv5tel-linux"; {
name = "sheevaplug";
inherit uboot;
};
platformVersatileARM = assert system == "armv5tel-linux"; {
name = "versatileARM";
uboot = null;
};
platform = platformPC;
platform = platforms.pc;
### TOOLS
@ -5579,7 +5567,7 @@ let
kernel_2_6_31_zen_bfs = kernel_2_6_31_zen7_bfs;
kernel_2_6_32 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.32.nix) {
inherit fetchurl stdenv perl mktemp module_init_tools;
inherit fetchurl stdenv perl mktemp module_init_tools platform;
kernelPatches =
[ kernelPatches.fbcondecor_2_6_31
kernelPatches.sec_perm_2_6_24

View file

@ -0,0 +1,31 @@
{ system, pkgs}:
with pkgs;
{
pc = assert system == "i686-linux" || system == "x86_64-linux"; {
name = "pc";
uboot = null;
kernelBaseConfig = "defconfig";
kernelExtraConfig =
''
# Virtualisation (KVM, Xen...).
PARAVIRT_GUEST y
KVM_CLOCK y
KVM_GUEST y
XEN y
KSM y
# We need 64 GB (PAE) support for Xen guest support.
HIGHMEM64G? y
'';
};
sheevaplug = assert system == "armv5tel-linux"; {
name = "sheevaplug";
inherit uboot;
};
platformVersatileARM = assert system == "armv5tel-linux"; {
name = "versatileARM";
uboot = null;
};
}