<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 12:30 PM, Andreas Oberritter <span dir="ltr"><<a href="mailto:obi@opendreambox.org" target="_blank">obi@opendreambox.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jagadeesh,<br>
<span class=""><br>
On 11.10.2016 14:11, Jagadeesh Krishnanjanappa wrote:<br>
> Hi Andreas,<br>
><br>
> Thanks for reviewing the patch.<br>
><br>
><br>
> I think this is too fragile to land in OE-Core. What happens if a<br>
> network driver prints "device=eth0"? Or if other kernel messages make<br>
> the string disappear from dmesg and connman gets restarted later?<br>
><br>
><br>
> True. If device=eth0 gets disappeared/corrupted, then we may have problem.<br>
><br>
><br>
> FWIW, I'm attaching my current wrapper script for connmand. I don't<br>
> think it's perfect, but at least it doesn't depend on any init manager<br>
> and works across restarts.<br>
><br>
> The wrapper script attached by you, takes care of the missing scenarios.<br>
> Seems to be more complete.<br>
><br>
><br>
><br>
> Add these lines to connman's do_install, in case you'd like to test<br>
> and/or submit it:<br>
><br>
> mv ${D}${sbindir}/connmand ${D}${sbindir}/connmand.real<br>
> install -m 755 ${WORKDIR}/<a href="http://connmand-nfsroot.in" rel="noreferrer" target="_blank">connmand-nfsroot.in</a><br>
</span>> <<a href="http://connmand-nfsroot.in" rel="noreferrer" target="_blank">http://connmand-nfsroot.in</a>> ${D}${sbindir}/connmand<br>
<span class="">> sed -e 's,@sbindir@,${sbindir},g' -i ${D}${sbindir}/connmand<br>
><br>
> I think it would be good idea to integrate your changes into the already<br>
> existing OE-core's connman script, instead of a calling original connman<br>
> script from the wrapper script.<br>
<br>
</span>please keep in mind that you'd need to implement the same logic for systemd.<br>
<br>
Considering that the execution of connman on nfsroots without<br>
appropriate parameters immediately hangs the system, a wrapper script<br>
offers an additional level of protection compared to an init script or<br>
systemd unit, especially for people debugging connman.<br>
<br></blockquote><div>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.</div><div><br></div><div>Thanks,</div><div>Jagadeesh</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
Andreas<br>
<span class=""><br>
><br>
> Regards,<br>
> Jagadeesh<br>
><br>
> ><br>
> > Signed-off-by: Jagadeesh Krishnanjanappa<br>
</span>> <<a href="mailto:jkrishnanjanappa@mvista.com">jkrishnanjanappa@mvista.com</a> <mailto:<a href="mailto:jkrishnanjanappa@mvista.com">jkrishnanjanappa@<wbr>mvista.com</a>>><br>
<div><div class="h5">> > ---<br>
> > meta/recipes-connectivity/<wbr>connman/connman/connman | 35<br>
> +++++++++++++----------<br>
> > 1 file changed, 20 insertions(+), 15 deletions(-)<br>
> ><br>
> > diff --git a/meta/recipes-connectivity/<wbr>connman/connman/connman<br>
> b/meta/recipes-connectivity/<wbr>connman/connman/connman<br>
> > index c64fa0d..aae2ca6 100644<br>
> > --- a/meta/recipes-connectivity/<wbr>connman/connman/connman<br>
> > +++ b/meta/recipes-connectivity/<wbr>connman/connman/connman<br>
> > @@ -29,23 +29,28 @@ done<br>
> > do_start() {<br>
> > EXTRA_PARAM=""<br>
> > if test $nfsroot -eq 1 ; then<br>
> > - NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9<br>
> ]*\):.*$/\1/p'`<br>
> > - NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^<br>
> :]*\).*$/\1/p'`<br>
> > + ethn_from_dmesg=`dmesg | grep "device="| sed<br>
> "s|\(.*\)device=\(.*\), hwaddr=\(.*\)|\2|g"`<br>
> > + if [ ! -z "$ethn_from_dmesg" ]; then<br>
> > + EXTRA_PARAM="-I $ethn_from_dmesg"<br>
> > + else<br>
> > + NET_DEVS=`cat /proc/net/dev | sed -ne<br>
> 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`<br>
> > + NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^<br>
> :]*\).*$/\1/p'`<br>
> ><br>
> > - if [ ! -z "$NET_ADDR" ]; then<br>
> > - if [ "$NET_ADDR" = dhcp ]; then<br>
> > - ethn=`ifconfig | grep "^eth" | sed -e<br>
> "s/\(eth[0-9]\)\(.*\)/\1/"`<br>
> > - if [ ! -z "$ethn" ]; then<br>
> > - EXTRA_PARAM="-I $ethn"<br>
> > - fi<br>
> > - else<br>
> > - for i in $NET_DEVS; do<br>
> > - ADDR=`ifconfig $i | sed 's/addr://g' | sed<br>
> -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`<br>
> > - if [ "$NET_ADDR" = "$ADDR" ]; then<br>
> > - EXTRA_PARAM="-I $i"<br>
> > - break<br>
> > + if [ ! -z "$NET_ADDR" ]; then<br>
> > + if [ "$NET_ADDR" = dhcp ]; then<br>
> > + ethn=`ifconfig | grep "^eth" | sed -e<br>
> "s/\(eth[0-9]\)\(.*\)/\1/"`<br>
> > + if [ ! -z "$ethn" ]; then<br>
> > + EXTRA_PARAM="-I $ethn"<br>
> > fi<br>
> > - done<br>
> > + else<br>
> > + for i in $NET_DEVS; do<br>
> > + ADDR=`ifconfig $i | sed 's/addr://g' |<br>
> sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`<br>
> > + if [ "$NET_ADDR" = "$ADDR" ]; then<br>
> > + EXTRA_PARAM="-I $i"<br>
> > + break<br>
> > + fi<br>
> > + done<br>
> > + fi<br>
> > fi<br>
> > fi<br>
> > fi<br>
> ><br>
><br>
><br>
> --<br>
> ______________________________<wbr>_________________<br>
> Openembedded-core mailing list<br>
> <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
</div></div>> <mailto:<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@<wbr>lists.openembedded.org</a>><br>
> <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
> <<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.<wbr>org/mailman/listinfo/<wbr>openembedded-core</a>><br>
><br>
><br>
<br>
</blockquote></div><br></div></div>