summary refs log tree commit diff
path: root/pkgs/top-level/platforms.nix
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-02-27 17:35:47 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-02-27 17:35:47 +0000
commit11aa65c28a819db3a2142884f86fa6a8efdea640 (patch)
tree606604f9626decacbf5639d1642a2643ed6b9b66 /pkgs/top-level/platforms.nix
parentfca769846a4ba4f517f7c60bb1e4cec31c7e38dc (diff)
Simplified much more the expressions for cross building and multiplatform.
I introduce the new nixpkgs parameter "platform", defaulting to "pc",
which was before defined as an attribute of nixpkgs.

I made the crossSystem nixpkgs attribute set parameter contain its own 'platform'.

This allows cross-building a kernel for a given crossSystem.platform in a non-PC
platform.

The actual native platform can be taken from stdenv.platform, and this way we also
avoid the constant passing of 'platform' to packages for platform-dependant builds
(kernel, initrd, ...).

I will update nixos accordingly to these changes, for non-PC platforms to work.

I think we are gaining on flexibility and clearness. I could cross build succesfully
an ultrasparc kernel and a mipsel kernel on PC. But since this change, I should be able
to do this also in non-PC.

Before this change, there was no possibility of distinguishing the "target platform" or
the "native build platform" when cross building, being the single "platform" attribute
always interpreted as target platform.

The platform is a quite relevant attribute set, as it determines the linuxHeaders used
(in the case, by now the only one supported, of linux targets).

The platform attributes are quite linux centric still. Let's hope for more generality to come.

svn path=/nixpkgs/trunk/; revision=20273
Diffstat (limited to 'pkgs/top-level/platforms.nix')
-rw-r--r--pkgs/top-level/platforms.nix8
1 files changed, 3 insertions, 5 deletions
diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix
index 9cd209a755225..4b1fb3152873d 100644
--- a/pkgs/top-level/platforms.nix
+++ b/pkgs/top-level/platforms.nix
@@ -1,7 +1,5 @@
-{ system, pkgs}:
-with pkgs;
 rec {
-  pc = assert system == "i686-linux" || system == "x86_64-linux"; {
+  pc = {
     name = "pc";
     uboot = null;
     kernelBaseConfig = "defconfig";
@@ -60,7 +58,7 @@ rec {
         IP_PNP y
       '';
     kernelTarget = "uImage";
-    uboot = ubootSheevaplug;
+    uboot = "sheevaplug";
     # Only for uboot = uboot :
     ubootConfig = "sheevaplug_config";
   };
@@ -133,7 +131,7 @@ rec {
   integratorCPuboot = integratorCP // {
     name = "integratorCPuboot";
     kernelTarget = "uImage";
-    uboot = uboot;
+    uboot = "upstream";
     ubootConfig = "integratorcp_config";
   };
 }