Sprinkle some custom hooks in multiple key moments during build. #2799
Conversation
|
@rpardini this is awesome... Please confirm my understanding... The changes are all Conditionals checking for the existence of additional functions in a user patches file and not overriding/replacing existing functions correct? Requested Changes: If the functions the new code is checking for all reside in Could you modify example and create it as a template here, and assure all the possible functions are listed, and clearly documented above them? Extra Credit: Once merged, I'll do my best to update the documentation from your example, but if you'd like to add additional documentation here It would be greatly appreciated. |
d526427
to
20e90e1
These allow for more substantial changes to the build in a custom configuration (userpatches/config-xxx.sh), without having to change Armbian sources. Some possible uses: - Override family-set values without changing family/include - Copy kernel-headers .deb to rootfs, but don't install it - Dynamic calculation of image size - Capturing the rootfs as an e2image dump for fast flashing - Replacing the onboarding process (eg, with cloud-init) - Preconfiguring zram, zswap Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
20e90e1
to
fa82077
|
@lanefu thanks for the review. |
|
Closing this in favor of #2807 - a more complex implemention of this that should address most of the questions raised here. |
These allow for more substantial changes to the build in a custom configuration (
userpatches/config-xxx.conf), without having to change Armbian sources. Essentially it allows for more customization points (using functions). It should be safe, eg, every hook point tests for the existence of the hook function before calling it.Having written those around 6 months ago and having done countless rebasing, I'm trying to offload them unto upstream.
Some possible uses:
cloud-init)Signed-off-by: Ricardo Pardini ricardo@pardini.net
Examples of usage
Mostly a mess, but some examples of usage can be seen on https://github.com/rpardini/armbian-build/tree/rpardini-stable/userpatches - for example:
It uses a naive/hardcoded "fragment" composition using function calls, but this will soon be replaced by a module/fragment auto-aggregator (since bash lends itself so well to this kind of thing ;-) )
This is most definitely not ready for merging yet -- probably not even for review.
Hope this is enough to warrant a merge, thanks