Skip to content
Snippets Groups Projects

Initial systemd support

Merged Imported Administrator 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

Checking pipeline status.

Approval is optional

Merged by AdministratorAdministrator 1 year ago (Mar 13, 2024 9:22pm UTC)

Pipeline #190180 passed

Pipeline passed for 44781163 on master

Deployed to dep‎loy‎ 5 months ago

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator mentioned in issue pmaports#2632 (closed) · Imported

    mentioned in issue pmaports#2632 (closed)

    By Oliver Smith on 2024-03-10T20:16:05

  • Administrator added 5 commits · Imported

    added 5 commits

    • 3fd137ad - Add "pmbootstrap repo_bootstrap"
    • 6215997a - pmbootstrap build, install: require repo_bootstrap
    • aa2145a6 - install: add pmos-base-systemd if systemd enabled
    • b4873321 - Support pmb:systemd-never option
    • ac293bd2 - is_systemd_selected: check for branch support

    Compare with previous version

    By Oliver Smith on 2024-03-10T20:19:39

    • Author Owner
      Resolved by Administrator

      Revert "pmb.chroot.init: upgrade pkgs at the end"

      I don't remember when, but I have hit issues because of this. When I first tried this out I ended up with a borked chroot because it didn't have our fork of apk-tools installed when it should have. I'm fairly sure this is to blame. But I haven't managed to pin this one down.

      The other argument in favour is that (at least as of the experimenting I've done today) it seems like forking busybox and alpine-baselayout and implementing /usr merge that way is a much more sensible solution that initialising a chroot and then manually converting it to the /usr merge layout. This is probably going to be required for mkosi, and it simplifies the logic here hugely (also, I would argue that being able to create a /usr merged rootfs with a single invocation of apk is definitely better).

      repo_bootstrap: add --from-scratch

      This is needed for the above revert to make sense. And I think the repo not being there is why I ran into the issue before where our fork of apk-tools wasn't installed.

      pmb.chroot.init: pass package repos to apk.static when initialising a chroot

      I guess same again. These three commits together enable the necessary behaviour for this to all work nicely. And will wind up simplifying the code in pmbootstrap a lot.

      I guess we don't need to implement these changes now, if you've only tested the commits here and they work then I can follow up with the other stuff once we get the binary repo up (and can therefore switch pmbootstrap to use our fork of apk-tools-static rather than upstream, at least by default).

      By Caleb Connolly on 2024-03-12T23:55:05

      Edited by Ghost User
  • Administrator added 10 commits · Imported

    added 10 commits

    • 1e234c66 - init: ask whether to install systemd
    • 1aa4677e - systemd installs: merge /usr on chroot init
    • c5e5b9c2 - pmb.chroot.init: add mirrors_pmos argument
    • 78e8bffe - pmb.chroot.init: upgrade pkgs at the end
    • 52b8f17c - Add "pmbootstrap repo_bootstrap"
    • 9c941118 - pmbootstrap build, install: require repo_bootstrap
    • b7018648 - install: add pmos-base-systemd if systemd enabled
    • 52389345 - Support pmb:systemd-never option
    • ebf1b23e - is_systemd_selected: check for branch support
    • c125fbad - Add sanity check for "systemd" config values

    Compare with previous version

    By Oliver Smith on 2024-03-11T16:34:04

  • Administrator mentioned in issue #2321 (closed) · Imported

    mentioned in issue #2321 (closed)

    By Oliver Smith on 2024-03-11T16:40:46

  • Administrator
  • Administrator
  • Administrator
  • Administrator
  • Administrator
  • Administrator
  • Administrator added 11 commits · Imported

    added 11 commits

    • c6e8a89e - 1 commit from branch master
    • 1f994508 - init: ask whether to install systemd
    • aa7c5886 - systemd installs: merge /usr on chroot init
    • 2c818cb1 - pmb.chroot.init: add postmarketos_mirror argument
    • 7b0ba599 - pmb.chroot.init: upgrade pkgs at the end
    • 2037782b - Add "pmbootstrap repo_bootstrap"
    • 053e0cb9 - pmbootstrap build, install: require repo_bootstrap
    • bf872afd - install: add pmos-base-systemd if systemd enabled
    • 86a7006f - Support pmb:systemd-never option
    • 7f82417b - is_systemd_selected: check for branch support
    • 231c7916 - Add sanity check for "systemd" config values

    Compare with previous version

    By Oliver Smith on 2024-03-12T23:54:05

  • Author Owner

    @calebccff: updated, can you take another look?

    Also updated pmaports.cfg reference while at it: https://wiki.postmarketos.org/wiki/Pmaports.cfg_reference

    By Oliver Smith on 2024-03-12T23:57:02

  • Administrator resolved all threads · Imported

    resolved all threads

    By Caleb Connolly on 2024-03-13T20:38:43

  • Administrator approved this merge request · Imported

    approved this merge request

    By Caleb Connolly on 2024-03-13T20:42:29

  • Author Owner

    LGTM!

    By Caleb Connolly on 2024-03-13T20:42:35

  • Administrator added 10 commits · Imported

    added 10 commits

    • e96ca363 - init: ask whether to install systemd (MR 2273)
    • 6f3ed45d - systemd installs: merge /usr on chroot init (MR 2273)
    • 9126d154 - pmb.chroot.init: add postmarketos_mirror argument (MR 2273)
    • dce45998 - pmb.chroot.init: upgrade pkgs at the end (MR 2273)
    • fafd4e73 - Add "pmbootstrap repo_bootstrap" (MR 2273)
    • 266bfc31 - pmbootstrap build, install: require repo_bootstrap (MR 2273)
    • ed9f7073 - install: add pmos-base-systemd if systemd enabled (MR 2273)
    • bfc64d1c - Support pmb:systemd-never option (MR 2273)
    • de5e4c69 - is_systemd_selected: check for branch support (MR 2273)
    • 44781163 - Add sanity check for "systemd" config values (MR 2273)

    Compare with previous version

    By Oliver Smith on 2024-03-13T21:15:09

  • Administrator enabled an automatic merge when the pipeline for 44781163 succeeds · Imported

    enabled an automatic merge when the pipeline for 44781163 succeeds

    By Oliver Smith on 2024-03-13T21:15:42

  • Administrator merged · Imported

    merged

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading