From c9790be8043cb2faca95717bfb35fb362305a1fe Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 28 May 2025 11:07:26 -0700 Subject: [PATCH] main/postmarketos-base: add -release and -baselayout subpkgs This splits off two new subpackages in postmarketos-base, allowing for tools (e.g. mkosi) to build a very small "postmarketOS" rootfs. postmarketos-base depends on these two new packages, so there should be no functional change outside of enabling this specific use case. The versioned replaces is meant to fix installing this new package on existing installs. In some cases apk installs this package *before* installing the `postmarketos-base-systemd` update that accompanies this patch. Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6565 --- main/postmarketos-base/APKBUILD | 47 +++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/main/postmarketos-base/APKBUILD b/main/postmarketos-base/APKBUILD index 8714735c1..53173b170 100644 --- a/main/postmarketos-base/APKBUILD +++ b/main/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base pkgver=44 -pkgrel=3 +pkgrel=4 pkgdesc="Meta package for minimal postmarketOS base" url="https://postmarketos.org" arch="noarch" @@ -10,8 +10,6 @@ makedepends="postmarketos-initramfs" # recommendation to not depend on openrc has been to copy them here: # https: // gitlab.alpinelinux.org/alpine/aports/-/merge_requests/71686#note_435428 depends=" - alpine-baselayout - alpine-release apk-tools busybox busybox-suid @@ -37,13 +35,12 @@ subpackages=" $pkgname-nftables-openrc:nftables_openrc $pkgname-openrc $pkgname-ssh + postmarketos-release:release + postmarketos-baselayout:baselayout " options="!check" replaces=" - alpine-baselayout - alpine-baselayout-data - alpine-release sudo sudo-ldap " @@ -110,10 +107,15 @@ prepare() { } package() { - # pmos-base-init provided by a subpackage in this APKBUILD, and it may not - # exist when this is evaluated at the top level. It's moved into this - # function to work around it. - depends="$depends postmarketos-base-init" + # These packages are provided by subpackages in this APKBUILD, and they + # may not exist when this is evaluated at the top level. They're moved + # into this function to work around it. + depends=" + $depends + postmarketos-base-init + postmarketos-baselayout + postmarketos-release + " local i for i in $_source440; do @@ -128,10 +130,6 @@ package() { for i in $_source755; do install -Dm755 "$srcdir/$(flatpath "$i")" "$pkgdir/$i" done - - # /etc/os-release should be a relative symlink, see: - # https://www.man7.org/linux/man-pages/man5/os-release.5.html - ln -s ../usr/lib/os-release "$pkgdir"/etc/os-release } mesa() { @@ -197,6 +195,27 @@ openrc() { amove etc/udev/udev.conf } +baselayout() { + depends="alpine-baselayout" + replaces="alpine-baselayout alpine-baselayout-data postmarketos-base-systemd<44" + + amove etc/fstab + amove etc/motd +} + +release() { + replaces="alpine-release" + pkgdesc="postmarketOS release data" + depends="alpine-release" + + amove usr/lib/os-release + amove etc/issue + + # /etc/os-release should be a relative symlink, see: + # https://www.man7.org/linux/man-pages/man5/os-release.5.html + ln -s ../usr/lib/os-release "$subpkgdir"/etc/os-release +} + sha512sums=" e529f5cef1f31481b577f99b8917704f2cfefb963d98bf40a14b017938e55a00134d2033f81d2cb0b8489c5e9b4a92fdc0a788013f1adb4cd46d9580c9988186 rootfs-etc-sudoers ab09e67203bb82226b0c9e600c8bc231a5c0111977b80edb355e55be101d008ac3c06798c263f0ca50e203758e1bfbf25767ad12f2654d082fb007c0411bbd1f rootfs-etc-doas.d-10-postmarketos.conf