CustomPiOS v2 - suport for meta modules and remote modules #221
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue #214
Features
In the docker container of CustomPiOS you can now use:
Download flag
To download the latest tested image automatically.
Board flag
To list available boards.
Then:
for example:
Will download the latest image and build on Official Raspberrypi lite 64bit image
New Internals
These flags required some bigger changes under the hood:
The two major features are "meta modules" and "remote modules".
There are also new files to contain all the board configuration and remote modules configuration.
A small extra change is that all the python code has been moved in to a
custompios_core
module, and you could install it and use it for other projects too if you wish.What are meta modules?
There is a now "meta" file that could be added to the modules folder (for example). Which lets you change what modules are added, and add in sub modules based on if they are needed in a board.
Its an executable script that can hold any logic you like. It prints out the result to be used.
So for example:
Could be turned by a meta file that prints out:
What are remote modules?
You can have modules that are stored on other repositories, currently implemented only for git repositories. The modules would be downloaded and used at build time. They are saved in to a new cache folder at
CUSTOM_PI_OS_PATH/remotes
They are configured in this yaml file:
https://github.com/guysoft/CustomPiOS/blob/feature/meta-modules/src/modules_remote.yml
It should be possible to add a local yaml that a repo can add in their repository that would let you set extra modules per-repo.
images.yaml
Images configuration is stored in a file images.yml. Its used for the
--download
flag and also has special settings per-board.New
BASE_BOARD
variableThe way that the board information is passed across CustomPiOS is an environment variable the build
--board
flag passes.custompios_core python module
currently can be installed by:
Its mostly internals, but it does include code to download images, download remote modules. Calculate the modules execution order, etc.
More info about what mainsail are doing
Partly this started because I am trying to organize what Mainsail are doing here:
https://github.com/mainsail-crew/MainsailOS/blob/develop/config/orangepi/default#L26
Namely how we handle base for armbian and orangepi and other boards