Closed aparcar closed 4 years ago
Why use tmp/.targetinfo as another source when the json files are supposed to be available as well?
As for splitting up the data in a quick to load json - that might be a good idea. But I like to keep things simple and the current size of the data does not seem to require this (the data.json is only <40KB compressed for three releases). Maybe we can make it possible to use both approaches without adding much complexity.
Your proposed format is ok, but we would need to extend that to cover different releases. How about this then? And the data would be extracted from the json files instead.
{
"19.07.1": {
"commit": "r10911-c155900f66",
"download_link": "https://downloads.openwrt.org/releases/%release/targets/%target/%file",
"json_link": "https://downloads.openwrt.org/releases/%release/targets/%target/%id.json",
"models": {
"FriendlyARM NanoPi NEO2": {
"target": "sunxi/cortexa53",
"id": "friendlyarm_nanopi-neo2"
},
"Pine64 Pine64+": {
"target": "sunxi/cortexa53",
"id": "pine64_pine64-plus"
}
}
}
}
download_link
is for the images to download. json_link
would be for the json files.
Also, as an alternative, all images data can be embedded into "models" instead of using the json_link
.
Why use tmp/.targetinfo as another source when the json files are supposed to be available as well?
Using targetinfo allows you to get all available models without building all. When you want to parse the online JSON files, then you also have to download about 1500 json files with details to get the model names.
However it has the disadvantage that we need to do this for every distro version we want to support. So run <script>.py
for master, 19.07, etc ...
The JSON files would actually be called %distro-%version-%target-%profile.json
, where %version
is skipped on master builds and %target
uses -
instead of /
.
EDIT: 19.07.x does not yet offer any JSON files, therefore it can't really be supported, what do you think?
@aparcar I am more or less finished with the restructuring. But
Hm, but when I would define something like %maintarget-$subtarget in the link, and $subtarget is empty, then the link would break, because the - would not supposed to be there.
@aparcar I changed the json format to something yet simpler. Feel free to submit a PR to change it.. :-)
I created a script that uses the
tmp/.targetinfo
file to generate a file callednames.json
looking like below. This could be used to load specific device information on demand instead of all together. Usingtarget
andid
can be combined as{ release }/{ target }/{ id }.json
.Would you be willing to change the current script to that?