contrib: add image customization generation script#3358
contrib: add image customization generation script#3358maurerle wants to merge 3 commits intofreifunk-gluon:mainfrom
Conversation
|
Interesting. Do you have an example regarding how you use the image-customization-helper.lua in a site's image-customization.lua? Could this toh.json also be used to simplify package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua? If this were added to the main repository would refreshing of the image-customization-helper.lua also need to be added to the device integration checklist? I'm also wondering if it were possible to avoid having to refresh and recommit the image-customization-helper.lua. (maybe just generate image-customization-helper.lua during a "make update" and don't add it to Git? Write it to ./gluon/tmp/ or ./gluon/output/? Or at least somewhere that's in a .gitignore. And make the result available to image-customization.lua that doesn't require explicitly including the helper file?) |
|
Hi @T-X,
my current (but untested) commit to this is ffac/site@89d627d which makes the idea clear.
as said by @neocturne the platform.lua uses a different format (for example requires to have Furthermore, my current approach using the device id fails for some devices as well (for example for the
yes, that would be the case (and making sure that the data is correct in the toh, which is cumbersome, as I heard that the openwrt wiki was separated from the development by intention, so I don't think it is helpful to tie these together here.
automatic generation adds a side effect to the build process which might cause weird problems "package x does not include y anymore" - "oh someone edited the wiki" or "build failed, openwrt was down" and especially for building older releases it is required to have the matching helper.lua at hand, so I am quite sure this should be added to the VCS and updated manually. |
21b0165 to
a5f18e5
Compare
|
The following 116 models do not have a matching device id in openwrt wiki: Without matching Device IDThe following 172 supported devices have a matching id: With matching Device IDI am currently mapping this using a custom device_mapping like this: # mapping from openwrt device_id to gluon name
device_mappings = {
"ubiquiti-unifi-uk-ultra": "ubiquiti-unifi-swiss-army-knife-ultra",
"ubiquiti-unifi-outdoorplus": "ubiquiti-unifi-ap-outdoor+",
"ubiquiti-unifi-ac-mesh-pro" : "",
"ubiquiti-unifi-ac-mesh": "ubiquiti-unifi-ac-mesh-pro",
"openwrt-one-1": "openwrt-one",
"linksys-e8450": "linksys-e8450-ubi",
"zyxel-nbg6716-a01": "zyxel-nbg6716",
"cudy-x6": "cudy-x6-v1",
"sophos-ap100-rev-1": "sophos-ap100",
"sophos-ap100c-rev-1": "sophos-ap100c",
"sophos-ap55-rev-1": "sophos-ap55",
"sophos-ap55c-rev-1": "sophos-ap55c",
}but this is of course one of the drawbacks of this approach. Correctly receiving the toh.json automatically became much worse due to crawlers, as the service responds with 5xx if queried very soon again. So one has to wait at least ~10-30s before requesting the toh.json again. |
a5f18e5 to
6ddb9a8
Compare
6ddb9a8 to
1ef7896
Compare
22df941 to
f9e2242
Compare
AiyionPrime
left a comment
There was a problem hiding this comment.
I mentioned it to @maurerle when we met in Brunswick a while ago, but apparently missed to leave that feedback here as well:
I'm opposed consumed unversioned wiki data into our build process.
And if I see it correctly the TOH is exactly that.
I have no proper counter solution; but I'd love to take the data from DTS files or similar where possible, instead.
this script creates the helper lua from the openwrt toh to be included in the image-customization.lua
… missing devices This adds a mapping of the device names from the openwrt toh name to the gluon names. Now all devices supported in gluon are correctly mapped to the toh entry.
f9e2242 to
4256487
Compare
this script creates the helper lua from the openwrt toh to be included in the image-customization.lua
closes #3316
supersedes #3143
Eventually, this should stay in community-packages or something less official, though I like that this properly depends on the wiki as well, making it easier to correct things for anyone.
I was made aware of the toh.json through this TOH viewer for Openwrt: https://github.com/soif/OpenWrtTOH/
which is now official at https://toh.openwrt.org