From 6eb8cab84d2efdcc501879417023e362f6abd0c9 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 18 Apr 2025 10:25:34 +0200 Subject: [PATCH] install: openrc: fix installing alpine-base early With recent changes we don't install alpine-base in the chroots anymore. It still gets installed as postmarketos-base depends on it (for now, this will change soon in master). But it is not guaranteed to be installed before other packages which may run "rc-update" in their postinst scripts. Fix this by explicitly installing alpine-base early on during "pmbootstrap install". Fix for e.g. v24.12:pine64-pinephone:phosh images: (342/976) Installing eg25-manager-openrc (0.4.6-r5) (343/976) Installing device-pine64-pinephone-openrc (7-r0) Executing device-pine64-pinephone-openrc-7-r0.post-install lib/apk/exec/device-pine64-pinephone-openrc-7-r0.post-install: line 3: rc-update: not found ERROR: device-pine64-pinephone-openrc-7-r0.post-install: script exited with error 127 Related: https://builds.sr.ht/~postmarketos/job/1473669#task-img-743 Fixes: 12d125ab ("chroot: don't depende on alpine-base") Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2585 --- pmb/install/_install.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 1921c520..ee87b86b 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -1389,6 +1389,10 @@ def create_device_rootfs(args: PmbArgs, step: int, steps: int) -> None: # when services are installed later if pmb.config.other.is_systemd_selected(context.config): pmb.chroot.apk.install(["postmarketos-base-systemd"], chroot) + else: + # Install alpine-base (which pulls in openrc related packages) early, + # so postinst scripts can run rc-update + pmb.chroot.apk.install(["alpine-base"], chroot) # Install all packages to device rootfs chroot (and rebuild the initramfs, # because that doesn't always happen automatically yet, e.g. when the user