LibreELEC.tv
LibreELEC.tv copied to clipboard
busybox: init: post update script hook
This adds a post-update hook to buysbox's init to run a script from the new image. I've chosen to insert it between the update finishing making its changes and cleaning up prior to reboot.
The script may be per project, device, or distro wide via busybox package scripts. I've chosen new/old VERSION_ID and DEVICE.ARCH as the needed exports for the script. This should be enough for where the device is coming from and where it's going to. These are exported because by the time the hook runs, the old image is no longer available to query.
The temp commit is just the demo script echo'ing the exported variables and putting in a sleep delay to see the output. Normally, the script will echo any output after the script completes (not during progress). It should be dropped before merge.
A reminder that two updates needs to happen to see changes: once to update init to have the call, and the second to then run a post-update script.
WIP: condense new/old project arch to one set of variables any other information from old image? other?