summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2017-12-22 15:57:44 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-12-28 11:12:26 -0500
commit00a801aee140c91ae968ffad271fc85702ff80ff (patch)
tree41d465a0c6515d838ef3d73c252c4da0e1e6125f /recipes-containers/lxc
parent9390b98ba54904b8ad8e6b0af3a70e3cf540479c (diff)
downloadmeta-virtualization-00a801aee140c91ae968ffad271fc85702ff80ff.tar.gz
dnsmasq: add dnsmasq.d entries for lxc and libvirt
A while ago changes were merged to meta-openembedded to make /etc/dnsmasq.d (and specifically the files it contains) referenced when the main instance of dnsmasq is run (see dnsmasq.service and commit ba665493a0dd [dnsmasq: allow for dnsmasq instances to reuse default dnsmasq.conf]). We, however, continued to modify the global configuration (/etc/dnsmasq.conf) to keep the main instance of dnsmasq from attaching to virbr0 and lxcbr0, by using 'bind-dynamic'. This approach is problematic, since it is common that other instances of dnsmasq will make use of the global configuration file and may have incompatible options. We see this for example when attempting to start lxc-net which will attempt to use 'bind-interface' which is incompatible with 'bind-dynamic' that we were adding to the global configuration. Here we remove our change to the global configuration (leaving it mostly empty as it should be) and instead have lxc and libvirt packages instruct the global instance not to bind to virbr0 and lxcbr0 by adding configuration files to /etc/dnsmasq.d (setting except-interface). The added benefit to this approach is that if lxc or libvirt are not part of an image the global configuration will not be modified in such a way as to expect that they are present. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/lxc')
-rw-r--r--recipes-containers/lxc/files/dnsmasq.conf2
-rw-r--r--recipes-containers/lxc/lxc_2.0.8.bb6
2 files changed, 8 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/dnsmasq.conf b/recipes-containers/lxc/files/dnsmasq.conf
new file mode 100644
index 00000000..124f7ebe
--- /dev/null
+++ b/recipes-containers/lxc/files/dnsmasq.conf
@@ -0,0 +1,2 @@
1bind-interfaces
2except-interface=lxcbr0
diff --git a/recipes-containers/lxc/lxc_2.0.8.bb b/recipes-containers/lxc/lxc_2.0.8.bb
index c9ce5f06..b616e947 100644
--- a/recipes-containers/lxc/lxc_2.0.8.bb
+++ b/recipes-containers/lxc/lxc_2.0.8.bb
@@ -36,6 +36,7 @@ SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
36 file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \ 36 file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
37 file://logs-optionally-use-base-filenames-to-report-src-fil.patch \ 37 file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
38 file://cgroups-work-around-issue-in-gcc-7.patch \ 38 file://cgroups-work-around-issue-in-gcc-7.patch \
39 file://dnsmasq.conf \
39 " 40 "
40 41
41SRC_URI[md5sum] = "7bfd95280522d7936c0979dfea92cdb5" 42SRC_URI[md5sum] = "7bfd95280522d7936c0979dfea92cdb5"
@@ -134,6 +135,11 @@ do_install_append() {
134 if [ -d ${D}${exec_prefix}/lib/python* ]; then mv ${D}${exec_prefix}/lib/python* ${D}${libdir}/; fi 135 if [ -d ${D}${exec_prefix}/lib/python* ]; then mv ${D}${exec_prefix}/lib/python* ${D}${libdir}/; fi
135 rmdir --ignore-fail-on-non-empty ${D}${exec_prefix}/lib 136 rmdir --ignore-fail-on-non-empty ${D}${exec_prefix}/lib
136 fi 137 fi
138
139 # Force the main dnsmasq instance to bind only to specified interfaces and
140 # to not bind to virbr0. Libvirt will run its own instance on this interface.
141 install -d ${D}/${sysconfdir}/dnsmasq.d
142 install -m 644 ${WORKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/lxc
137} 143}
138 144
139EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" 145EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests"