From 7302050e6da52a2974859c613a8ea380db905609 Mon Sep 17 00:00:00 2001 From: brl Date: Sun, 4 Feb 2018 23:18:51 -0500 Subject: [PATCH] recipe to add systemd service to start user-rootfs container --- .../default-user-rootfs.bb | 19 +++++++++++++++++++ .../files/default-user-rootfs.service | 13 +++++++++++++ .../packagegroup-citadel-desktop.bb | 1 + 3 files changed, 33 insertions(+) create mode 100644 meta-citadel-distro/recipes-core/default-user-rootfs/default-user-rootfs.bb create mode 100644 meta-citadel-distro/recipes-core/default-user-rootfs/files/default-user-rootfs.service diff --git a/meta-citadel-distro/recipes-core/default-user-rootfs/default-user-rootfs.bb b/meta-citadel-distro/recipes-core/default-user-rootfs/default-user-rootfs.bb new file mode 100644 index 0000000..b4d110b --- /dev/null +++ b/meta-citadel-distro/recipes-core/default-user-rootfs/default-user-rootfs.bb @@ -0,0 +1,19 @@ + +DESCRIPTION = "" +HOMEPAGE = "" +LICENSE = "" +SECTION = "" +DEPENDS = "" + +SRC_URI = "file://default-user-rootfs.service" + +S = "${WORKDIR}" + +do_install() { + install -d ${D}${sysconfdir}/systemd/system + install -m 644 ${WORKDIR}/default-user-rootfs.service ${D}${sysconfdir}/systemd/system +} + +pkt_postinst_${PN}() { + systemctl --root=$D enable default-user-rootfs +} diff --git a/meta-citadel-distro/recipes-core/default-user-rootfs/files/default-user-rootfs.service b/meta-citadel-distro/recipes-core/default-user-rootfs/files/default-user-rootfs.service new file mode 100644 index 0000000..df25021 --- /dev/null +++ b/meta-citadel-distro/recipes-core/default-user-rootfs/files/default-user-rootfs.service @@ -0,0 +1,13 @@ +[Unit] +Description=Default User Image +ConditionPathExists=/storage/machines/default-user-rootfs + +[Service] +ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --directory=/storage/machines/default-user-rootfs +KillMode=mixed +Type=notify +RestartForceExitStatus=133 +SuccessExitStatus=133 + +[Install] +WantedBy=multi-user.target diff --git a/meta-citadel-distro/recipes-core/packagegroups/packagegroup-citadel-desktop.bb b/meta-citadel-distro/recipes-core/packagegroups/packagegroup-citadel-desktop.bb index a37481b..977ad27 100644 --- a/meta-citadel-distro/recipes-core/packagegroups/packagegroup-citadel-desktop.bb +++ b/meta-citadel-distro/recipes-core/packagegroups/packagegroup-citadel-desktop.bb @@ -74,4 +74,5 @@ RDEPENDS_${PN} = "\ cryptsetup \ e2fsprogs \ dosfstools \ + default-user-rootfs \ "