ericwoud / buildR64arch

Build script for image for BananaPi R64 / R3 (R4) running Arch Linux
21 stars 5 forks source link

Add External Configuration #4

Closed gurudvlp closed 1 year ago

gurudvlp commented 1 year ago

Description

This pull request allows the use of an external configuration file for the build script's variables. After building several test images for the Banana Pi BPI-R3, it became apparent that I consistently installed additional packages, changed the timezone, and had to reset the default password. By sourcing an external config script, end users are able to have their own configuration while still falling back to default values.

This change includes:

Code Changes

The code changes in this pull request are exceedingly simple. There is an added check for the existence of 'config.sh', which if exists, is sourced. This is done after default values are set, so readability is not impaired, and anything not defined in 'config.sh' is still set with a sane default.

ericwoud commented 1 year ago

I had something very similar in the script before, but it was not really used. Can add it when I have some time available

I finally moved it a bit, so that config.sh can also contain ${target} and ${atfdevice}.

I did not include the example, as I like to keep things to a minimum.

Anyway, thanks for the input. I have also included in the rockchip version of the script.