[OpenWrt-Devel] sysupgrade: extending firmware validation

Rafał Miłecki zajec5 at gmail.com
Mon Jun 24 11:05:50 EDT 2019


On 19.06.2019 16:07, Rafał Miłecki wrote:
> My question is: what do you find the best way of implementing it?

Today IRC chat log for a reference:

[12:21] <rmilecki> guys, would you check my "sysupgrade: extending firmware validation" e-mail?
[12:21] <rmilecki> jow: that possibly affects LuCI
[12:21] <rmilecki> blogic: you like designing things, maybe check that one?
[12:23] <blogic> rmilecki: lets have a look right now
[12:25] <blogic> rmilecki: sysupgrade is already triggered from procd
[12:26] <blogic> so the sysupgrade shell foo could gain a helper that you pass a result which gets sent out to procd via ubus
[12:26] <blogic> the flash process would need to be split into check and flash
[12:26] <blogic> ad procd would call them separatley
[12:26] * rmilecki is thinking
[12:26] <blogic> and if the first return !0 then it just does not start 2/ramfs and waits for the result json
[12:27] <blogic> and when the result json is there we could provide it on ubus
[12:27] <blogic> that way you can throw anything into the json, procd would just memcpy the blob and have a sysupgrade.status or similar ubus method
[12:27] <blogic> as for signing ....
[12:27] <KanjiMonster> doesn't sysupgrade already have a check only command/option?
[12:28] <rmilecki> sysupgrade -T /tmp/foo.img
[12:28] <blogic> KanjiMonster: it does but not via ubus/procd i think
[12:28] <rmilecki> it's 0/1 result
[12:28] <blogic> KanjiMonster: it requires the luci-helper thingy
[12:31] <rmilecki> sorry, i'll need more explaning there, starting with the: "so the sysupgrade shell foo could gain a helper that you pass a result which gets sent out to procd via ubus"
[12:31] <rmilecki> do you want a a new call like "/sbin/sysupgrade foo /tmp/file" that calls "ubus call procd something"?
[12:35] <blogic>  /sbin/sysupgrade needs a new function inside that gets called from the platform_check_image()
[12:37] <rmilecki> and that new function should call ubus? or print JSON?
[12:39] <blogic> sysupgrae_check_result() or whatever that send the reason via ubus to procd
[12:39] <blogic> so that each target can be upgraded to this new image check code
[12:39] <blogic> if the check_image fails the target just calls that helper
[12:39] <blogic> and procd puts the result into ubus as a call the webui can do
[12:41] <rmilecki> ok, I think I got the idea, thanks!
[12:42] <rmilecki> i'll try to implement it piece by piece and see how it goes

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list