recipe to add systemd service to start user-rootfs container

This commit is contained in:
brl 2018-02-04 23:18:51 -05:00
parent 3fff10ccb3
commit 7302050e6d
3 changed files with 33 additions and 0 deletions

View File

@ -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
}

View File

@ -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

View File

@ -74,4 +74,5 @@ RDEPENDS_${PN} = "\
cryptsetup \
e2fsprogs \
dosfstools \
default-user-rootfs \
"