Skip to content

Initial systemd support

Oliver Smith requested to merge systemd-merge-request into master

pmbootstrap init and install

Add initial systemd support. Based on the options in the UI package, ask the user during pmbootstrap init whether they want to install systemd. Based on their answer, and only if the branch supports systemd, install the postmarketos-base-systemd package during pmbootstrap install.

option in postmarketos-ui package pmbootstrap init "default" "always" "never" UIs where we plan to use it
- asks about systemd openrc systemd openrc (the rest)
pmb:systemd asks about systemd systemd systemd openrc KDE, GNOME (including Phosh)
pmb:systemd-never does not ask openrc openrc openrc Sxmo

So for Sxmo, no prompt will be displayed. Instead a short message that says OpenRC will be installed based on the UI selection.

pmbootstrap repo_bootstrap

Add pmbootstrap repo_bootstrap systemd to have a clean bootstrap path from Alpine to postmarketOS with systemd. The steps for the bootstrap are defined in pmaports.cfg, as of writing in the systemd branch of pmaports:

[repo:systemd]
pmaports_dir=systemd
# Build forks of Alpine packages that support usr_merge
bootstrap_1=apk-tools abuild alpine-base
# Build systemd related pkgs without deps on each other
bootstrap_2=[usr_merge] systemd dbus linux-pam
# Build systemd related pkgs *with* deps on each other
bootstrap_3=[usr_merge] systemd dbus linux-pam
# Marker that bootstrap is done, only needs to be built once
bootstrap_4=[usr_merge] postmarketos-base-systemd

differences to systemd branch

The systemd branch has the following additional patches.

Not included as discussed with Caleb:

  • systemd: merge-usr: use rsync

Not included because these were only for the demo images:

  • systemd: hacking for demo images
  • fix bash path

Not included because I don't understand these patches:

  • Revert "pmb.chroot.init: upgrade pkgs at the end"
  • repo_bootstrap: add --from-scratch
  • pmb.chroot.init: pass package repos to apk.static when initialising a chroot

@calebccff: sorry for just not including them, but I felt like just creating the MR without them for now would be the fastest way forward.

If you think we should add the patches to this MR already:

  • why can't we use the simpler apk --no-network upgrade -a instead? The idea was, that we simply use alpine's apk first, without any extra repositories, then let pmbootstrap merge usr, then upgrade from alpine's apk to the custom apk we built during bootstrap. In my testing this worked... can we do it at least initially like this, or is there a good reason to do it differently?

  • why is --from-scratch needed? the repo_bootstrap should always be from scratch. It already contains logic to use no pmOS repository for the target architecture. If it is a foreign arch, the native repository does use the pmOS binary repository so cross compilers can be used during repo_bootstrap.

Merge request reports