Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

busybox: init: post update script hook #7671

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

antonlacon
Copy link
Contributor

@antonlacon antonlacon commented Mar 19, 2023

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?

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants