Skip to content

ci: add postmarketOS to integration testing#4297

Merged
behrmann merged 7 commits into
systemd:mainfrom
craftyguy:pmos-can-into-ci
Jun 18, 2026
Merged

ci: add postmarketOS to integration testing#4297
behrmann merged 7 commits into
systemd:mainfrom
craftyguy:pmos-can-into-ci

Conversation

@craftyguy

@craftyguy craftyguy commented May 11, 2026

Copy link
Copy Markdown
Contributor

apk-tools isn't packaged in Ubuntu, so the scope of testing is limited quite a bit to only a handful of distros/tools trees that have apk available. This also means we're not able to test building images for other distros in a pmOS tools tree since the base distro is... 🥁... Ubuntu and it's unable to build a pmOS tools tree because it doesn't have apk-tools.

@craftyguy

Copy link
Copy Markdown
Contributor Author

This opensuse tools tree failure seems unrelated to my changes, it's also failing when building images for other distros:

[32](https://github.com/systemd/mkosi/actions/runs/25703288918/job/75468214832?pr=4297#step:10:4133)
+ /usr/lib/systemd/systemd-keyutil extract-public --private-key /work/home/runner/work/mkosi/mkosi/mkosi.key
+ /usr/lib/systemd/systemd-measure sign --osrel=/work/var/tmp/mkosi-workspace-ovxxn95g/root/usr/lib/os-release --cmdline=/work/var/tmp/mkosi-workspace-ovxxn95g/cmdline --uname=/tmp/tmp.uname0_1a3qma --pcrpkey=/tmp/tmp.pcrpkey7wvwhp5e --linux=/work/var/tmp/mkosi-workspace-ovxxn95g/root/usr/lib/modules/6.18.29-0-virt/vmlinuz --initrd=/tmp/tmp.initrdxwyk1xfg --sbat=/tmp/tmp.sbatetn4_75z --bank=sha256 --private-key=/work/home/runner/work/mkosi/mkosi/mkosi.key
Could not calculate PolicyPCR digest: Operation not supported

@behrmann

Copy link
Copy Markdown
Contributor

Thanks for this!

Yeah, opensuse is borked at the moment and nobody had time to investigate yet.

@daandemeyer

Copy link
Copy Markdown
Contributor

@craftyguy We can mess around a bit, you can add a step to the mkosi action to download a static apk (check the hash ofc) and together with #4313 we'll be able to build from ubuntu

@daandemeyer

Copy link
Copy Markdown
Contributor

If you rebase we now install apk in the github action

@behrmann

Copy link
Copy Markdown
Contributor

@craftyguy could you rebase this? I think it would be great if we could land this before any larger work on the integration tests, like #4357, happens.

@craftyguy
craftyguy force-pushed the pmos-can-into-ci branch 9 times, most recently from af935f7 to 39fd928 Compare June 16, 2026 04:07
@craftyguy

Copy link
Copy Markdown
Contributor Author

@behrmann rebased, and got pmOS-related tests passing now

@martinpitt

martinpitt commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This fails opensuse's test_extension[sysext] on both debian and archi, I haven't seen that breakage yet. That needs a closer look, smells like and actual regression? this run could be an opensuse mirror flake, worth retrying (I can't trigger retries myself)

Update: The two failures above are the same reason, suse repo download timeouts/failures. ✔️

@martinpitt martinpitt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @craftyguy ! I have some questions, and the commit series could use some squashing and reordering, but by and large this looks great!

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
- debian
- fedora
- opensuse
- postmarketos

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is pOS actually meant to be a dev platform where you would run things like mkosi to build e.g. ubuntu? If not, testing with a pOS tools tree feels like a waste (we already run into serious github runner capacity issues). If so, then fine of course.

If this gets dropped, the excludes from below can be reduced.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, yes, it's a general purpose distro that happens to run on phones (among many other things). In practice, I have no idea who is doing dev work on other distros using mkosi on pmOS. We do have users running other distros in containers with podman, docker, and VMs.

I enabled these because it's what was done for other distros, but I'd be OK with removing them if it makes your CI load lighter and re-adding them IIF people start reporting issues e.g. building ubuntu on pmOS with mkosi.

wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on the fence, and as I haven't yet earned the right to make large directional decisions for mkosi: @behrmann @daandemeyer WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, I think, that a lot of the matrix of our build tests covers test cases people will probably never do, since e.g. I assume there's little overlap between Arch and CentOS target audiences. I kinda don't want to make pmOS a second class citizen, but it's also clear that this grows quadratically, which isn't great either.

That being said. Even if we only test pmOS as a target from various distros and don't build other distros from pmOS, I really would always want to see that pmOS builds from a pmOS tools tree.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we only test pmOS as a target from various distros and don't build other distros from pmOS, I really would always want to see that pmOS builds from a pmOS tools tree.

Sounds good to me, and we can always adjust later if necessary. So IIUC, only enable:

  • build pmOS on pmOS
  • build pmOS on everything

And I would not enable:

  • build everything on pmOS

I kinda don't want to make pmOS a second class citizen

I (a pmOS dev) definitely don't feel like a second class citizen here, so don't worry :P

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@behrmann ok I think I got this implemented. Now pmOS is built in other distro tools trees (that have apk available) and no distros are built with a pmOS tools tree (other than pmOS). I had to add to the "include:" list to get pmOS building with pmOS tools tree.

Comment thread mkosi.tools.conf/mkosi.conf.d/postmarketos.conf
Comment thread mkosi/resources/mkosi-tools/mkosi.conf.d/postmarketos.conf Outdated
Comment thread action.yaml
busybox's losetup, mount, and umount are missing many options supported
by the "full" versions so the "full" versions are added

sfdisk is packaged separately from util-linux on Alpine Linux
sulogin is packaged separately on Alpine Linux, and this other pkg is
not pulled in automatically. Fixes emergency shell in the initrd

device-mapper is not pulled in automatically as a dependency, and needed
for lvm support
On Alpine/pmOS, the EFI stub is split into a separate systemd-efistub
package rather than being bundled with systemd-boot, so it needs to
be added to the tools tree so mkosi can find it when building UKI/ESP
images.
Comment thread .github/workflows/ci.yml Outdated
@martinpitt

Copy link
Copy Markdown
Contributor

I had another look. If you revert the moving of apk install and put it back into actions.yml in /usr, I have no further objections. (Pending the "tools test or not" question from the maintainers above). Thanks!

@craftyguy
craftyguy force-pushed the pmos-can-into-ci branch 2 times, most recently from 8a360f2 to 2e662f3 Compare June 16, 2026 19:22
/usr/local is cleaned up by ci.yml immediately after actions.yaml adds
apk into that dir, which leads to job that try to use apk to fail with
"apk not found"
@behrmann

Copy link
Copy Markdown
Contributor

Modulo the concerns about the size of the build matrix this LGTM.

@martinpitt martinpitt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! I'm looking into these ( ➡️ #4363) two ( ➡️ #4362 ) failures. They are unrelated to this PR, but annoying.

@behrmann behrmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thank you! One last question

Comment thread action.yaml
sudo curl -fsSL -o /usr/local/bin/apk https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v3.0.6/x86_64/apk.static
echo 'f1489e05bace7d7dd0a687fcd38d50b585ac660af4231668b123649bef3718c4 /usr/local/bin/apk' | sha256sum --check
sudo chmod +x /usr/local/bin/apk
sudo curl -fsSL -o /usr/bin/apk https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v3.0.6/x86_64/apk.static

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't introduce this, but I wonder whether we have a good way of good way of keeping this up to date.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best idea I have is to use the gitlab API to get the latest release of apk-tools, get the checksum for it, then download/verify the apk.static binary for x86_64. the API is json, so it would be a handful of curl | jq lines.

If that seems like an OK approach, I can take a shot at implementing it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be lovely, but that's for a later PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I gave it a go over here: #4364

@behrmann
behrmann merged commit 50c8feb into systemd:main Jun 18, 2026
78 of 85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants