summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dragomir <Daniel.Dragomir@windriver.com>2021-01-07 03:53:37 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2021-01-10 23:23:55 -0500
commit33ebe1ac39bd1a4d1594413b7e5a89698149352b (patch)
tree14943ae61e08f42d22a2312f1409d1a63df8cfab
parent29a8122f479c7ae1a7200f4f0e692b5af8283209 (diff)
downloadmeta-virtualization-33ebe1ac39bd1a4d1594413b7e5a89698149352b.tar.gz
lxc: Fix postinstall script for read-only rootfs
Ensure postinstall script for lxc-networking package can run at build time for a read-only rootfs (with sysvinit). Signed-off-by: Daniel Dragomir <Daniel.Dragomir@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/lxc/lxc_4.0.4.bb8
1 files changed, 4 insertions, 4 deletions
diff --git a/recipes-containers/lxc/lxc_4.0.4.bb b/recipes-containers/lxc/lxc_4.0.4.bb
index 4ef5fc0f..19b40f6b 100644
--- a/recipes-containers/lxc/lxc_4.0.4.bb
+++ b/recipes-containers/lxc/lxc_4.0.4.bb
@@ -173,9 +173,9 @@ pkg_postinst_${PN}() {
173 fi 173 fi
174} 174}
175 175
176pkg_postinst_ontarget_${PN}-networking() { 176pkg_postinst_${PN}-networking() {
177if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 177if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
178cat >> /etc/network/interfaces << EOF 178cat >> $D/etc/network/interfaces << EOF
179 179
180auto lxcbr0 180auto lxcbr0
181iface lxcbr0 inet dhcp 181iface lxcbr0 inet dhcp
@@ -184,7 +184,7 @@ iface lxcbr0 inet dhcp
184 bridge_maxwait 0 184 bridge_maxwait 0
185EOF 185EOF
186 186
187cat<<EOF>/etc/network/if-pre-up.d/lxcbr0 187cat<<EOF>$D/etc/network/if-pre-up.d/lxcbr0
188#! /bin/sh 188#! /bin/sh
189 189
190if test "x\$IFACE" = xlxcbr0 ; then 190if test "x\$IFACE" = xlxcbr0 ; then
@@ -197,6 +197,6 @@ if test "x\$IFACE" = xlxcbr0 ; then
197 fi 197 fi
198fi 198fi
199EOF 199EOF
200chmod 755 /etc/network/if-pre-up.d/lxcbr0 200chmod 755 $D/etc/network/if-pre-up.d/lxcbr0
201fi 201fi
202} 202}