From 1c7fc46ee574aa4d173cc321d81887a95fd5b5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 20 Feb 2015 13:39:35 +0000 Subject: [PATCH 01/11] Adding the raspberrypi2 platform. --- pkgs/top-level/platforms.nix | 87 ++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index 20cc39692c0b..e032a383e468 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -212,6 +212,93 @@ rec { }; }; + raspberrypi2 = { + name = "raspberrypi2"; + kernelMajor = "3.14"; + kernelHeadersBaseConfig = "kirkwood_defconfig"; + kernelBaseConfig = "bcm2709_defconfig"; + kernelArch = "arm"; + kernelDTB = true; + kernelAutoModules = false; + kernelExtraConfig = + '' + BLK_DEV_RAM y + BLK_DEV_INITRD y + BLK_DEV_CRYPTOLOOP m + BLK_DEV_DM m + DM_CRYPT m + MD y + REISERFS_FS m + BTRFS_FS y + XFS_FS m + JFS_FS y + EXT4_FS y + + IP_PNP y + IP_PNP_DHCP y + NFS_FS y + ROOT_NFS y + TUN m + NFS_V4 y + NFS_V4_1 y + NFS_FSCACHE y + NFSD m + NFSD_V2_ACL y + NFSD_V3 y + NFSD_V3_ACL y + NFSD_V4 y + NETFILTER y + IP_NF_IPTABLES y + IP_NF_FILTER y + IP_NF_MATCH_ADDRTYPE y + IP_NF_TARGET_LOG y + IP_NF_MANGLE y + IPV6 m + VLAN_8021Q m + + CIFS y + CIFS_XATTR y + CIFS_POSIX y + CIFS_FSCACHE y + CIFS_ACL y + + ZRAM m + + # Fail to build + DRM n + SCSI_ADVANSYS n + USB_ISP1362_HCD n + SND_SOC n + SND_ALI5451 n + FB_SAVAGE n + SCSI_NSP32 n + ATA_SFF n + SUNGEM n + IRDA n + ATM_HE n + SCSI_ACARD n + BLK_DEV_CMD640_ENHANCED n + + FUSE_FS m + + # nixos mounts some cgroup + CGROUPS y + + # Latencytop + LATENCYTOP y + + # Disable the common config Xen, it doesn't build on ARM + XEN? n + ''; + kernelTarget = "zImage"; + uboot = null; + gcc = { + cpu = "cortex-a7"; + fpu = "neon-vfpv4"; + float = "hard"; + }; + }; + guruplug = sheevaplug // { # Define `CONFIG_MACH_GURUPLUG' (see # ) From 56989d9f2034d175c206e7fb166e4c5f07997d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 20 Feb 2015 13:40:23 +0000 Subject: [PATCH 02/11] Updating the raspberry pi kernel sources to recent, for pi2 --- .../linux/kernel/{linux-rpi-3.6.nix => linux-rpi.nix} | 8 +++++--- pkgs/top-level/all-packages.nix | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) rename pkgs/os-specific/linux/kernel/{linux-rpi-3.6.nix => linux-rpi.nix} (61%) diff --git a/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix similarity index 61% rename from pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix rename to pkgs/os-specific/linux/kernel/linux-rpi.nix index 6d28c376078d..67a51dc767df 100644 --- a/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix +++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix @@ -2,15 +2,17 @@ let - rev = "7849605f5a"; + rev = "fe4a83540ec73dfc298f16f027277355470ea9a0"; in import ./generic.nix (args // rec { - version = "3.6.y-${rev}"; + version = "3.18.y-${rev}"; + + modDirVersion = "3.18.7-v7"; src = fetchurl { url = "https://api.github.com/repos/raspberrypi/linux/tarball/${rev}"; name = "linux-raspberrypi-${version}.tar.gz"; - sha256 = "1diwc5p6az6ipcldwmkq7hb5f15nvdgwzmypixc2vmzmc4ylarxl"; + sha256 = "05gq40f038hxjqd3sdb1914g2bzw533dyxy59sgdpybs8801x2vb"; }; features.iwlwifi = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 68e59d038fae..8d1d94890ebd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8758,7 +8758,7 @@ let ]; }; - linux_3_6_rpi = makeOverridable (import ../os-specific/linux/kernel/linux-rpi-3.6.nix) { + linux_rpi = makeOverridable (import ../os-specific/linux/kernel/linux-rpi.nix) { inherit fetchurl stdenv perl buildLinux; kernelPatches = [ kernelPatches.bridge_stp_helper ]; }; @@ -8978,7 +8978,7 @@ let # Build the kernel modules for the some of the kernels. linuxPackages_3_2 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2 linuxPackages_3_2); linuxPackages_3_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_4 linuxPackages_3_4); - linuxPackages_3_6_rpi = linuxPackagesFor pkgs.linux_3_6_rpi linuxPackages_3_6_rpi; + linuxPackages_rpi = linuxPackagesFor pkgs.linux_rpi linuxPackages_rpi; linuxPackages_3_10 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_10 linuxPackages_3_10); linuxPackages_3_10_tuxonice = linuxPackagesFor pkgs.linux_3_10_tuxonice linuxPackages_3_10_tuxonice; linuxPackages_3_12 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_12 linuxPackages_3_12); From 3e92c4e0ffd26949ea73dafb02eddbf245f80e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 20 Feb 2015 13:40:58 +0000 Subject: [PATCH 03/11] Trying to make DTBs if set in platform. --- pkgs/os-specific/linux/kernel/manual-config.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 6d9baed7f2dd..cfbd9b9774f7 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -120,7 +120,12 @@ let postInstall = optionalString installsFirmware '' mkdir -p $out/lib/firmware - '' + (if isModular then '' + '' + (if (platform ? kernelDTB && platform.kernelDTB) then '' + set -x + make dtbs + cp arch/$arch/boot/dts/*dtb $out + '' else "") + (if isModular then '' + set -x make modules_install $makeFlags "''${makeFlagsArray[@]}" \ $installFlags "''${installFlagsArray[@]}" unlink $out/lib/modules/${modDirVersion}/build From 42c6115872c6d1ec471605006e258daaca1ceee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 20 Feb 2015 21:54:05 +0000 Subject: [PATCH 04/11] kernel: I forgot $makeFlags in make dtbs --- pkgs/os-specific/linux/kernel/manual-config.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index cfbd9b9774f7..7bc1de8ed0be 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -118,14 +118,12 @@ let # Some image types need special install targets (e.g. uImage is installed with make uinstall) installTargets = [ (if platform.kernelTarget == "uImage" then "uinstall" else "install") ]; - postInstall = optionalString installsFirmware '' + postInstall = (optionalString installsFirmware '' mkdir -p $out/lib/firmware - '' + (if (platform ? kernelDTB && platform.kernelDTB) then '' - set -x - make dtbs + '') + (if (platform ? kernelDTB && platform.kernelDTB) then '' + make "$makeFlags" dtbs cp arch/$arch/boot/dts/*dtb $out '' else "") + (if isModular then '' - set -x make modules_install $makeFlags "''${makeFlagsArray[@]}" \ $installFlags "''${installFlagsArray[@]}" unlink $out/lib/modules/${modDirVersion}/build From 31cccd88ed6fcaca86eb19dcee6d263909cbe829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 20 Feb 2015 22:26:11 +0000 Subject: [PATCH 05/11] kernel: Trying to fix makeflags of 'make dtbs' --- pkgs/os-specific/linux/kernel/manual-config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 7bc1de8ed0be..dd619993ff0e 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -121,7 +121,7 @@ let postInstall = (optionalString installsFirmware '' mkdir -p $out/lib/firmware '') + (if (platform ? kernelDTB && platform.kernelDTB) then '' - make "$makeFlags" dtbs + make $makeFlags "''${makeFlagsArray[@]}" dtbs cp arch/$arch/boot/dts/*dtb $out '' else "") + (if isModular then '' make modules_install $makeFlags "''${makeFlagsArray[@]}" \ From cfd9b77e82c6a4224b74215c7c0504014d83aa39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sat, 21 Feb 2015 19:01:17 +0000 Subject: [PATCH 06/11] kernel: I hope to fix the dtbs thing I thought $arch was defined. Now I'm using karch, that should serve for cross building as well. --- pkgs/os-specific/linux/kernel/manual-config.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index dd619993ff0e..ea29c7f9e0c8 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -122,7 +122,7 @@ let mkdir -p $out/lib/firmware '') + (if (platform ? kernelDTB && platform.kernelDTB) then '' make $makeFlags "''${makeFlagsArray[@]}" dtbs - cp arch/$arch/boot/dts/*dtb $out + cp $buildRoot/arch/$karch/boot/dts/*dtb $out '' else "") + (if isModular then '' make modules_install $makeFlags "''${makeFlagsArray[@]}" \ $installFlags "''${installFlagsArray[@]}" @@ -225,6 +225,8 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe "ARCH=${stdenv.platform.kernelArch}" ]; + karch = stdenv.platform.kernelArch; + crossAttrs = let cp = stdenv.cross.platform; in (drvAttrs crossConfig cp (kernelPatches ++ crossKernelPatches) crossConfigfile) // { makeFlags = commonMakeFlags ++ [ @@ -232,6 +234,8 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe "CROSS_COMPILE=$(crossConfig)-" ]; + karch = cp.kernelArch; + # !!! uboot has messed up cross-compiling, nativeDrv builds arm tools on x86, # crossDrv builds x86 tools on x86 (but arm uboot). If this is fixed, uboot # can just go into buildInputs (but not nativeBuildInputs since cp.uboot From c1b803ba0ea9402ef8f4264896691d04c8167ec7 Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Sat, 21 Feb 2015 22:29:40 +0000 Subject: [PATCH 07/11] Cut down on the gcc flags for raspberrypi2. --- pkgs/top-level/platforms.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index e032a383e468..ae9b702b442c 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -293,8 +293,8 @@ rec { kernelTarget = "zImage"; uboot = null; gcc = { - cpu = "cortex-a7"; - fpu = "neon-vfpv4"; + arch = "armv7-a"; + fpu = "vfpv3-d16"; float = "hard"; }; }; From 9d8c26efaef7900f2658ba5695cee15334f6f649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 5 Mar 2015 10:00:21 +0000 Subject: [PATCH 08/11] Add comment explaining the rpi2 gcc flags. --- pkgs/top-level/platforms.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix index ae9b702b442c..8bdc4f77302c 100644 --- a/pkgs/top-level/platforms.nix +++ b/pkgs/top-level/platforms.nix @@ -293,6 +293,11 @@ rec { kernelTarget = "zImage"; uboot = null; gcc = { + # For gcc 4.8, the best for rpi2 would be: + # cpu = "cortex-a7"; + # fpu = "neon-vfpv4"; + # But we prefer compatibility with the beaglebone, so both + # can run the same built store paths. arch = "armv7-a"; fpu = "vfpv3-d16"; float = "hard"; From e47afb3601f56dc9ed9594a842638ef5bd5ab01c Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Sat, 28 Feb 2015 14:49:39 +0000 Subject: [PATCH 09/11] spidermonkey-17: Disable test which fails on ARM. (cherry picked from commit b90dca35aac458953182b4e1ad725c9466d11a66) --- pkgs/development/interpreters/spidermonkey/17.0.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/spidermonkey/17.0.nix b/pkgs/development/interpreters/spidermonkey/17.0.nix index fc4546bc09e2..53b2e4072ade 100644 --- a/pkgs/development/interpreters/spidermonkey/17.0.nix +++ b/pkgs/development/interpreters/spidermonkey/17.0.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, nspr, perl, python, zip }: +{ stdenv, fetchurl, pkgconfig, nspr, perl, python, zip, bash }: stdenv.mkDerivation rec { version = "17.0.0"; @@ -31,6 +31,10 @@ stdenv.mkDerivation rec { preCheck = '' rm jit-test/tests/sunspider/check-date-format-tofte.js # https://bugzil.la/600522 + # Test broken on ARM. Fedora disables it. + # https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130617/1041155.html + echo -e '#!${bash}/bin/bash\nexit 0' > config/find_vanilla_new_calls + paxmark m shell/js17 paxmark mr jsapi-tests/jsapi-tests ''; From 5f76d088654e12404457185288af791642121b7f Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Sat, 28 Feb 2015 18:32:01 +0000 Subject: [PATCH 10/11] polkit: Use spidermonkey-17. The old version doesn't build for ARMv7. (cherry picked from commit 5fe72cafffb22749520dd03a18bb862a37cca8b3) --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8d1d94890ebd..43478a70ca1e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7057,7 +7057,7 @@ let poker-eval = callPackage ../development/libraries/poker-eval { }; polkit = callPackage ../development/libraries/polkit { - spidermonkey = spidermonkey_185; + spidermonkey = spidermonkey_17; }; polkit_qt4 = callPackage ../development/libraries/polkit-qt-1 { From 0f4a9a58d8a9dec4a1cf10f0e9f04f075aaa5671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 6 Mar 2015 14:34:26 +0000 Subject: [PATCH 11/11] Avoid bash arg in Spidermonkey 17 --- pkgs/development/interpreters/spidermonkey/17.0.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/spidermonkey/17.0.nix b/pkgs/development/interpreters/spidermonkey/17.0.nix index 53b2e4072ade..74f0fe2b83a4 100644 --- a/pkgs/development/interpreters/spidermonkey/17.0.nix +++ b/pkgs/development/interpreters/spidermonkey/17.0.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, nspr, perl, python, zip, bash }: +{ stdenv, fetchurl, pkgconfig, nspr, perl, python, zip }: stdenv.mkDerivation rec { version = "17.0.0"; @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { # Test broken on ARM. Fedora disables it. # https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130617/1041155.html - echo -e '#!${bash}/bin/bash\nexit 0' > config/find_vanilla_new_calls + echo -e '#!${stdenv.shell}\nexit 0' > config/find_vanilla_new_calls paxmark m shell/js17 paxmark mr jsapi-tests/jsapi-tests