Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomPiOS v2 - suport for meta modules and remote modules #221

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

guysoft
Copy link
Owner

@guysoft guysoft commented Jul 12, 2024

Related issue #214

Features

In the docker container of CustomPiOS you can now use:

Download flag

build -d

To download the latest tested image automatically.

Board flag

build --board list

To list available boards.

Then:

build -d -b [board]

for example:

build -d -b raspberrypiarm64

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:

base(octopi)

Could be turned by a meta file that prints out:

base(armbian(octopi))

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 variable

The 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:

pip install git+https://github.com/guysoft/custompios.git@feature/meta-modules

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

@guysoft guysoft self-assigned this Jul 12, 2024
@guysoft guysoft changed the title CustomPiOS v2 - suport for CustomPiOS v2 - suport for meta modules and remote modules Jul 12, 2024
@guysoft guysoft force-pushed the feature/meta-modules branch 2 times, most recently from 1381661 to af3bd56 Compare July 22, 2024 19:43
@guysoft guysoft merged commit 9e27240 into devel Oct 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant