main/postmarketos-bootsplash: systemd support (MR 5181)

Install a kill-pbsplash systemd service which is configured to be
started as part of the graphical-session user target. Additionally
install an override so that if the display-manager service (aliases to
gdm, sddm, etc) fails to start it will still kill pbsplash.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Co-authored-by: Clayton Craft <clayton@craftyguy.net>
This commit is contained in:
Caleb Connolly 2024-03-07 00:05:12 +00:00 committed by Clayton Craft
parent 1896be1222
commit 9c9e47b059
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
4 changed files with 55 additions and 2 deletions

View file

@ -1,6 +1,6 @@
# Maintainer: Caleb Connolly <caleb@connolly.tech>
pkgname=postmarketos-bootsplash
pkgver=0.2.1
pkgver=0.2.2
pkgrel=0
pkgdesc="pmOS integration components for pbsplash"
url="https://postmarketos.org"
@ -8,9 +8,12 @@ arch="all"
license="CC-BY-SA-3.0"
depends="devicepkg-utils pbsplash"
options="!check" # no testsuite
subpackages="$pkgname-openrc"
subpackages="$pkgname-openrc $pkgname-systemd"
source="
kill-pbsplash
kill-pbsplash.service
shutdown-splash.service
kill-pbsplash-override.conf
99-shutdown-pbsplash.stop
OpenSans-Regular.svg
pmos-logo.svg
@ -35,8 +38,32 @@ openrc() {
default_openrc
}
systemd() {
install_if="$pkgname=$pkgver-r$pkgrel systemd"
install -Dm644 "$srcdir/kill-pbsplash.service" -t \
"$subpkgdir"/usr/lib/systemd/system/
mkdir -p "$subpkgdir"/usr/lib/systemd/system/multi-user.target.wants
ln -s ../kill-pbsplash.service \
"$subpkgdir"/usr/lib/systemd/system/multi-user.target.wants/
install -Dm644 "$srcdir/kill-pbsplash-override.conf" -t \
"$subpkgdir"/usr/lib/systemd/system/display-manager.service.d/
install -Dm644 "$srcdir/shutdown-splash.service" \
-t "$subpkgdir"/usr/lib/systemd/system/
# Install into related targets
for target in halt reboot shutdown; do
mkdir -p "$subpkgdir"/usr/lib/systemd/system/"$target".target.wants
ln -s ../shutdown-splash.service \
"$subpkgdir"/usr/lib/systemd/system/"$target".target.wants/
done
}
sha512sums="
7e5416f0f9de3605dcbc5ddd4b93d244fd6d4fd1bc2d5a15a034263f8517fc51e73509f29f2a13397d059913917990ada89b36ac7b00a0d21c0283fade755c1c kill-pbsplash
9501b82c1da0495469dfd8daf3ab4c8b3cf4e818906d76b225ebd6e8ea2c2171c7834c3ba521e980b9cedc12955e4a22bc3bfbee73fb7cf6305c920aaa6afa53 kill-pbsplash.service
476c7a8106429c35e772eaf98e257f7a77070050431875113c7c0c75a358250757a381086c7302f1eded0d4cde88d2e63f9fa5d69b6fce46e2d908afd8d9323a shutdown-splash.service
c413607e21c805fff3d9948963aebf1048cdb2e68ed2f4316723d21f861a32aede7d1bf3851c8ba7562b07302471ca6d8f7be1e0487d83dd4cdea9bbb506e792 kill-pbsplash-override.conf
3b862e2282c79d6ffc7aa8dc3992562c11fea5633c98e3ff9c6205a907f5d995e9fcf098adcf294e0648436df97746a3943b9b761ddf72339cc5589fb8904a8d 99-shutdown-pbsplash.stop
2387c64d84f0ba3ee76925f55c87ce025140aa3cd462107a851c34ffd89bd52f606e0d1f9f371d4f642d96545d5cc1bc0fcfb23ca7629a9149055f068da6bffd OpenSans-Regular.svg
98984fd67b99400d2b08422c4d314da558d3c94ee67dbc895e7bbfd6fdf22d4b2c9d35f48f4b73b383a054f535d4089fb705c5532f034cb2ee54eab2184e8e86 pmos-logo.svg

View file

@ -0,0 +1,3 @@
[Unit]
# Trigger killing pbsplash when the display manager starts
OnFailure=kill-pbsplash.service

View file

@ -0,0 +1,12 @@
[Unit]
Description=Stop pbsplash
After=graphical.target
Requisite=graphical.target
[Service]
ExecStart=-/usr/bin/killall pbsplash
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=graphical.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=Displays shutdown splash
DefaultDependencies=no
Before=halt.target shutdown.target reboot.target
[Service]
RemainAfterExit=yes
ExecStart=-/usr/bin/pbsplash -s /usr/share/pbsplash/pmos-logo-text.svg -b "Shutting down..."
[Install]
WantedBy=halt.target shutdown.target reboot.target