liminix

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

default.nix (1429B)


      1 {
      2   fetchFromGitHub
      3 , writeShellScript
      4 }:
      5 let
      6   src = fetchFromGitHub {
      7     name = "openwrt-source";
      8     repo = "openwrt";
      9     owner = "openwrt";
     10     rev = "refs/tags/v23.05.2";
     11     hash = "sha256-kP+cSOB6LiOMWs7g+ji7P7ehiDYDwRdmT4R5jSzw6K4=";
     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     test -d ${src}/target/linux/${family}/files-5.15/ && cp -av ${src}/target/linux/${family}/files-5.15/* .
     19     chmod -R u+w .
     20     patches() {
     21       for i in $* ; do patch --batch --forward -p1 < $i ;done
     22     }
     23     patches ${src}/target/linux/generic/backport-5.15/*.patch
     24     patches ${src}/target/linux/generic/pending-5.15/*.patch
     25     # This patch breaks passing the DTB to kexeced kernel, so let's
     26     # get rid of it. It's not needed anyway as we pass the cmdline
     27     # in the dtb
     28     patch --batch -p1 --reverse <  ${src}/target/linux/generic/pending-5.15/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch
     29     patches ${src}/target/linux/generic/hack-5.15/*.patch
     30     patches ${src}/target/linux/${family}/patches-5.15/*.patch
     31     patches ${./make-mtdsplit-jffs2-endian-agnostic.patch}
     32   '';
     33 in {
     34   inherit src;
     35   applyPatches.ath79 = doPatch "ath79";
     36   applyPatches.ramips = doPatch "ramips";
     37   applyPatches.mediatek = doPatch "mediatek"; # aarch64
     38   applyPatches.mvebu = doPatch "mvebu"; # arm
     39 }