aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-lxc/recipes-container
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-lxc/recipes-container')
-rw-r--r--meta-agl-lxc/recipes-container/lxc/files/lxc-net.service15
-rw-r--r--meta-agl-lxc/recipes-container/lxc/lxc_%.bbappend11
2 files changed, 23 insertions, 3 deletions
diff --git a/meta-agl-lxc/recipes-container/lxc/files/lxc-net.service b/meta-agl-lxc/recipes-container/lxc/files/lxc-net.service
new file mode 100644
index 00000000..1b6e8451
--- /dev/null
+++ b/meta-agl-lxc/recipes-container/lxc/files/lxc-net.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=LXC network bridge setup
+After=network-online.target systemd-resolved.service
+Before=lxc.service
+Documentation=man:lxc
+ConditionVirtualization=!lxc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@LIBEXECDIR@/lxc/lxc-net start
+ExecStop=@LIBEXECDIR@/lxc/lxc-net stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl-lxc/recipes-container/lxc/lxc_%.bbappend b/meta-agl-lxc/recipes-container/lxc/lxc_%.bbappend
index b8456f7f..75ab98c0 100644
--- a/meta-agl-lxc/recipes-container/lxc/lxc_%.bbappend
+++ b/meta-agl-lxc/recipes-container/lxc/lxc_%.bbappend
@@ -4,11 +4,16 @@ SYSTEMD_AUTO_ENABLE:${PN} = "enable"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
-SRC_URI += "file://lxc.service"
+SRC_URI += " \
+ file://lxc.service \
+ file://lxc-net.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
+ for service in lxc.service lxc-net.service; do
+ install -D -m 0644 ${WORKDIR}/$service ${D}${systemd_system_unitdir}/$service
+ sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_system_unitdir}/$service
+ done
}
# NOTE: