main/postmarketos-base: split openrc specifics into subpackages (MR 5364)

Co-authored-by: Clayton Craft <clayton@craftyguy.net>
This commit is contained in:
jane400 2024-06-24 10:14:49 +02:00 committed by Clayton Craft
parent 3c0d991089
commit dc81fbcd23
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
4 changed files with 63 additions and 29 deletions

View file

@ -1,6 +1,6 @@
pkgname=postmarketos-base
pkgver=32
pkgrel=5
pkgrel=6
pkgdesc="Meta package for minimal postmarketOS base"
url="https://postmarketos.org"
arch="noarch"
@ -24,7 +24,9 @@ triggers="$pkgname.trigger=/usr/share/deviceinfo"
subpackages="
$pkgname-mesa
$pkgname-nftables
$pkgname-nftables-openrc:nftables_openrc
$pkgname-nofde
$pkgname-openrc
"
options="!check"
@ -35,11 +37,8 @@ replaces="
alpine-baselayout-data
alpine-release
busybox-initscripts
busybox-openrc
openrc
sudo
sudo-ldap
zram-init-openrc
"
replaces_priority=100 # leave plenty for alpine
@ -112,10 +111,18 @@ mesa() {
nftables() {
install_if="$pkgname=$pkgver-r$pkgrel nftables"
depends="postmarketos-config-nftables"
install="$subpkgname.post-install"
mkdir "$subpkgdir"
}
nftables_openrc() {
install_if="$pkgname-openrc=$pkgver-r$pkgrel nftables"
depends="nftables-openrc"
install="$subpkgname.post-install"
mkdir -p "$subpkgdir"
}
nofde() {
# dummy package that satisfies the unlocker dependency for mkinitfs without
# installing anything for systems that don't use fde
@ -124,6 +131,30 @@ nofde() {
mkdir "$subpkgdir"
}
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
install="$subpkgname.post-install"
replaces="
busybox-openrc
openrc
zram-init-openrc
"
depends="
eudev-openrc
logbookd-openrc
openssh-server-common-openrc
udev-init-scripts-openrc
zram-init-openrc
"
amove etc/conf.d/swapfile
amove etc/conf.d/zram-init
amove etc/conf.d/syslog
amove etc/init.d/deferred-initcalls
amove etc/init.d/swapfile
amove etc/init.d/tmpfs
}
sha512sums="
e529f5cef1f31481b577f99b8917704f2cfefb963d98bf40a14b017938e55a00134d2033f81d2cb0b8489c5e9b4a92fdc0a788013f1adb4cd46d9580c9988186 rootfs-etc-sudoers
9591c9cb2194fa1092505159c9eb3d899bec95b6dbd9a0222be62098db012da113a125e40d70373d60af9880dfa489bdbe12b6b897bdef5613e023800fb6ee1b rootfs-etc-doas.d-10-postmarketos.conf

View file

@ -0,0 +1,27 @@
#!/bin/sh -e
# Enable eudev service
rc-update add udev sysinit
rc-update add udev-trigger sysinit
rc-update add udev-settle sysinit
rc-update add udev-postmount default
# Enable other OpenRC services
for service in devfs dmesg; do
rc-update -q add $service sysinit
done
for service in hwclock modules sysctl hostname bootmisc logbookd tmpfs; do
rc-update -q add $service boot
done
for service in sshd swapfile local zram-init; do
rc-update -q add $service default
done
for service in mount-ro killprocs savecache; do
rc-update -q add $service shutdown
done
# Prime swclock with a reasonable date/time on first boot
mkdir -p /run/openrc
touch /run/openrc/shutdowntime
exit 0

View file

@ -1,29 +1,5 @@
#!/bin/sh -e
# Enable eudev service
rc-update add udev sysinit
rc-update add udev-trigger sysinit
rc-update add udev-settle sysinit
rc-update add udev-postmount default
# Enable other OpenRC services
for service in devfs dmesg; do
rc-update -q add $service sysinit
done
for service in hwclock modules sysctl hostname bootmisc logbookd tmpfs; do
rc-update -q add $service boot
done
for service in sshd swapfile local zram-init; do
rc-update -q add $service default
done
for service in mount-ro killprocs savecache; do
rc-update -q add $service shutdown
done
# Prime swclock with a reasonable date/time on first boot
mkdir -p /run/openrc
touch /run/openrc/shutdowntime
# Make apk interactive by default
touch /etc/apk/interactive