<div dir="ltr">Oh, another update to integrate the previous email.<div><br></div><div>Inside the source code of mDNSResponder (<a href="https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.260.1.tar.gz">https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.260.1.tar.gz</a>) I found in "mDNSPosix/Makefile" this:<div><br></div><div>"</div><div>     # Check the nsswitch.conf file.<br>       # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns'<br>    cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns<br>  sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf<br></div><div>"</div><div><br></div><div>Probably, It's better to use this "sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf" instead of the existing one.</div><div><br></div><div>What do you think?</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 4 ott 2019 alle ore 17:04 Stefano Cappa <<a href="mailto:stefano.cappa.ks89@gmail.com">stefano.cappa.ks89@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">I fixed this issue in this way:<div><br></div><div>I modified the recipe replacing this:</div><div>------------------------------<br></div>pkg_postinst_${PN} () {<br>  Â  sed -e '/^hosts:/s/\s*\<mdns\>//' \<br>  Â  Â  Â  -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \<br>  Â  Â  Â  -i $D/etc/nsswitch.conf<br>}<br><br>pkg_prerm_${PN} () {<br>  Â  sed -e '/^hosts:/s/\s*\<mdns\>//' \<br>  Â  Â  Â  -e '/^hosts:/s/\s*mdns//' \<br>  Â  Â  Â  -i $D/etc/nsswitch.conf<br><div>}------------------------------<br></div><div><br></div><div>with this:</div><div>------------------------------</div><div>pkg_postinst_ontarget_${PN} () {</div>  Â  sed -e '/^hosts:/s/\s*\<mdns\>//' \<br>  Â  Â  Â  -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2\3mdns \4\5/' \<br>  Â  Â  Â  -i $D/etc/nsswitch.conf<br>}<br><br>pkg_prerm_ontarget_${PN} () {<br>  Â  sed -e '/^hosts:/s/\s*\<mdns\>//' \<br>  Â  Â  Â  -e '/^hosts:/s/\s*mdns//' \<br>  Â  Â  Â  -i $D/etc/nsswitch.conf<br>}<br><div>------------------------------</div><div><br></div><div><br></div><div>Basically, I added _ontarget_ as suggested by yocto error that says: "... If the intention is to defer them to first boot,</div><div>> then please place them into pkg_postinst_ontarget_${PN} ()....".</div><div><br></div><div>In this way I can build the final image with LICENSE_CREATE_PACKAGE=1. Why? I don't know. I didn't understand why there was this error.<br></div><div><br></div><div>However, the final result on the device when my os is running is different, because my nsswitch.conf changes from "hosts:  files myhostname  mdns dns" to "hosts:  files mdns myhostname  dns". Why? I don't know, however I changed the regex in sed from "\1\2 mdns\3\4\5" to "\1\2\3mdns \4\5" to restore the original result.</div><div><br></div><div>Why is it happening? Honestly, I don't know the reason. My solution worked, but since I don't know why, I want to ask to someone more expert about nsswitch.conf and in particular about pkg_prerm_ and pkg_postinst_ because I really don't understand why I cannot change nsswitch without those and why without LICENSE_CREATE_PACKAGE they are working also without adding ontarget_, but with LICENSE_CREATE_PACKAGE = 1 the ontarget_ is required.</div><div><br></div><div>Please, can someone help about this? Or at least add in CC someone with more experience about these topics.</div><div><br></div><div>Thank you.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 4 ott 2019 alle ore 14:26 Stefano Cappa <<a href="mailto:stefano.cappa.ks89@gmail.com" target="_blank">stefano.cappa.ks89@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">I investigated a little bit.<div dir="auto">Probably, I didn't understand your point. <br></div><div dir="auto"><br></div><div dir="auto">The postinst script modifies nsswitch adding mdns and this is right, but why is this interfering with the license create package? </div><div dir="auto"><br></div><div dir="auto">If I remove the postinst I can build with license create package, however I need this change to nsswitch.</div><div dir="auto"><br></div><div dir="auto">Is it possibile to change the recipe of mdns to modify nsswitch without interfering with license create package in another xxxx() { }? </div><div dir="auto"><br></div><div dir="auto">Thanks </div><div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il gio 3 ott 2019, 14:24 Stefano Cappa <<a href="mailto:stefano.cappa.ks89@gmail.com" rel="noreferrer" target="_blank">stefano.cappa.ks89@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">I resend this email because it's not visible in yocto mailing list. <div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br><div dir="auto">Hi thank you for the answer.<div dir="auto"><br></div><div dir="auto">In my rootfs I have this nsswitch.conf:</div><div dir="auto">-------------------------------------------------------</div><div dir="auto"># /etc/nsswitch.conf<br>#<br># Example configuration of GNU Name Service Switch functionality.<br># If you have the `glibc-doc' and `info' packages installed, try:<br># `info libc "Name Service Switch"' for information about this file.<br><br>passwd: Â  Â  Â  Â  compat<br>group: Â  Â  Â  Â  Â compat<br>shadow: Â  Â  Â  Â  compat<br><br>hosts: Â  Â  Â  Â  Â files myhostname Â mdns dns<br>networks: Â  Â  Â  files<br><br>protocols: Â  Â  Â db files<br>services: Â  Â  Â  db files<br>ethers: Â  Â  Â  Â  db files<br>rpc: Â  Â  Â  Â  Â  Â db files<br><br>netgroup: Â  Â  Â  nis<br></div><div dir="auto">-------------------------------------------------------<br></div><div dir="auto"><br></div><div dir="auto">I'm not familiar with this file.</div><div dir="auto">Also changing "hosts: files myhostname Â mdns dns" to "hosts: files mdns4_minimal [NOTFOUND=return] dns" (copied from a raspberry pi 3) I'm still having the same problem.<br></div><div dir="auto"><br></div><div dir="auto">What should I change to fix this issue?</div><div dir="auto"><br style="font-family:sans-serif;font-size:12.8px"></div></div><div dir="auto"><br></div><div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il mar 1 ott 2019, 11:29 Stefano Cappa <<a href="mailto:stefano.cappa.ks89@gmail.com" rel="noreferrer noreferrer" target="_blank">stefano.cappa.ks89@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto">Hi thank you for the answer.<div dir="auto"><br></div><div dir="auto">In my rootfs I have this nsswitch.conf:</div><div dir="auto">-------------------------------------------------------</div><div dir="auto"># /etc/nsswitch.conf<br>#<br># Example configuration of GNU Name Service Switch functionality.<br># If you have the `glibc-doc' and `info' packages installed, try:<br># `info libc "Name Service Switch"' for information about this file.<br><br>passwd: Â  Â  Â  Â  compat<br>group: Â  Â  Â  Â  Â compat<br>shadow: Â  Â  Â  Â  compat<br><br>hosts: Â  Â  Â  Â  Â files myhostname Â mdns dns<br>networks: Â  Â  Â  files<br><br>protocols: Â  Â  Â db files<br>services: Â  Â  Â  db files<br>ethers: Â  Â  Â  Â  db files<br>rpc: Â  Â  Â  Â  Â  Â db files<br><br>netgroup: Â  Â  Â  nis<br></div><div dir="auto">-------------------------------------------------------<br></div><div dir="auto"><br></div><div dir="auto">I'm not familiar with this file.</div><div dir="auto">Also changing "hosts: files myhostname Â mdns dns" to "hosts: files mdns4_minimal [NOTFOUND=return] dns" (copied from a raspberry pi 3) I'm still having the same problem.<br></div><div dir="auto"><br></div><div dir="auto">What should I change to fix this issue?</div><div dir="auto"><br></div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il lun 30 set 2019, 22:45 Khem Raj <<a href="mailto:raj.khem@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">raj.khem@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On 9/30/19 8:17 AM, Stefano Cappa wrote:<br>
> I saw your last patch to upgrade mdns, so I'm sending this email also to<br>
> you to try to get help.<br>
> <br>
> mdns is working correctly, however, when I try to build my image with<br>
> "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described<br>
> here <a href="https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text</a> I<br>
> get this error message:<br>
> <br>
> ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of<br>
> ['mdns'] have failed. If the intention is to defer them to first boot,<br>
> then please place them into pkg_postinst_ontarget_${PN} ().<br>
> Deferring to first boot via 'exit 1' is no longer supported.<br>
> Details of the failure are in<br>
> /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.<br>
> ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs<br>
> ERROR: Logfile of failure stored in:<br>
> /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586<br>
> ERROR: Task (MY CUSTOM LAYER<br>
> PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with exit<br>
> code '1'<br>
> NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need to<br>
> be rerun and 1 failed.<br>
> <br>
> Do you have a solution? Why is it happening? <br>
> <br>
<br>
see mdns recipe especially<br>
<br>
pkg_postinst_${PN} (), that function is not able to execute offline<br>
during build. It could be that nsswitch.conf does not exist in your<br>
image rootfs<br>
<br>
> thank u.<br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>