liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (1162B)


      1 {
      2   fetchFromGitHub
      3 , writeShellScript
      4 }:
      5 let
      6   src = fetchFromGitHub {
      7     name = "openwrt-source";
      8     repo = "openwrt";
      9     owner = "openwrt";
     10     rev = "a5265497a4f6da158e95d6a450cb2cb6dc085cab";
     11     hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8=";
     12   };
     13   doPatch = family : ''
     14     cp -av ${src}/target/linux/generic/files/* .
     15     chmod -R u+w .
     16     cp -av ${src}/target/linux/${family}/files/* .
     17     chmod -R u+w .
     18     patches() {
     19       for i in $* ; do patch --batch --forward -p1 < $i ;done
     20     }
     21     patches ${src}/target/linux/generic/backport-5.15/*.patch
     22     patches ${src}/target/linux/generic/pending-5.15/*.patch
     23     # This patch breaks passing the DTB to kexeced kernel, so let's
     24     # get rid of it. It's not needed anyway as we pass the cmdline
     25     # in the dtb
     26     patch --batch -p1 --reverse <  ${src}/target/linux/generic/pending-5.15/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch
     27     patches ${src}/target/linux/generic/hack-5.15/*.patch
     28     patches ${src}/target/linux/${family}/patches-5.15/*.patch
     29   '';
     30 in {
     31   inherit src;
     32   applyPatches.ath79 = doPatch "ath79";
     33   applyPatches.ramips = doPatch "ramips";
     34 }