Skip to content

Commit

Permalink
platforms.nix: Separate 32-bit and 64-bit PCs
Browse files Browse the repository at this point in the history
With this, stdenv.platform.kernelArch can be used by the kernel builder
for PC platforms too.

Signed-off-by: Shea Levy <shea@shealevy.com>
  • Loading branch information
shlevy committed Mar 24, 2013
1 parent 98860f4 commit 1a75b6b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ let
if system == "armv6l-linux" then platforms.raspberrypi
else if system == "armv5tel-linux" then platforms.sheevaplug
else if system == "mips64el-linux" then platforms.fuloong2f_n32
else platforms.pc;
else if system == "x86_64-linux" then platforms.pc64
else if system == "i686-linux" then platforms.pc32
else platforms.pcBase;

platform = if platform_ != null then platform_
else config.platform or platformAuto;
Expand Down
15 changes: 10 additions & 5 deletions pkgs/top-level/platforms.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
rec {
pc = {
pcBase = {
name = "pc";
uboot = null;
kernelHeadersBaseConfig = "defconfig";
kernelBaseConfig = "defconfig";
# Build whatever possible as a module, if not stated in the extra config.
kernelAutoModules = true;
kernelTarget = "bzImage";
# Currently ignored - it should be set according to 'system' once it is
# not ignored. This is for stdenv-updates.
kernelArch = "i386";
kernelExtraConfig =
''
# Virtualisation (KVM, Xen...).
Expand All @@ -24,7 +21,15 @@ rec {
'';
};

pc_simplekernel = pc // {
pc64 = pcBase // { kernelArch = "x86_64"; };

pc32 = pcBase // { kernelArch = "i386"; };

pc32_simplekernel = pc32 // {
kernelAutoModules = false;
};

pc64_simplekernel = pc64 // {
kernelAutoModules = false;
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/release-cross.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ let
arch = "i586";
float = "hard";
withTLS = true;
platform = pkgs.platforms.pc;
platform = pkgs.platforms.pc32;
libc = "glibc";
openssl.system = "hurd-x86"; # Nix depends on OpenSSL.
};
Expand Down

0 comments on commit 1a75b6b

Please sign in to comment.