Add a new architecture to postmarketOS
If you would like to port to a device architecture, that is supported by Alpine, but not by postmarketOS, you can bootstrap the architecture in pmOS with the following steps. As usually, please correct this manual if you find errors or outdated information in it.
1. To avoid querying the pmOS repos for the new architecture and therefore failing, run: pmbootstrap config mirrors.pmaports none
and pmbootstrap config mirrors.systemd none
2. Add the architecture to build_device_architectures
in pmb/core/arch.py
and add it to the test cases in pmb/core/test_arch.py
.
3. Create aports for cross compilation (replace armhf
with your new architecture):
$ pmbootstrap aportgen gcc-armhf musl-armhf
4. Try to build one package for the new architecture. pmbootstrap will build necessary packages first, such as the cross compiler. If you get any Python errors, you might need to adjust architecture mappings in pmb/core/arch.py
.
$ pmbootstrap build hello-world --arch=armhf
5. Build your device's linux-... package.
$ pmbootstrap build linux-samsung-i9100
6. Do a full installation:
$ pmbootstrap install
If everything worked out, please make one separate merge request to add the new architecture and mention there which device you have ported. After that merge request is through, make another one for the device.