Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Patrick Ohly <patrick.ohly@intel.com>
To: "Maxin B. John" <maxin.john@intel.com>,
	 openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/2] connman: correct the systemd boot in read only rootfs
Date: Fri, 24 Nov 2017 13:03:19 +0100	[thread overview]
Message-ID: <1511524999.5979.62.camel@intel.com> (raw)
In-Reply-To: <1497280222-11549-3-git-send-email-maxin.john@intel.com>

On Mon, 2017-06-12 at 18:10 +0300, Maxin B. John wrote:
> 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>
> ---
>  meta/recipes-connectivity/connman/connman.inc      | 15 ++++++++++-
>  ...vice-stop-systemd-resolved-when-we-use-co.patch | 29
> ++++++++++++++++++++++
>  meta/recipes-connectivity/connman/connman_1.34.bb  |  1 +
>  3 files changed, 44 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-connectivity/connman/connman/0001-
> connman.service-stop-systemd-resolved-when-we-use-co.patch
> 
> diff --git a/meta/recipes-connectivity/connman/connman.inc
> b/meta/recipes-connectivity/connman/connman.inc
> index cc2d469..ab18f2f 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=486
> a279a6ab0c8d152bcda3a5b5edc36"
>  
> -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','fals
> e',d)}; then
> +        if ${@bb.utils.contains('IMAGE_FEATURES','re
> ad-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
>  }

This check for 'IMAGE_FEATURES' is bogus: that's a per-image recipe
variable, which can't be assumed to be set consistently for all images
in the base configuration and therefore the connman recipe can't depend
 on it. The effect is that the tmpfiles.d entry doesn't get created
when setting IMAGE_FEATURES only for some images.

It still works for me (refkit, based on OE-core Rocko at the moment).
Something has created /var/run/connman (perhaps connman itself?) and
the resolv.conf inside it, so /etc/resolv.conf -> /etc/resolv-
conf.connman -> ../run/connman/resolv.conf = /run/connman/resolv.conf
exists.

But the bogus lines should be removed nonetheless, because it causes
the connman recipe to depend on IMAGE_FEATURES.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.




      reply	other threads:[~2017-11-24 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 15:10 [PATCH 0/2] [RFC] fix systemd-resolved and connman boot in read only rootfs Maxin B. John
2017-06-12 15:10 ` [PATCH 1/2] systemd: enable resolved and networkd Maxin B. John
2017-07-06 15:12   ` Patrick Ohly
2017-07-07  8:10     ` Maxin B. John
2017-06-12 15:10 ` [PATCH 2/2] connman: correct the systemd boot in read only rootfs Maxin B. John
2017-11-24 12:03   ` Patrick Ohly [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511524999.5979.62.camel@intel.com \
    --to=patrick.ohly@intel.com \
    --cc=maxin.john@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox