summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-07-04 01:50:37 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-07-04 15:13:29 +0300
commit55aecd308eff773c7ee6ce754ed75fcf69bde133 (patch)
tree71fe0a1cd3253a5d78c2946804486bbb297a74e9 /pkgs/os-specific
parent44955a73b20a57526c7bf7e7a0e900f1a4a82f0f (diff)
downloadnixlib-55aecd308eff773c7ee6ce754ed75fcf69bde133.tar
nixlib-55aecd308eff773c7ee6ce754ed75fcf69bde133.tar.gz
nixlib-55aecd308eff773c7ee6ce754ed75fcf69bde133.tar.bz2
nixlib-55aecd308eff773c7ee6ce754ed75fcf69bde133.tar.lz
nixlib-55aecd308eff773c7ee6ce754ed75fcf69bde133.tar.xz
nixlib-55aecd308eff773c7ee6ce754ed75fcf69bde133.tar.zst
nixlib-55aecd308eff773c7ee6ce754ed75fcf69bde133.zip
linux-rpi: 4.1.20-XXX -> 4.4.13-1.20160620-1
- Add a patch to unset CONFIG_LOCALVERSION in the v7 build.
- Copy all the device trees to match the upstream names so U-Boot can
  find them. (This is a hack.)
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel/linux-rpi.nix50
1 files changed, 38 insertions, 12 deletions
diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix
index 777662718af6..a069e7606ccc 100644
--- a/pkgs/os-specific/linux/kernel/linux-rpi.nix
+++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix
@@ -1,21 +1,47 @@
-{ stdenv, fetchurl, perl, buildLinux, ... } @ args:
+{ stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args:
 
 let
+  modDirVersion = "4.4.13";
+  tag = "1.20160620-1";
+in
+stdenv.lib.overrideDerivation (import ./generic.nix (args // rec {
+  version = "${modDirVersion}-${tag}";
+  inherit modDirVersion;
 
-  rev = "f4b20d47d7df7927967fcd524324b145cfc9e2f9";
-
-in import ./generic.nix (args // rec {
-  version = "4.1.y-${rev}";
-
-  modDirVersion = "4.1.20-v7";
-
-  src = fetchurl {
-    url = "https://api.github.com/repos/raspberrypi/linux/tarball/${rev}";
-    name = "linux-raspberrypi-${version}.tar.gz";
-    sha256 = "0x17hlbi7lpmmnp24dnkync5gzj57j84j0nlrcv1lv9fahjkqsm2";
+  src = fetchFromGitHub {
+    owner = "raspberrypi";
+    repo = "linux";
+    rev = "raspberrypi-kernel_${tag}";
+    sha256 = "0bydlzmd9mar07j6dihhzn1xm6vpn92y33vf1qsdkl3hjil6brfc";
   };
 
   features.iwlwifi = true;
 
   extraMeta.hydraPlatforms = [];
+})) (oldAttrs: {
+  postConfigure = ''
+    # The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
+    sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
+  '';
+
+  postFixup = ''
+    # Make copies of the DTBs so that U-Boot finds them, as it is looking for the upstream names.
+    # This is ugly as heck.
+    copyDTB() {
+      if [ -f "$out/dtbs/$1" ]; then
+        cp -v "$out/dtbs/$1" "$out/dtbs/$2"
+      fi
+    }
+
+    # I am not sure if all of these are correct...
+    copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
+    copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
+    copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
+    copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb
+    copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb
+    copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb
+    copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb
+    copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb
+    copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb
+  '';
 })