aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity
diff options
context:
space:
mode:
authorDrew Moseley <drew.moseley@northern.tech>2019-07-19 19:58:56 +0000
committerKhem Raj <raj.khem@gmail.com>2019-07-21 09:31:09 -0700
commit3982dc5b1994ffcc52336b02fbd2c44db164dd82 (patch)
tree49e65a52455388ebb5ec63e77d4b57d5e9aaabfd /meta-networking/recipes-connectivity
parent163202e10edfb487194b2a6943a128848d2c8dd7 (diff)
downloadmeta-openembedded-3982dc5b1994ffcc52336b02fbd2c44db164dd82.tar.gz
meta-openembedded-3982dc5b1994ffcc52336b02fbd2c44db164dd82.tar.bz2
meta-openembedded-3982dc5b1994ffcc52336b02fbd2c44db164dd82.zip
networkmanager: Use ALTERNATIVES for resolv-conf handling.
This brings the networkmanager in sync with how systemd-resolved and connman work. Additionally this allows it to function with a read-only rootFS. Signed-off-by: Drew Moseley <drew.moseley@northern.tech> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-connectivity')
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager_1.18.0.bb12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.18.0.bb b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.18.0.bb
index 21fbea9c1..037566783 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.18.0.bb
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.18.0.bb
@@ -20,7 +20,7 @@ DEPENDS = " \
curl \
"
-inherit gnomebase gettext systemd bash-completion vala gobject-introspection gtk-doc
+inherit gnomebase gettext systemd bash-completion vala gobject-introspection gtk-doc update-alternatives
SRC_URI = " \
${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
@@ -141,6 +141,16 @@ FILES_${PN}-nmtui-doc = " \
SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'NetworkManager.service NetworkManager-dispatcher.service', '', d)}"
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
+ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.NetworkManager','',d)}"
+ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
+
do_install_append() {
rm -rf ${D}/run ${D}${localstatedir}/run
+
+ # For read-only filesystem, do not create links during bootup
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ ln -sf ../run/NetworkManager/resolv.conf ${D}${sysconfdir}/resolv-conf.NetworkManager
+ fi
}