build icon indicating copy to clipboard operation
build copied to clipboard

`USERPATCHES_PATH` customization and inconsistency across the framework

Open EvilOlaf opened this issue 1 year ago • 2 comments

By chance I was thinking about organizing various custom configurations I thought about having multiple directories for userpatches and define one of these at runtime.

From what I've seen the path seems to be set here: https://github.com/armbian/build/blob/134ae2964685f685fff8c19c2ef3fa6c29819f08/lib/functions/cli/entrypoint.sh#L87 and from there going forward the path should be stored in $USERPATCHES_PATH variable, right?

However search simply for userpatches reveals that on several occasions the path seems to be hard-coded (list incomplete): https://github.com/armbian/build/blob/134ae2964685f685fff8c19c2ef3fa6c29819f08/lib/functions/cli/utils-cli.sh#L147 https://github.com/armbian/build/blob/134ae2964685f685fff8c19c2ef3fa6c29819f08/extensions/gen-sample-extension-docs.sh#L13 https://github.com/armbian/build/blob/134ae2964685f685fff8c19c2ef3fa6c29819f08/lib/functions/host/docker.sh#L572

So the question is am I wrong here for some reason? Is this intended? Should the path be stored in a variable everywhere? Should the patch possible be customizable? Like ./compile.sh BOARD=asdf USERPATCHES_PATH=asdf MyConfigInAsdf

EvilOlaf avatar Aug 15 '24 04:08 EvilOlaf

Jira ticket: AR-2468

github-actions[bot] avatar Aug 15 '24 04:08 github-actions[bot]

Some time ago, I already raised this issue: https://github.com/armbian/build/issues/4118. (sorry, now I'm writing from work account)

But after some re-thinking extensions looks more promising for me. They can be placed to existing user_patches directory as a separate git repository. So you can develop and track changes for them separately from Armbian sources.

Another killer feature - extensions have hooks. This allow you to prioritize code execution and call required code at different stages of build process.

I have prepared article how extensions could be used: https://github.com/pavlot-scriptec/scriptec-blog/blob/main/customize_armbian_image_using_extensions.md.

If you have any questions feel free to contact

pavlot-scriptec avatar Aug 26 '24 16:08 pavlot-scriptec