All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
To: Andreas Oberritter <obi@opendreambox.org>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] connman: get the correct network interface name from dmesg during NFS booting
Date: Thu, 13 Oct 2016 07:31:37 +0530	[thread overview]
Message-ID: <CAD3vsf6pyv2=9khhMgvfzzw45KEZD+Ha2MUaA5c3Mw2eF5ApHw@mail.gmail.com> (raw)
In-Reply-To: <7e33af3a-b88b-fc8f-32d1-3f743fea2ac3@opendreambox.org>

[-- Attachment #1: Type: text/plain, Size: 5680 bytes --]

On Wed, Oct 12, 2016 at 12:30 PM, Andreas Oberritter <obi@opendreambox.org>
wrote:

> Hi Jagadeesh,
>
> On 11.10.2016 14:11, Jagadeesh Krishnanjanappa wrote:
> > Hi Andreas,
> >
> > Thanks for reviewing the patch.
> >
> >
> >     I think this is too fragile to land in OE-Core. What happens if a
> >     network driver prints "device=eth0"? Or if other kernel messages make
> >     the string disappear from dmesg and connman gets restarted later?
> >
> >
> > True. If device=eth0 gets disappeared/corrupted, then we may have
> problem.
> >
> >
> >     FWIW, I'm attaching my current wrapper script for connmand. I don't
> >     think it's perfect, but at least it doesn't depend on any init
> manager
> >     and works across restarts.
> >
> > The wrapper script attached by you, takes care of the missing scenarios.
> > Seems to be more complete.
> >
> >
> >
> >     Add these lines to connman's do_install, in case you'd like to test
> >     and/or submit it:
> >
> >     mv ${D}${sbindir}/connmand ${D}${sbindir}/connmand.real
> >     install -m 755 ${WORKDIR}/connmand-nfsroot.in
> >     <http://connmand-nfsroot.in> ${D}${sbindir}/connmand
> >     sed -e 's,@sbindir@,${sbindir},g' -i ${D}${sbindir}/connmand
> >
> > I think it would be good idea to integrate your changes into the already
> > existing OE-core's connman script, instead of a calling original connman
> > script from the wrapper script.
>
> please keep in mind that you'd need to implement the same logic for
> systemd.
>
> Considering that the execution of connman on nfsroots without
> appropriate parameters immediately hangs the system, a wrapper script
> offers an additional level of protection compared to an init script or
> systemd unit, especially for people debugging connman.
>
> The intention of integrating your changes into init script was to avoid an
extra file being added to the layer. But yes, to help debugging and to
support systemd; wrapper script can be helpful.

Thanks,
Jagadeesh

Regards,
> Andreas
>
> >
> > Regards,
> > Jagadeesh
> >
> >     >
> >     > Signed-off-by: Jagadeesh Krishnanjanappa
> >     <jkrishnanjanappa@mvista.com <mailto:jkrishnanjanappa@mvista.com>>
> >     > ---
> >     >  meta/recipes-connectivity/connman/connman/connman | 35
> >     +++++++++++++----------
> >     >  1 file changed, 20 insertions(+), 15 deletions(-)
> >     >
> >     > diff --git a/meta/recipes-connectivity/connman/connman/connman
> >     b/meta/recipes-connectivity/connman/connman/connman
> >     > index c64fa0d..aae2ca6 100644
> >     > --- a/meta/recipes-connectivity/connman/connman/connman
> >     > +++ b/meta/recipes-connectivity/connman/connman/connman
> >     > @@ -29,23 +29,28 @@ done
> >     >  do_start() {
> >     >       EXTRA_PARAM=""
> >     >       if test $nfsroot -eq 1 ; then
> >     > -         NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9
> >     ]*\):.*$/\1/p'`
> >     > -         NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^
> >     :]*\).*$/\1/p'`
> >     > +         ethn_from_dmesg=`dmesg | grep "device="| sed
> >     "s|\(.*\)device=\(.*\), hwaddr=\(.*\)|\2|g"`
> >     > +         if [ ! -z "$ethn_from_dmesg" ]; then
> >     > +             EXTRA_PARAM="-I $ethn_from_dmesg"
> >     > +         else
> >     > +             NET_DEVS=`cat /proc/net/dev | sed -ne
> >     's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
> >     > +             NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^
> >     :]*\).*$/\1/p'`
> >     >
> >     > -         if [ ! -z "$NET_ADDR" ]; then
> >     > -             if [ "$NET_ADDR" = dhcp ]; then
> >     > -                 ethn=`ifconfig | grep "^eth" | sed -e
> >     "s/\(eth[0-9]\)\(.*\)/\1/"`
> >     > -                 if [ ! -z "$ethn" ]; then
> >     > -                     EXTRA_PARAM="-I $ethn"
> >     > -                 fi
> >     > -             else
> >     > -                 for i in $NET_DEVS; do
> >     > -                     ADDR=`ifconfig $i | sed 's/addr://g' | sed
> >     -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
> >     > -                     if [ "$NET_ADDR" = "$ADDR" ]; then
> >     > -                         EXTRA_PARAM="-I $i"
> >     > -                         break
> >     > +             if [ ! -z "$NET_ADDR" ]; then
> >     > +                 if [ "$NET_ADDR" = dhcp ]; then
> >     > +                     ethn=`ifconfig | grep "^eth" | sed -e
> >     "s/\(eth[0-9]\)\(.*\)/\1/"`
> >     > +                     if [ ! -z "$ethn" ]; then
> >     > +                         EXTRA_PARAM="-I $ethn"
> >     >                       fi
> >     > -                 done
> >     > +                 else
> >     > +                     for i in $NET_DEVS; do
> >     > +                         ADDR=`ifconfig $i | sed 's/addr://g' |
> >     sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
> >     > +                         if [ "$NET_ADDR" = "$ADDR" ]; then
> >     > +                             EXTRA_PARAM="-I $i"
> >     > +                             break
> >     > +                         fi
> >     > +                     done
> >     > +                 fi
> >     >               fi
> >     >           fi
> >     >       fi
> >     >
> >
> >
> >     --
> >     _______________________________________________
> >     Openembedded-core mailing list
> >     Openembedded-core@lists.openembedded.org
> >     <mailto:Openembedded-core@lists.openembedded.org>
> >     http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >     <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
> >
> >
>
>

[-- Attachment #2: Type: text/html, Size: 8668 bytes --]

  reply	other threads:[~2016-10-13  2:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 17:35 [PATCH] connman: get the correct network interface name from dmesg during NFS booting Jagadeesh Krishnanjanappa
2016-10-11  7:41 ` Andreas Oberritter
2016-10-11 12:11   ` Jagadeesh Krishnanjanappa
2016-10-11 15:36     ` Christopher Larson
2016-10-11 19:03       ` Jagadeesh Krishnanjanappa
2016-10-11 19:34         ` Christopher Larson
2016-10-12  7:30           ` Andreas Oberritter
2016-10-12 17:49             ` Christopher Larson
2016-10-12 19:08               ` Andreas Oberritter
2016-10-12  7:00     ` Andreas Oberritter
2016-10-13  2:01       ` Jagadeesh Krishnanjanappa [this message]
2016-10-19 18:52         ` Jagadeesh Krishnanjanappa

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='CAD3vsf6pyv2=9khhMgvfzzw45KEZD+Ha2MUaA5c3Mw2eF5ApHw@mail.gmail.com' \
    --to=jkrishnanjanappa@mvista.com \
    --cc=obi@opendreambox.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.