liminix

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

default.nix (1410B)


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