pkgs/openwrt-images: add support for legacy devices
This commit is contained in:
parent
d54bb4f871
commit
7a00fd74cf
|
@ -810,7 +810,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
location = "B 4.08";
|
location = "B 4.08";
|
||||||
model = "tl-wr1043n-v5";
|
model = "tplink_tl-wr1043n-v5";
|
||||||
role = "ap";
|
role = "ap";
|
||||||
wifi = {
|
wifi = {
|
||||||
"platform/qca956x_wmac" = {
|
"platform/qca956x_wmac" = {
|
||||||
|
|
|
@ -68,11 +68,11 @@
|
||||||
"openwrt": "openwrt_2"
|
"openwrt": "openwrt_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1651184984,
|
"lastModified": 1651275086,
|
||||||
"narHash": "sha256-i6yHFo0isdKtG4hsMwo6rhoqJ/zvnDNX0d+W2ola1vs=",
|
"narHash": "sha256-HM0xBxcg7V4YXwXs//I1GJQJrIQ1jHMmY3zsYPsgRBY=",
|
||||||
"owner": "astro",
|
"owner": "astro",
|
||||||
"repo": "nix-openwrt-imagebuilder",
|
"repo": "nix-openwrt-imagebuilder",
|
||||||
"rev": "2087eb5f0cd68e15284550124b905105e9ad2ef5",
|
"rev": "34afaff593f10de376e50f2e02f61cb2d93e648e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -98,11 +98,35 @@ let
|
||||||
in
|
in
|
||||||
builtins.foldl' (images: hostName:
|
builtins.foldl' (images: hostName:
|
||||||
let
|
let
|
||||||
hostConfig = config.site.hosts.${hostName};
|
inherit (config.site.hosts.${hostName}) model;
|
||||||
matches = profiles.identifyProfiles hostConfig.model;
|
matches = profiles.identifyProfiles model;
|
||||||
|
fallbackProfile =
|
||||||
|
if model == "dir-615-d"
|
||||||
|
then (openwrt-imagebuilder.lib.profiles {
|
||||||
|
inherit pkgs;
|
||||||
|
release = "19.07.10";
|
||||||
|
}).identifyProfile model
|
||||||
|
else if builtins.match "tl-wr.*" model != null
|
||||||
|
then {
|
||||||
|
release = "18.06.9";
|
||||||
|
packagesArch = "mips_24kc";
|
||||||
|
target = "ar71xx";
|
||||||
|
variant = "tiny";
|
||||||
|
profile = model;
|
||||||
|
sha256 = "109a2557gwmgib7r500qn9ygd8j4r4cv5jl5rpn9vczsm4ilkc1z";
|
||||||
|
feedsSha256 = {
|
||||||
|
base = "0xklqsk6d5d6bai0ry2hzfjr4sycf6241ihv8v1lmmf9r7d47cr1";
|
||||||
|
packages = "05g048saibh304ndnlczyq92b1c67c3cqvbhdamw1xqbsp6jzifp";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else null;
|
||||||
in
|
in
|
||||||
if matches == []
|
if matches == [] && fallbackProfile != null
|
||||||
then builtins.trace "${hostName} (${hostConfig.model}) not supported by OpenWRT"
|
then images // {
|
||||||
|
"${hostName}-image" = build fallbackProfile;
|
||||||
|
}
|
||||||
|
else if matches == []
|
||||||
|
then builtins.trace "${hostName} (${model}) not supported by OpenWRT"
|
||||||
images
|
images
|
||||||
else if builtins.length matches == 1
|
else if builtins.length matches == 1
|
||||||
then
|
then
|
||||||
|
@ -111,7 +135,7 @@ let
|
||||||
builtins.elemAt matches 0
|
builtins.elemAt matches 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else builtins.trace "${hostName} (${hostConfig.model}) has multiple models!"
|
else builtins.trace "${hostName} (${model}) has multiple models!"
|
||||||
images // {
|
images // {
|
||||||
"${hostName}-image" = build (
|
"${hostName}-image" = build (
|
||||||
builtins.elemAt matches 0
|
builtins.elemAt matches 0
|
||||||
|
|
Loading…
Reference in New Issue