2023-03-18 20:17:58 +01:00
|
|
|
{
|
|
|
|
fetchFromGitHub
|
|
|
|
, writeShellScript
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
name = "openwrt-source";
|
|
|
|
repo = "openwrt";
|
|
|
|
owner = "openwrt";
|
|
|
|
rev = "a5265497a4f6da158e95d6a450cb2cb6dc085cab";
|
|
|
|
hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8=";
|
|
|
|
};
|
2023-03-19 10:55:39 +01:00
|
|
|
doPatch = family : ''
|
2023-03-18 20:17:58 +01:00
|
|
|
cp -av ${src}/target/linux/generic/files/* .
|
|
|
|
chmod -R u+w .
|
2023-03-19 10:55:39 +01:00
|
|
|
cp -av ${src}/target/linux/${family}/files/* .
|
2023-03-18 20:17:58 +01:00
|
|
|
chmod -R u+w .
|
|
|
|
patches() {
|
|
|
|
for i in $* ; do patch --batch --forward -p1 < $i ;done
|
|
|
|
}
|
|
|
|
patches ${src}/target/linux/generic/backport-5.15/*.patch
|
|
|
|
patches ${src}/target/linux/generic/pending-5.15/*.patch
|
|
|
|
patches ${src}/target/linux/generic/hack-5.15/*.patch
|
2023-03-19 10:55:39 +01:00
|
|
|
patches ${src}/target/linux/${family}/patches-5.15/*.patch
|
2023-03-18 20:17:58 +01:00
|
|
|
'';
|
2023-03-19 10:55:39 +01:00
|
|
|
in {
|
|
|
|
inherit src;
|
|
|
|
applyPatches.ath79 = doPatch "ath79";
|
|
|
|
applyPatches.ramips = doPatch "ramips";
|
2023-03-18 20:17:58 +01:00
|
|
|
}
|