armbian / build

Armbian Linux build framework generates custom Debian or Ubuntu image for x86, aarch64, riscv64 & armhf
https://www.armbian.com
GNU General Public License v2.0
4k stars 2.25k forks source link

`USERPATCHES_PATH` customization and inconsistency across the framework #7091

Open EvilOlaf opened 1 month ago

EvilOlaf commented 1 month ago

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

github-actions[bot] commented 1 month ago

Jira ticket: AR-2468

pavlot-scriptec commented 3 weeks ago

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