diff options
author | Maxin B. John <maxin.john@intel.com> | 2017-06-12 18:10:22 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-14 14:44:59 +0100 |
commit | 732e1f74bb9f5ecc98b29197f6bcab117710adab (patch) | |
tree | ef53a76960cbc6f9e4e02d90f746560406b2ace8 /meta/recipes-connectivity/connman/connman.inc | |
parent | d9b6d538e3d81ab0d5e7b7b6adecef555d782217 (diff) | |
download | openembedded-core-contrib-732e1f74bb9f5ecc98b29197f6bcab117710adab.tar.gz |
connman: correct the systemd boot in read only rootfs
connman fails to start in systemd based read-only images while creating links:
Jun 08 12:53:56 qemux86-64 systemd[1]: Starting Create Volatile Files
and Directories...
Jun 08 12:53:56 qemux86-64 systemd-tmpfiles[366]:
[[0;1;31msymlink(/var/run/connman/resolv.conf, /etc/resolv.conf) failed:
Read-only file system[[0m
Fix this failure and make connman co-exist with systemd-resolved.
Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/connman/connman.inc')
-rw-r--r-- | meta/recipes-connectivity/connman/connman.inc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc index cc2d46935d..ab18f2fe01 100644 --- a/meta/recipes-connectivity/connman/connman.inc +++ b/meta/recipes-connectivity/connman/connman.inc @@ -13,7 +13,7 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36" -inherit autotools pkgconfig systemd update-rc.d bluetooth +inherit autotools pkgconfig systemd update-rc.d bluetooth update-alternatives DEPENDS = "dbus glib-2.0 ppp readline" @@ -69,6 +69,11 @@ SYSTEMD_SERVICE_${PN} = "connman.service" SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service" SYSTEMD_SERVICE_${PN}-wait-online = "connman-wait-online.service" +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} ="resolv-conf" +ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.connman" +ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf" + do_install_append() { if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then install -d ${D}${sysconfdir}/init.d @@ -89,6 +94,14 @@ do_install_append() { # Automake 1.12 won't install empty directories, but we need the # plugins directory to be present for ownership mkdir -p ${D}${libdir}/connman/plugins + + # For read-only filesystem, do not create links during bootup + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + if ${@bb.utils.contains('IMAGE_FEATURES','read-only-rootfs','true','false',d)}; then + echo "d /var/run/connman - - - -" > ${D}${sysconfdir}/tmpfiles.d/connman_resolvconf.conf + fi + ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman + fi } # These used to be plugins, but now they are core |