From ba2199528ecc5bdd69a2f062483d03e18117b49c Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 15 Oct 2025 09:39:41 -0700 Subject: [PATCH] main/postmarketos-ui-plasma-mobile: drop systemd unit file This should come from the package providing the daemon run by the unit file (and in our case, at least temporarily, from the vendored unit file in systemd-services) This also adds an install script for post-upgrade that makes sure that the alias for display-manager.service is created for plasma-mobile on existing installs where we were missing the alias definition in the tinydm unit file. Without this workaround, existing installs will miss the alias and we won't be able to run things that are associated with this alias (like stopping pbsplash.) Note: this is a post-install script since this subpkg is new, and on existing systems affected by the issue it resolves the subpkg would be 'installed' not 'upgraded'. Part-of: --- main/postmarketos-ui-plasma-mobile/APKBUILD | 15 +++-- .../plasma-mobile.service | 58 ------------------- ...etos-ui-plasma-mobile-systemd.post-install | 9 +++ ...etos-ui-plasma-mobile-systemd.post-upgrade | 1 + 4 files changed, 20 insertions(+), 63 deletions(-) delete mode 100644 main/postmarketos-ui-plasma-mobile/plasma-mobile.service create mode 100644 main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-install create mode 120000 main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-upgrade diff --git a/main/postmarketos-ui-plasma-mobile/APKBUILD b/main/postmarketos-ui-plasma-mobile/APKBUILD index a19ee4f53..c1dbc126f 100644 --- a/main/postmarketos-ui-plasma-mobile/APKBUILD +++ b/main/postmarketos-ui-plasma-mobile/APKBUILD @@ -1,8 +1,8 @@ # Reference: https://postmarketos.org/uipkg # Maintainer: Bart Ribbers pkgname=postmarketos-ui-plasma-mobile -pkgver=5 -pkgrel=10 +pkgver=6 +pkgrel=0 pkgdesc="(Wayland) Mobile variant of KDE Plasma (does not run without hardware acceleration)" url="https://wiki.postmarketos.org/wiki/Plasma_Mobile" arch="noarch !armhf !x86 !ppc64le" # armhf: pmaports#75, x86: aports#11807, ppc64le: no angelfish @@ -29,12 +29,11 @@ _pmb_recommends=" ttyescape " source=" - plasma-mobile.service kscreenlockerrc maliit-plasmamobile.json org.kde.plasma.mobile.homescreen.folio.js " -subpackages="$pkgname-extras $pkgname-openrc" +subpackages="$pkgname-extras $pkgname-openrc $pkgname-systemd" replaces="plasma-mobile plasma-mobile-meta" options="!check pmb:drm pmb:systemd" @@ -84,8 +83,14 @@ openrc() { mkdir -p "$subpkgdir" } +systemd() { + default_systemd + install="$subpkgname.post-install $subpkgname.post-upgrade" + + mkdir -p "$subpkgdir" +} + sha512sums=" -e12d8e98e28a795f879aebcceb32a991ee4abcb3bc5ec458aa5378bb52ff86cf39be04bc4a196925f532d623304b3005f561fa5e55d1c87944d718058ec4c0e6 plasma-mobile.service b3aa8ee26c01de103c0c0af23532bf232f7071fdd02c53bd787d78e5974faa5662fc5776ce9be417392214ae73334b0eb0d073fe24f616a0ce99081f30b9158c kscreenlockerrc 70ee87860842057b557a433a9ae7d54653f076a612b3d9de2d413d598806d23ec19390262eaa398cddf39437f1213d14922402a8d978878e5e98f3767ce0b9eb maliit-plasmamobile.json 9396bb437c8a6e4b13eff1d16d1dee5804beafd126f4be55ab6deec7bcc42e2473c824b9a37717e347f99c33037d4de7accfb67943cb282fde38eb89ed6f2b89 org.kde.plasma.mobile.homescreen.folio.js diff --git a/main/postmarketos-ui-plasma-mobile/plasma-mobile.service b/main/postmarketos-ui-plasma-mobile/plasma-mobile.service deleted file mode 100644 index c47bff113..000000000 --- a/main/postmarketos-ui-plasma-mobile/plasma-mobile.service +++ /dev/null @@ -1,58 +0,0 @@ -[Unit] -Description=Open-source user interface for phones, based on Plasma technologies -Documentation=https://invent.kde.org/plasma-mobile - -# replaces the getty -Conflicts=getty@tty1.service -After=getty@tty1.service - -# Needs all the dependencies of the services it's replacing -# (currently getty@tty1.service): -After=rc-local.service plymouth-quit-wait.service systemd-user-sessions.service - -OnFailure=getty@tty1.service - -# D-Bus is necessary for contacting logind. Logind is required. -Wants=dbus.socket -After=dbus.socket - -# This scope is created by pam_systemd when logging in as the user. -# This directive is a workaround to a systemd bug, where the setup of the -# user session by PAM has some race condition, possibly leading to a failure. -# See README for more details. -After=session-c1.scope - -# Since we are part of the graphical session, make sure we are started before -# it is complete. -Before=graphical.target - -# Prevent starting on systems without virtual consoles -ConditionPathExists=/dev/tty0 - -[Service] -Environment=LANG=C.UTF-8 -ExecStart=/usr/bin/startplasmamobile -TimeoutStartSec=30 -User=10000 -PAMName=login -WorkingDirectory=~ -Restart=always -RestartSec=5s - -# A virtual terminal is needed. -TTYPath=/dev/tty7 -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes - -# Fail to start if not controlling the tty. -StandardInput=tty-fail -StandardOutput=journal -StandardError=journal - -# Log this user with utmp, letting it show up with commands 'w' and 'who'. -UtmpIdentifier=tty7 -UtmpMode=user - -[Install] -WantedBy=graphical.target diff --git a/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-install b/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-install new file mode 100644 index 000000000..48bb20d79 --- /dev/null +++ b/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-install @@ -0,0 +1,9 @@ +#!/bin/sh + +# Create missing display-manager.service alias if plasma-mobile service is +# enabled and the alias is missing. +if systemctl is-enabled -q plasma-mobile.service 2>/dev/null; then + if ! systemctl is-enabled -q display-manager.service 2>/dev/null; then + systemctl enable plasma-mobile.service + fi +fi diff --git a/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-upgrade b/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-upgrade new file mode 120000 index 000000000..02fc77d11 --- /dev/null +++ b/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile-systemd.post-upgrade @@ -0,0 +1 @@ +postmarketos-ui-plasma-mobile-systemd.post-install \ No newline at end of file