<div dir="ltr">Hi<br><div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div class="gmail-m_-8033413996440123836moz-cite-prefix">
      commit 00e4662e55f66570cae29240c22b4d74b79d3ca5
      <br>
      Author: Maxin B. John <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:maxin.john@intel.com" target="_blank">&lt;maxin.john@intel.com&gt;</a>
      <br>
      Date:   Mon Jun 12 18:10:21 2017 +0300
      <br>
      <br>
          systemd: enable resolved and networkd
      <br>
      <br>
          Enable systemd-resolved and systemd-networkd by default.
      <br>
          Make it co-exist with connman and  Fix associated problems
      <br>
          in read-only rootfs.
      <br>
      <br></div></div></blockquote><div><br></div><div>This part of the patch does nothing with the current version of systemd (or does the wrong thing)<br></div><div><br></div><div><br></div><div>        else<br>                sed -i -e &quot;s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g&quot; ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf<br>+               ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd<br>        fi</div></div><div class="gmail_quote"><br></div><div class="gmail_quote">the check here was</div><div class="gmail_quote"><br></div><div class="gmail_quote">     if ! ${@bb.utils.contains(&#39;PACKAGECONFIG&#39;, &#39;resolved&#39;, &#39;true&#39;, &#39;false&#39;, d)}; then<br></div><div class="gmail_quote">apart from the part that the check is REVERSED ...<br></div><div class="gmail_quote">if the PACKAGECONFIG doesn&#39;t contain the resolved option systemd-resolved is not build and no modification is done on the /lib/tmpfiles/etc/conf</div><div class="gmail_quote"><br></div><div class="gmail_quote">see<br></div><div class="gmail_quote"><a href="https://github.com/systemd/systemd/blob/46659f7deb962f55c728e70597e37c2a3ab6326d/tmpfiles.d/etc.conf.m4#L16">https://github.com/systemd/systemd/blob/46659f7deb962f55c728e70597e37c2a3ab6326d/tmpfiles.d/etc.conf.m4#L16</a><br></div><div class="gmail_quote"><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container"><tbody><tr><td id="gmail-LC16" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line gmail-highlighted">m4_ifdef(`ENABLE_RESOLVE&#39;,</td>
      </tr>
      <tr>
        </tr></tbody></table><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container"><tbody><tr><td id="gmail-LC17" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line">L! /etc/resolv.conf - - - - ../run/systemd/resolve/stub-resolv.conf</td>
      </tr>
      <tr>
        </tr></tbody></table>)m4_dnl<br></div><div class="gmail_quote"><br></div>So the else branch can be safely removed.<br></div><div></div><div><br></div><div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div class="gmail-m_-8033413996440123836moz-cite-prefix"> 
      commit 669edd04432f8e76e32bd7f34f4d9aa63eef4038
      <br>
      Author: Khem Raj <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:raj.khem@gmail.com" target="_blank">&lt;raj.khem@gmail.com&gt;</a>
      <br>
      Date:   Fri Dec 16 14:07:31 2016 -0800
      <br>
      <br>
          systemd: point to correct resolv.conf when resolved is enabled
      <br>
      <br>
          latest systemd has changed the resolved defaults which points
      to
      <br>
          127.0.0.53 port 53 on local network. If someone wants to use
      <br>
          host-local IP address then it can be pointed to copy in
      /lib/systemd
      <br>
      <br>
          (From OE-Core rev: 99d1199fd0961f94732a1a533d66472ca17cf6f5)
      <br>
      <br>
          Signed-off-by: Khem Raj <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:raj.khem@gmail.com" target="_blank">&lt;raj.khem@gmail.com&gt;</a>
      <br>
          Signed-off-by: Ross Burton <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:ross.burton@intel.com" target="_blank">&lt;ross.burton@intel.com&gt;</a>
      <br>
          Signed-off-by: Richard Purdie <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:richard.purdie@linuxfoundation.org" target="_blank">&lt;richard.purdie@linuxfoundation.org&gt;</a>
      <br>
      <br></div></div></blockquote><div><br></div><div>So here the error was introduced!!!!! read this patch carefully</div><div>If you read the deleted comment it was saying:</div><div><b>if resolved is disabled</b>,</div><div>But this patch reverse it to <br></div><div><br></div><div style="margin-left:40px">systemd: point to correct resolv.conf when resolved <b>is enabled</b></div><br><div>        if ! ${@bb.utils.contains(&#39;PACKAGECONFIG&#39;, &#39;resolved&#39;, &#39;true&#39;, &#39;false&#39;, d)}; then<br>-               # <b>if resolved is disabled</b>, it won&#39;t handle the link of resolv.conf, so<br>-               # set it up ourselves<br>-               ln -s ../run/resolv.conf ${D}${sysconfdir}/resolv.conf<br>-               echo &#39;<b>L! ${sysconfdir}/resolv.conf - - - - ../run/resolv.conf&#39;</b> &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/etc.conf<br>-               echo &#39;f /run/resolv.conf 0644 root root&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf<br>+               echo<b> &#39;L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf&#39;</b> &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/etc.conf<br>+               echo &#39;d /run/systemd/resolve 0755 root root -&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf<br>+               echo &#39;f /run/systemd/resolve/resolv.conf 0644 root root&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf<br>+               ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv.conf<br>+       else<br>+               sed -i -e &quot;s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g&quot; ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf<br>        fi<br>        install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install<br> }<br><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div class="gmail-m_-8033413996440123836moz-cite-prefix">
      commit b80da02ce9b683f96393fe0ea1f5f1a5f1a07c89
      <br>
      Author: Christopher Larson <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:chris_larson@mentor.com" target="_blank">&lt;chris_larson@mentor.com&gt;</a>
      <br>
      Date:   Wed Nov 4 20:19:19 2015 -0700
      <br>
      <br>
          systemd: arrange for volatile /etc/resolv.conf
      <br>
      <br>
          On sysvinit systems, volatiles is configured to make
      /etc/resolv.conf symlink
      <br>
          to a file in a volatile path, which lets us write to
      /etc/resolv.conf for
      <br>
          read-only-rootfs. For systemd, this isn&#39;t set up unless we
      enable
      <br>
          systemd-resolved, which we don&#39;t by default. When it&#39;s not
      enabled, create the
      <br>
          /etc/resolv.conf symlink and ensure the volatile path is
      created on boot with
      <br>
          tmpfiles.d.
      <br>
      <br></div></div></blockquote><div><br></div><div>+       if ! ${@bb.utils.contains(&#39;PACKAGECONFIG&#39;, &#39;resolved&#39;, &#39;true&#39;, &#39;false&#39;, d)}; then<br>+               # if resolved is disabled, it won&#39;t handle the link of resolv.conf, so<br>+               # set it up ourselves<br>+               ln -s ../run/resolv.conf ${D}${sysconfdir}/resolv.conf<br>+               echo &#39;L! ${sysconfdir}/resolv.conf - - - - ../run/resolv.conf&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/etc.conf<br>+               echo &#39;f /run/resolv.conf 0644 root root&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf<br>+       fi<br>        install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install<br> }<br><br></div><div>This patch was the right one the following 669edd04432f8e76e32bd7f34f4d9aa63eef4038 reversed the sense of the switch</div><div><br></div><div>Regards</div><div>Nicola Lunghi<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div class="gmail-m_-8033413996440123836moz-cite-prefix">
      Best Regards,<br>
      Chen Qi<br>
      <br>
      <br>
      On 07/16/2018 04:17 PM, Nicola Lunghi wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>From: Nicola Lunghi <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:nicola.lunghi@jci.com" target="_blank">&lt;nicola.lunghi@jci.com&gt;</a>

if resolved option is not selected the package systemd-resolved
is not installed so it cannot provide an alternative for
resolv.conf

In this recipe the previous check was instead reversing the check (note the !).

This patch avoid messing with resol.conf link if resolved is disabled in
the package config.

This in particular if we compile systemd with musl where systemd-resolved
cannot be compiled.

Signed-off-by: Nicola Lunghi <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:nicola.lunghi@jci.com" target="_blank">&lt;nicola.lunghi@jci.com&gt;</a>
---
 meta/recipes-core/systemd/<a href="http://systemd_237.bb" target="_blank">systemd_237.bb</a> | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/systemd/<a href="http://systemd_237.bb" target="_blank">systemd_237.bb</a> b/meta/recipes-core/systemd/<a href="http://systemd_237.bb" target="_blank">systemd_237.bb</a>
index 3efca33e73..bd6dcef637 100644
--- a/meta/recipes-core/systemd/<a href="http://systemd_237.bb" target="_blank">systemd_237.bb</a>
+++ b/meta/recipes-core/systemd/<a href="http://systemd_237.bb" target="_blank">systemd_237.bb</a>
@@ -258,14 +258,11 @@ do_install() {
         if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
                 ${@bb.utils.contains(&#39;PACKAGECONFIG&#39;, &#39;networkd&#39;, &#39;:&#39;, &#39;sed -i -e &quot;\$ad /run/systemd/netif/links 0755 root root -&quot; ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf&#39;, d)}
         fi
-        if ! ${@bb.utils.contains(&#39;PACKAGECONFIG&#39;, &#39;resolved&#39;, &#39;true&#39;, &#39;false&#39;, d)}; then
+        if ${@bb.utils.contains(&#39;PACKAGECONFIG&#39;, &#39;resolved&#39;, &#39;true&#39;, &#39;false&#39;, d)}; then
                 echo &#39;L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
                 echo &#39;d /run/systemd/resolve 0755 root root -&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
                 echo &#39;f /run/systemd/resolve/resolv.conf 0644 root root&#39; &gt;&gt;${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
                 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
-        else
-                sed -i -e &quot;s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g&quot; ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
-                ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
         fi
         install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
 
@@ -539,7 +536,7 @@ python __anonymous() {
 # TODO:
 # u-a for runlevel and telinit
 
-ALTERNATIVE_${PN} = &quot;init halt reboot shutdown poweroff runlevel resolv-conf&quot;
+ALTERNATIVE_${PN} = &quot;init halt reboot shutdown poweroff runlevel&quot;
 
 ALTERNATIVE_TARGET[init] = &quot;${rootlibexecdir}/systemd/systemd&quot;
 ALTERNATIVE_LINK_NAME[init] = &quot;${base_sbindir}/init&quot;
@@ -565,6 +562,7 @@ ALTERNATIVE_TARGET[runlevel] = &quot;${base_bindir}/systemctl&quot;
 ALTERNATIVE_LINK_NAME[runlevel] = &quot;${base_sbindir}/runlevel&quot;
 ALTERNATIVE_PRIORITY[runlevel] ?= &quot;300&quot;
 
+ALTERNATIVE_${PN} += <a class="gmail-m_-8033413996440123836moz-txt-link-rfc2396E" href="mailto:$%7B@bb.utils.contains(&#39;PACKAGECONFIG&#39;,&#39;resolved&#39;,&#39;resolv-conf&#39;,&#39;&#39;,d)%7D" target="_blank">&quot;${@bb.utils.contains(&#39;PACKAGECONFIG&#39;, &#39;resolved&#39;, &#39;resolv-conf&#39;, &#39;&#39;, d)}&quot;</a>
 ALTERNATIVE_TARGET[resolv-conf] = &quot;${sysconfdir}/resolv-conf.systemd&quot;
 ALTERNATIVE_LINK_NAME[resolv-conf] = &quot;${sysconfdir}/resolv.conf&quot;
 ALTERNATIVE_PRIORITY[resolv-conf] ?= &quot;50&quot;
</pre>
    </blockquote>
    <p><br>
    </p>
  </div>

-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div></div><div><br></div></div>