From 6151468d695fb318d40234623c96a76b94308c83 Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Fri, 16 Feb 2018 18:20:05 -0500 Subject: [PATCH] Improvements to appimg container launching --- .../files/primary-user-appimg.path | 5 +++++ .../files/primary-user-appimg.service | 3 --- .../primary-user-appimg/files/primary.nspawn | 14 ++++++++++++++ .../primary-user-appimg/files/watch-run-user.path | 10 ++++++++++ .../files/watch-run-user.service | 6 ++++++ .../primary-user-appimg/primary-user-appimg.bb | 13 +++++++++++-- 6 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.path create mode 100644 meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.path create mode 100644 meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.service diff --git a/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.path b/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.path new file mode 100644 index 0000000..e43a4f5 --- /dev/null +++ b/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.path @@ -0,0 +1,5 @@ +[Unit] +Description=Wait for creation of /run/user/1000/pulse/native + +[Path] +PathExists=/run/user/1000/pulse/native diff --git a/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.service b/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.service index a6347ae..79eb48f 100644 --- a/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.service +++ b/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary-user-appimg.service @@ -9,6 +9,3 @@ KillMode=mixed Type=notify RestartForceExitStatus=133 SuccessExitStatus=133 - -[Install] -WantedBy=multi-user.target diff --git a/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary.nspawn b/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary.nspawn index 961a37d..66f0bbf 100644 --- a/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary.nspawn +++ b/meta-citadel-distro/recipes-core/primary-user-appimg/files/primary.nspawn @@ -1,6 +1,20 @@ +[Exec] Boot=true + +[Files] BindReadOnly=/usr/share/themes/Adapta BindReadOnly=/usr/share/themes/Adapta-Eta BindReadOnly=/usr/share/themes/Adapta-Nokto BindReadOnly=/usr/share/themes/Adapta-Nokto-Eta BindReadOnly=/usr/share/icons/Paper + +Bind=/storage/user-data/primary-home:/home/user +BindReadOnly=/storage/citadel-state/resolv.conf:/etc/resolv.conf + +Bind=/dev/snd +Bind=/dev/shm +Bind=/run/user/1000/pulse:/run/user/host/pulse + +#Bind=/run/user/1000/wayland-0:/run/user/host/wayland-0 +#Bind=/dev/kvm + diff --git a/meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.path b/meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.path new file mode 100644 index 0000000..7b4876b --- /dev/null +++ b/meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.path @@ -0,0 +1,10 @@ +[Unit] +Description=Watch Just watching Run User +After=run-user-1000.mount +Requires=run-user-1000.mount + +[Path] +PathExists=/run/user/1000 + +[Install] +WantedBy=multi-user.target diff --git a/meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.service b/meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.service new file mode 100644 index 0000000..a3b67b0 --- /dev/null +++ b/meta-citadel-distro/recipes-core/primary-user-appimg/files/watch-run-user.service @@ -0,0 +1,6 @@ +[Unit] +Description=Watch run-user service + +[Service] +Type=oneshot +ExecStart=/usr/bin/systemctl --no-block start primary-user-appimg.path diff --git a/meta-citadel-distro/recipes-core/primary-user-appimg/primary-user-appimg.bb b/meta-citadel-distro/recipes-core/primary-user-appimg/primary-user-appimg.bb index c4edc52..8d8b230 100644 --- a/meta-citadel-distro/recipes-core/primary-user-appimg/primary-user-appimg.bb +++ b/meta-citadel-distro/recipes-core/primary-user-appimg/primary-user-appimg.bb @@ -7,16 +7,25 @@ DEPENDS = "" inherit systemd -SRC_URI = "file://primary-user-appimg.service file://primary.nspawn file://run-in-image" +SRC_URI = "file://primary-user-appimg.path file://primary-user-appimg.service file://primary.nspawn file://watch-run-user.path file://watch-run-user.service file://run-in-image" S = "${WORKDIR}" -SYSTEMD_SERVICE_${PN} = "primary-user-appimg.service" +SYSTEMD_SERVICE_${PN} = "watch-run-user.path" RDEPENDS_${PN} = "bash" +FILES_${PN} += "\ + ${systemd_system_unitdir}/watch-run-user.service \ + ${systemd_system_unitdir}/primary-user-appimg.path \ + ${systemd_system_unitdir}/primary-user-appimg.service \ +" + do_install() { install -d ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/primary-user-appimg.path ${D}${systemd_system_unitdir} install -m 644 ${WORKDIR}/primary-user-appimg.service ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/watch-run-user.path ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/watch-run-user.service ${D}${systemd_system_unitdir} install -d ${D}${sysconfdir}/systemd/nspawn install -m 644 ${WORKDIR}/primary.nspawn ${D}${sysconfdir}/systemd/nspawn install -d ${D}${libexecdir}