summaryrefslogtreecommitdiffstats
path: root/meta-agl-lxc/recipes-container/lxc
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-lxc/recipes-container/lxc')
-rw-r--r--meta-agl-lxc/recipes-container/lxc/files/lxc.service19
-rw-r--r--meta-agl-lxc/recipes-container/lxc/lxc_4.%.bbappend9
2 files changed, 28 insertions, 0 deletions
diff --git a/meta-agl-lxc/recipes-container/lxc/files/lxc.service b/meta-agl-lxc/recipes-container/lxc/files/lxc.service
new file mode 100644
index 00000000..acf8da39
--- /dev/null
+++ b/meta-agl-lxc/recipes-container/lxc/files/lxc.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=LXC Container Initialization and Autoboot Code
+After=network.target lxc-net.service remote-fs.target drm-lease-manager.service
+Wants=lxc-net.service
+Documentation=man:lxc-autostart man:lxc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStartPre=@LIBEXECDIR@/lxc/lxc-apparmor-load
+ExecStart=@LIBEXECDIR@/lxc/lxc-containers start
+ExecStop=@LIBEXECDIR@/lxc/lxc-containers stop
+ExecReload=@LIBEXECDIR@/lxc/lxc-apparmor-load
+# Environment=BOOTUP=serial
+# Environment=CONSOLETYPE=serial
+Delegate=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl-lxc/recipes-container/lxc/lxc_4.%.bbappend b/meta-agl-lxc/recipes-container/lxc/lxc_4.%.bbappend
index 72078495..b8456f7f 100644
--- a/meta-agl-lxc/recipes-container/lxc/lxc_4.%.bbappend
+++ b/meta-agl-lxc/recipes-container/lxc/lxc_4.%.bbappend
@@ -2,6 +2,15 @@ PACKAGECONFIG:remove = "templates"
SYSTEMD_AUTO_ENABLE:${PN} = "enable"
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://lxc.service"
+
+do_install:append () {
+ install -D -m 0644 ${WORKDIR}/lxc.service ${D}${systemd_system_unitdir}/lxc.service
+ sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_system_unitdir}/lxc.service
+}
+
# NOTE:
# This needs to be replaced with a rework of the upstream packaging
# to do a proper split of core from the template support.