Thanks for taking the time to help our project out! Here you will find information that will help you contribute to Pocketblue
Pocketblue is an atomic system that relies on OCI, OSTree and Bootc technologies. System images are based on upstream atomic Fedora images (Silverblue/Kinoite) and are built and distributed as OCI containers.
Justfile- build recipesContainerfile- container definitioncommon/- common scripts and files for all imagesdevices/<device-name>/- device-specific scripts and files.../build-aux/- auxiliary device-specific data and scripts.../build-aux/device.conf- various device configuration options (see below)
desktops/<desktop-name>/- desktop-environment-specific scripts and filesbootc-image-builder.toml- bootc-image-builder config
Available options:
esp_size- ESP partition image sizeboot_size- boot partition image sizeinstall_dtb- boolean, whether to install device trees to ESPsplit_partitions- boolean, whether to splitdisk.rawimage to separatefedora_rootfs.raw,fedora_boot.raw, andfedora_esp.rawpartition images
You can build container images locally using Just and Buildah. The best practice is to build images directly on your target device if it already runs Linux. Cross-arch container builds via qemu are supported but will take much longer.
Build tools are preinstalled on Pocketblue. To install them on a different system:
sudo dnf install just buildahA typical example of a local build process:
# build the image:
just device=oneplus-sdm845 desktop=phosh tag=43-test rechunk_suffix=-build
# rechunk the image:
just device=oneplus-sdm845 desktop=phosh tag=43-test rechunk_suffix=-build rechunkThis will result in an image tagged localhost/oneplus-sdm845-phosh:43-test. To rebase to the newly built image:
just device=oneplus-sdm845 desktop=phosh tag=43-test rechunk_suffix=-build rebase
# alternatively, use a full ref:
just rebase localhost/oneplus-sdm845-phosh:43-test
# if you have already rebased to this image before:
sudo rpm-ostree upgradeSupported just parameters (all parameters are optional):
| Option | Description | Default |
|---|---|---|
| branch | Base Fedora release branch | 43 |
| tag | Tag of the resulting Pocketblue image | Same as branch |
| rechunk_suffix | A suffix appended to the resulting image tag, does not affect the image contents or build process. Useful for images that will be rechunked afterwards | |
| device | Device name (see devices/) |
oneplus-sdm845 |
| desktop | Desktop environment (see desktops/) |
phosh |
| base | Base image | Inferred from the desktop option |
| base_bootc | fedora-bootc image, used for rechunking | quay.io/fedora/fedora-bootc: + branch |
| registry | Container registry | localhost |
| expires_after | Tag expiration time, e.g. 1w | |
| arch | Architecture | arm64 |
Setup the repository:
- Fork the repository
- Create a classic Github personal access token: https://github.com/settings/tokens/new?scopes=write:packages
- Go to the settings of your fork repo and open the
Secrets and variables -> Actionssection - Add a repository secret with the name
REGISTRY_TOKENand value of your access token - Add two repository variables:
- name:
REGISTRY, value:ghcr.io/<github username> - name:
REGISTRY_USERNAME, value: your github username
- name:
You can now use Github Actions to build container images and disk images!
To add a new device, create a new subdirectory in devices/ with a device alias,
following the <vendor>-<codename> naming scheme.
The directory should contain:
- An executable script named
buildthat will perform all necessary modifications to the image (e.g. install the kernel and firmware, copy over the files, etc) build-aux/device.conffile containing the size of the EFI system partitionbuild-aux/artifacts.shscript to collect build artifacts of your device for further distributionfiles/directory with any additional files, e.g..repofiles for your copr repositories
If your device requires a custom kernel or firmware, you should publish them to Fedora COPR as RPM packages. See sm8150-rpms and sm8250-rpms for the example RPM specs.
Finally, add your device to the lists in the .github/workflows/containers.yml and .github/workflows/images.yml workflows.
Use Github Actions to build the images:
- Run the
containersworkflow to build the OCI images - Run the
imagesworkflow to build the flashable disk images
Finally, flash the system to your device:
- Find the suitable partitions to flash the root partition, the /boot partition and the ESP
- Flash U-Boot (or any alternative that can boot EFI executables on your device) to the android boot partition
- Flash boot.raw, esp.raw and root.raw using fastboot or U-Boot's mass storage mode
- Reboot and test Pocketblue!
!!! caution Before flashing, make sure the chosen partitions can be safely flashed without bricking the device