From 9872870a9247f28b31c7681aae657871864d3f6a Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Tue, 21 May 2024 12:57:11 -0400 Subject: [PATCH] Simplify launching of default realm. Also remove sway launcher --- .../citadel-config/citadel-config.bb | 16 +++++----------- ...lm.path => citadel-launch-default-realm.path} | 5 +++++ ...vice => citadel-launch-default-realm.service} | 2 ++ .../files/systemd/sway-session-switcher.service | 16 ---------------- .../files/systemd/watch-run-user.path | 10 ---------- .../files/systemd/watch-run-user.service | 7 ------- 6 files changed, 12 insertions(+), 44 deletions(-) rename meta-citadel/recipes-citadel/citadel-config/files/systemd/{launch-default-realm.path => citadel-launch-default-realm.path} (66%) rename meta-citadel/recipes-citadel/citadel-config/files/systemd/{launch-default-realm.service => citadel-launch-default-realm.service} (99%) delete mode 100644 meta-citadel/recipes-citadel/citadel-config/files/systemd/sway-session-switcher.service delete mode 100644 meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.path delete mode 100644 meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.service diff --git a/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb b/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb index 4b871b5..c766ffa 100644 --- a/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb +++ b/meta-citadel/recipes-citadel/citadel-config/citadel-config.bb @@ -8,10 +8,8 @@ DEPENDS = "" S = "${WORKDIR}" DEFAULT_REALM_UNITS = "\ - file://systemd/launch-default-realm.path \ - file://systemd/launch-default-realm.service \ - file://systemd/watch-run-user.path \ - file://systemd/watch-run-user.service \ + file://systemd/citadel-launch-default-realm.path \ + file://systemd/citadel-launch-default-realm.service \ " MODPROBE_CONFIG = "\ @@ -48,7 +46,6 @@ SRC_URI = "\ file://citadel-installer.desktop \ file://citadel-installer-ui.desktop \ file://systemd/zram-swap.service \ - file://systemd/sway-session-switcher.service \ file://systemd/x11-session-switcher.service \ file://systemd/citadel-installer-backend.service \ file://systemd/installer-session-switcher.service \ @@ -77,7 +74,7 @@ RDEPENDS:${PN} = "bash" inherit allarch systemd useradd -SYSTEMD_SERVICE:${PN} = "zram-swap.service watch-run-user.path sway-session-switcher.service x11-session-switcher.service citadel-installer-backend.service installer-session-switcher.service citadel-setpassword.service" +SYSTEMD_SERVICE:${PN} = "zram-swap.service citadel-launch-default-realm.path x11-session-switcher.service citadel-installer-backend.service installer-session-switcher.service citadel-setpassword.service" do_install() { install -m 0755 -d ${D}/storage @@ -117,7 +114,6 @@ do_install() { install -m 644 ${WORKDIR}/systemd/zram-swap.service ${D}${systemd_system_unitdir} - install -m 644 ${WORKDIR}/systemd/sway-session-switcher.service ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/systemd/x11-session-switcher.service ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/systemd/citadel-installer-backend.service ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/systemd/installer-session-switcher.service ${D}${systemd_system_unitdir} @@ -127,10 +123,8 @@ do_install() { install -d ${D}${systemd_user_unitdir}/gnome-session@citadel-installer.target.d install -m 644 ${WORKDIR}/systemd/user/gnome-session@citadel-installer.target.d/session.conf ${D}${systemd_user_unitdir}/gnome-session@citadel-installer.target.d - install -m 644 ${WORKDIR}/systemd/watch-run-user.path ${D}${systemd_system_unitdir} - install -m 644 ${WORKDIR}/systemd/watch-run-user.service ${D}${systemd_system_unitdir} - install -m 644 ${WORKDIR}/systemd/launch-default-realm.path ${D}${systemd_system_unitdir} - install -m 644 ${WORKDIR}/systemd/launch-default-realm.service ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/systemd/citadel-launch-default-realm.path ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/systemd/citadel-launch-default-realm.service ${D}${systemd_system_unitdir} # skel files for new realms install -m 644 -T ${WORKDIR}/skel/profile ${D}${sysconfdir}/skel/.profile diff --git a/meta-citadel/recipes-citadel/citadel-config/files/systemd/launch-default-realm.path b/meta-citadel/recipes-citadel/citadel-config/files/systemd/citadel-launch-default-realm.path similarity index 66% rename from meta-citadel/recipes-citadel/citadel-config/files/systemd/launch-default-realm.path rename to meta-citadel/recipes-citadel/citadel-config/files/systemd/citadel-launch-default-realm.path index e6a23e7..e1d754c 100644 --- a/meta-citadel/recipes-citadel/citadel-config/files/systemd/launch-default-realm.path +++ b/meta-citadel/recipes-citadel/citadel-config/files/systemd/citadel-launch-default-realm.path @@ -1,6 +1,11 @@ [Unit] Description=Wait for creation of PA and Wayland sockets before launching first realm. +Wants=run-user-1000.mount +After=run-user-1000.mount [Path] PathChanged=/run/user/1000/pulse/native PathChanged=/run/user/1000/wayland-0 + +[Install] +WantedBy=graphical.target diff --git a/meta-citadel/recipes-citadel/citadel-config/files/systemd/launch-default-realm.service b/meta-citadel/recipes-citadel/citadel-config/files/systemd/citadel-launch-default-realm.service similarity index 99% rename from meta-citadel/recipes-citadel/citadel-config/files/systemd/launch-default-realm.service rename to meta-citadel/recipes-citadel/citadel-config/files/systemd/citadel-launch-default-realm.service index 90170b7..8c96885 100644 --- a/meta-citadel/recipes-citadel/citadel-config/files/systemd/launch-default-realm.service +++ b/meta-citadel/recipes-citadel/citadel-config/files/systemd/citadel-launch-default-realm.service @@ -1,5 +1,6 @@ [Unit] Description=Launch default realm + ConditionPathExists=!/run/realms ConditionPathExists=/realms/default.realm ConditionPathExists=/run/user/1000/pulse/native @@ -10,3 +11,4 @@ ConditionPathExists=/run/user/1000/wayland-0 ExecStart=/usr/libexec/citadel-boot start-realms Type=oneshot RemainAfterExit=yes + diff --git a/meta-citadel/recipes-citadel/citadel-config/files/systemd/sway-session-switcher.service b/meta-citadel/recipes-citadel/citadel-config/files/systemd/sway-session-switcher.service deleted file mode 100644 index 048620a..0000000 --- a/meta-citadel/recipes-citadel/citadel-config/files/systemd/sway-session-switcher.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=Sway Session Switcher -After=accounts-daemon.service -Before=gdm.service -ConditionKernelCommandLine=citadel.sway - -[Service] -Type=oneshot -RemainAfterExit=no - -ExecStartPre=-/usr/bin/plymouth message --text="Setting session to sway" -ExecStart=/usr/bin/busctl call org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User SetXSession s "sway" - -[Install] -WantedBy=graphical.target - diff --git a/meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.path b/meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.path deleted file mode 100644 index e930430..0000000 --- a/meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.path +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Watch for creation of /run/user/1000 -After=run-user-1000.mount -Requires=run-user-1000.mount - -[Path] -PathChanged=/run/user/1000 - -[Install] -WantedBy=multi-user.target diff --git a/meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.service b/meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.service deleted file mode 100644 index 6f28705..0000000 --- a/meta-citadel/recipes-citadel/citadel-config/files/systemd/watch-run-user.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Watch run-user service - -[Service] -Type=oneshot -ExecStart=/usr/bin/systemctl --no-block start launch-default-realm.path -RemainAfterExit=yes