<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 12:30 AM, Andreas Oberritter <span dir="ltr">&lt;<a href="mailto:obi@opendreambox.org" target="_blank">obi@opendreambox.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="gmail-m_-1762581467229495523gmail-">On 11.10.2016 21:34, Christopher Larson wrote:<br>
&gt;<br>
&gt; On Tue, Oct 11, 2016 at 12:03 PM, Jagadeesh Krishnanjanappa<br>
</span><span class="gmail-m_-1762581467229495523gmail-">&gt; &lt;<a href="mailto:jkrishnanjanappa@mvista.com" target="_blank">jkrishnanjanappa@mvista.com</a> &lt;mailto:<a href="mailto:jkrishnanjanappa@mvista.com" target="_blank">jkrishnanjanappa@mvist<wbr>a.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On Tue, Oct 11, 2016 at 9:06 PM, Christopher Larson<br>
</span><span class="gmail-m_-1762581467229495523gmail-">&gt;     &lt;<a href="mailto:clarson@kergoth.com" target="_blank">clarson@kergoth.com</a> &lt;mailto:<a href="mailto:clarson@kergoth.com" target="_blank">clarson@kergoth.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;         On Tue, Oct 11, 2016 at 5:11 AM, Jagadeesh Krishnanjanappa<br>
&gt;         &lt;<a href="mailto:jkrishnanjanappa@mvista.com" target="_blank">jkrishnanjanappa@mvista.com</a><br>
</span><span class="gmail-m_-1762581467229495523gmail-">&gt;         &lt;mailto:<a href="mailto:jkrishnanjanappa@mvista.com" target="_blank">jkrishnanjanappa@mvis<wbr>ta.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;             Thanks for reviewing the patch.<br>
&gt;<br>
&gt;<br>
&gt;                 I think this is too fragile to land in OE-Core. What<br>
&gt;                 happens if a<br>
&gt;                 network driver prints &quot;device=eth0&quot;? Or if other kernel<br>
&gt;                 messages make<br>
&gt;                 the string disappear from dmesg and connman gets<br>
&gt;                 restarted later?<br>
&gt;<br>
&gt;<br>
&gt;             True. If device=eth0 gets disappeared/corrupted, then we may<br>
&gt;             have problem.<br>
&gt;<br>
&gt;<br>
&gt;                 FWIW, I&#39;m attaching my current wrapper script for<br>
&gt;                 connmand. I don&#39;t<br>
&gt;                 think it&#39;s perfect, but at least it doesn&#39;t depend on<br>
&gt;                 any init manager<br>
&gt;                 and works across restarts.<br>
&gt;<br>
&gt;             The wrapper script attached by you, takes care of the<br>
&gt;             missing scenarios. Seems to be more complete.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;                 Add these lines to connman&#39;s do_install, in case you&#39;d<br>
&gt;                 like to test<br>
&gt;                 and/or submit it:<br>
&gt;<br>
&gt;                 mv ${D}${sbindir}/connmand ${D}${sbindir}/connmand.real<br>
&gt;                 install -m 755 ${WORKDIR}/<a href="http://connmand-nfsroot.in" rel="noreferrer" target="_blank">connmand-nfsroot.in</a><br>
</span>&gt;                 &lt;<a href="http://connmand-nfsroot.in" rel="noreferrer" target="_blank">http://connmand-nfsroot.in</a>&gt; ${D}${sbindir}/connmand<br>
<span class="gmail-m_-1762581467229495523gmail-">&gt;                 sed -e &#39;s,@sbindir@,${sbindir},g&#39; -i ${D}${sbindir}/connmand<br>
&gt;<br>
&gt;             I think it would be good idea to integrate your changes into<br>
&gt;             the already existing OE-core&#39;s connman script, instead of a<br>
&gt;             calling original connman script from the wrapper script.<br>
&gt;<br>
&gt;<br>
&gt;         I threw<br>
&gt;         together <a href="https://github.com/openembedded/openembedded-core/compare/master...kergoth:connman-systemd-nfs" rel="noreferrer" target="_blank">https://github.com/openembedde<wbr>d/openembedded-core/compare/<wbr>master...kergoth:connman-<wbr>systemd-nfs</a><br>
&gt;         &lt;<a href="https://github.com/openembedded/openembedded-core/compare/master...kergoth:connman-systemd-nfs" rel="noreferrer" target="_blank">https://github.com/openembed<wbr>ded/openembedded-core/compare/<wbr>master...kergoth:connman-<wbr>systemd-nfs</a>&gt; last<br>
&gt;         night, only limited testing. I think using a script in<br>
&gt;         libexecdir is rather cleaner than wrapping connmand in place,<br>
&gt;         for something like this, personally.<br>
&gt;<br>
&gt;<br>
&gt;     In the above commit,  the last line of connman/connman/start-connman<br>
&gt;     file, should be exec @SBINDIR@/connmand &quot;$@&quot; instead of exec<br>
&gt;     @SBINDIR@/connman &quot;$@&quot; ; as the actual binary file name is connmand.<br>
&gt;<br>
&gt;<br>
&gt; Thanks, didn’t notice that. Obviously it needs polish and testing before<br>
&gt; submission, I mainly linked it to solicit thoughts on the approach :)<br>
<br>
</span>your proposal adds some complexity to the recipe, which I tried to<br>
avoid, because this wrapper script is something we&#39;ll probably have to<br>
maintain forever.<br>
<br>
For example, your recipe might break without notice if upstream is going<br>
to ship another binary as ${sbindir}/connmand-something in the future;<br>
or if upstream decides to change the systemd unit to use a variable<br>
instead of a hardcoded path to connmand.<br>
<br>
Besides that, I don&#39;t have a strong opinion on the location of the<br>
wrapper script.</blockquote><div><br></div><div>Good points. I think the future-proofing could be addressed with something like sed -i -e &quot;s#^ExecStart=.*#ExecStart=$wrapperpath#&quot; ${D}${systemd_unitdir}/system/connman.service, and then switch away from that weak start-connman script in favor of yours, but keep it in libexec for cleanliness.</div></div>-- <br><div class="gmail-m_-1762581467229495523gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>