* Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns @ 2019-09-30 15:17 Stefano Cappa 2019-09-30 20:45 ` Khem Raj 0 siblings, 1 reply; 7+ messages in thread From: Stefano Cappa @ 2019-09-30 15:17 UTC (permalink / raw) To: yocto, zangrc.fnst, Khem Raj [-- Attachment #1: Type: text/plain, Size: 1250 bytes --] I saw your last patch to upgrade mdns, so I'm sending this email also to you to try to get help. mdns is working correctly, however, when I try to build my image with "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described here https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text I get this error message: ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of ['mdns'] have failed. If the intention is to defer them to first boot, then please place them into pkg_postinst_ontarget_${PN} (). Deferring to first boot via 'exit 1' is no longer supported. Details of the failure are in /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs. ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs ERROR: Logfile of failure stored in: /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586 ERROR: Task (MY CUSTOM LAYER PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with exit code '1' NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need to be rerun and 1 failed. Do you have a solution? Why is it happening? thank u. [-- Attachment #2: Type: text/html, Size: 1525 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns 2019-09-30 15:17 Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns Stefano Cappa @ 2019-09-30 20:45 ` Khem Raj 2019-10-01 9:29 ` Stefano Cappa 0 siblings, 1 reply; 7+ messages in thread From: Khem Raj @ 2019-09-30 20:45 UTC (permalink / raw) To: Stefano Cappa, yocto, zangrc.fnst On 9/30/19 8:17 AM, Stefano Cappa wrote: > I saw your last patch to upgrade mdns, so I'm sending this email also to > you to try to get help. > > mdns is working correctly, however, when I try to build my image with > "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described > here https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text I > get this error message: > > ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of > ['mdns'] have failed. If the intention is to defer them to first boot, > then please place them into pkg_postinst_ontarget_${PN} (). > Deferring to first boot via 'exit 1' is no longer supported. > Details of the failure are in > /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs. > ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs > ERROR: Logfile of failure stored in: > /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586 > ERROR: Task (MY CUSTOM LAYER > PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with exit > code '1' > NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need to > be rerun and 1 failed. > > Do you have a solution? Why is it happening? > see mdns recipe especially pkg_postinst_${PN} (), that function is not able to execute offline during build. It could be that nsswitch.conf does not exist in your image rootfs > thank u. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns 2019-09-30 20:45 ` Khem Raj @ 2019-10-01 9:29 ` Stefano Cappa 2019-10-03 12:24 ` Stefano Cappa 0 siblings, 1 reply; 7+ messages in thread From: Stefano Cappa @ 2019-10-01 9:29 UTC (permalink / raw) To: Khem Raj; +Cc: yocto [-- Attachment #1: Type: text/plain, Size: 2627 bytes --] Hi thank you for the answer. In my rootfs I have this nsswitch.conf: ------------------------------------------------------- # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat group: compat shadow: compat hosts: files myhostname mdns dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis ------------------------------------------------------- I'm not familiar with this file. 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. What should I change to fix this issue? Il lun 30 set 2019, 22:45 Khem Raj <raj.khem@gmail.com> ha scritto: > > > On 9/30/19 8:17 AM, Stefano Cappa wrote: > > I saw your last patch to upgrade mdns, so I'm sending this email also to > > you to try to get help. > > > > mdns is working correctly, however, when I try to build my image with > > "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described > > here > https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text > I > > get this error message: > > > > ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of > > ['mdns'] have failed. If the intention is to defer them to first boot, > > then please place them into pkg_postinst_ontarget_${PN} (). > > Deferring to first boot via 'exit 1' is no longer supported. > > Details of the failure are in > > > /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs. > > ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs > > ERROR: Logfile of failure stored in: > > > /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586 > > ERROR: Task (MY CUSTOM LAYER > > PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with exit > > code '1' > > NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need to > > be rerun and 1 failed. > > > > Do you have a solution? Why is it happening? > > > > see mdns recipe especially > > pkg_postinst_${PN} (), that function is not able to execute offline > during build. It could be that nsswitch.conf does not exist in your > image rootfs > > > thank u. > [-- Attachment #2: Type: text/html, Size: 3671 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns 2019-10-01 9:29 ` Stefano Cappa @ 2019-10-03 12:24 ` Stefano Cappa 2019-10-04 12:26 ` Stefano Cappa 0 siblings, 1 reply; 7+ messages in thread From: Stefano Cappa @ 2019-10-03 12:24 UTC (permalink / raw) To: yocto [-- Attachment #1: Type: text/plain, Size: 3840 bytes --] I resend this email because it's not visible in yocto mailing list. Hi thank you for the answer. In my rootfs I have this nsswitch.conf: ------------------------------------------------------- # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat group: compat shadow: compat hosts: files myhostname mdns dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis ------------------------------------------------------- I'm not familiar with this file. 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. What should I change to fix this issue? Il mar 1 ott 2019, 11:29 Stefano Cappa <stefano.cappa.ks89@gmail.com> ha scritto: > Hi thank you for the answer. > > In my rootfs I have this nsswitch.conf: > ------------------------------------------------------- > # /etc/nsswitch.conf > # > # Example configuration of GNU Name Service Switch functionality. > # If you have the `glibc-doc' and `info' packages installed, try: > # `info libc "Name Service Switch"' for information about this file. > > passwd: compat > group: compat > shadow: compat > > hosts: files myhostname mdns dns > networks: files > > protocols: db files > services: db files > ethers: db files > rpc: db files > > netgroup: nis > ------------------------------------------------------- > > I'm not familiar with this file. > 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. > > What should I change to fix this issue? > > > Il lun 30 set 2019, 22:45 Khem Raj <raj.khem@gmail.com> ha scritto: > >> >> >> On 9/30/19 8:17 AM, Stefano Cappa wrote: >> > I saw your last patch to upgrade mdns, so I'm sending this email also to >> > you to try to get help. >> > >> > mdns is working correctly, however, when I try to build my image with >> > "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described >> > here >> https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text >> I >> > get this error message: >> > >> > ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of >> > ['mdns'] have failed. If the intention is to defer them to first boot, >> > then please place them into pkg_postinst_ontarget_${PN} (). >> > Deferring to first boot via 'exit 1' is no longer supported. >> > Details of the failure are in >> > >> /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs. >> > ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs >> > ERROR: Logfile of failure stored in: >> > >> /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586 >> > ERROR: Task (MY CUSTOM LAYER >> > PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with exit >> > code '1' >> > NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need to >> > be rerun and 1 failed. >> > >> > Do you have a solution? Why is it happening? >> > >> >> see mdns recipe especially >> >> pkg_postinst_${PN} (), that function is not able to execute offline >> during build. It could be that nsswitch.conf does not exist in your >> image rootfs >> >> > thank u. >> > [-- Attachment #2: Type: text/html, Size: 5642 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns 2019-10-03 12:24 ` Stefano Cappa @ 2019-10-04 12:26 ` Stefano Cappa 2019-10-04 15:04 ` Stefano Cappa 0 siblings, 1 reply; 7+ messages in thread From: Stefano Cappa @ 2019-10-04 12:26 UTC (permalink / raw) To: yocto [-- Attachment #1: Type: text/plain, Size: 4549 bytes --] I investigated a little bit. Probably, I didn't understand your point. The postinst script modifies nsswitch adding mdns and this is right, but why is this interfering with the license create package? If I remove the postinst I can build with license create package, however I need this change to nsswitch. Is it possibile to change the recipe of mdns to modify nsswitch without interfering with license create package in another xxxx() { }? Thanks Il gio 3 ott 2019, 14:24 Stefano Cappa <stefano.cappa.ks89@gmail.com> ha scritto: > I resend this email because it's not visible in yocto mailing list. > > > > Hi thank you for the answer. > > In my rootfs I have this nsswitch.conf: > ------------------------------------------------------- > # /etc/nsswitch.conf > # > # Example configuration of GNU Name Service Switch functionality. > # If you have the `glibc-doc' and `info' packages installed, try: > # `info libc "Name Service Switch"' for information about this file. > > passwd: compat > group: compat > shadow: compat > > hosts: files myhostname mdns dns > networks: files > > protocols: db files > services: db files > ethers: db files > rpc: db files > > netgroup: nis > ------------------------------------------------------- > > I'm not familiar with this file. > 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. > > What should I change to fix this issue? > > > > > Il mar 1 ott 2019, 11:29 Stefano Cappa <stefano.cappa.ks89@gmail.com> ha > scritto: > >> Hi thank you for the answer. >> >> In my rootfs I have this nsswitch.conf: >> ------------------------------------------------------- >> # /etc/nsswitch.conf >> # >> # Example configuration of GNU Name Service Switch functionality. >> # If you have the `glibc-doc' and `info' packages installed, try: >> # `info libc "Name Service Switch"' for information about this file. >> >> passwd: compat >> group: compat >> shadow: compat >> >> hosts: files myhostname mdns dns >> networks: files >> >> protocols: db files >> services: db files >> ethers: db files >> rpc: db files >> >> netgroup: nis >> ------------------------------------------------------- >> >> I'm not familiar with this file. >> 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. >> >> What should I change to fix this issue? >> >> >> Il lun 30 set 2019, 22:45 Khem Raj <raj.khem@gmail.com> ha scritto: >> >>> >>> >>> On 9/30/19 8:17 AM, Stefano Cappa wrote: >>> > I saw your last patch to upgrade mdns, so I'm sending this email also >>> to >>> > you to try to get help. >>> > >>> > mdns is working correctly, however, when I try to build my image with >>> > "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described >>> > here >>> https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text >>> I >>> > get this error message: >>> > >>> > ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of >>> > ['mdns'] have failed. If the intention is to defer them to first boot, >>> > then please place them into pkg_postinst_ontarget_${PN} (). >>> > Deferring to first boot via 'exit 1' is no longer supported. >>> > Details of the failure are in >>> > >>> /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs. >>> > ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs >>> > ERROR: Logfile of failure stored in: >>> > >>> /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586 >>> > ERROR: Task (MY CUSTOM LAYER >>> > PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with exit >>> > code '1' >>> > NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need to >>> > be rerun and 1 failed. >>> > >>> > Do you have a solution? Why is it happening? >>> > >>> >>> see mdns recipe especially >>> >>> pkg_postinst_${PN} (), that function is not able to execute offline >>> during build. It could be that nsswitch.conf does not exist in your >>> image rootfs >>> >>> > thank u. >>> >> [-- Attachment #2: Type: text/html, Size: 6843 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns 2019-10-04 12:26 ` Stefano Cappa @ 2019-10-04 15:04 ` Stefano Cappa 2019-10-04 15:17 ` Stefano Cappa 0 siblings, 1 reply; 7+ messages in thread From: Stefano Cappa @ 2019-10-04 15:04 UTC (permalink / raw) To: yocto [-- Attachment #1: Type: text/plain, Size: 6936 bytes --] I fixed this issue in this way: I modified the recipe replacing this: ------------------------------ pkg_postinst_${PN} () { sed -e '/^hosts:/s/\s*\<mdns\>//' \ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \ -i $D/etc/nsswitch.conf } pkg_prerm_${PN} () { sed -e '/^hosts:/s/\s*\<mdns\>//' \ -e '/^hosts:/s/\s*mdns//' \ -i $D/etc/nsswitch.conf }------------------------------ with this: ------------------------------ pkg_postinst_ontarget_${PN} () { sed -e '/^hosts:/s/\s*\<mdns\>//' \ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2\3mdns \4\5/' \ -i $D/etc/nsswitch.conf } pkg_prerm_ontarget_${PN} () { sed -e '/^hosts:/s/\s*\<mdns\>//' \ -e '/^hosts:/s/\s*mdns//' \ -i $D/etc/nsswitch.conf } ------------------------------ Basically, I added _ontarget_ as suggested by yocto error that says: "... If the intention is to defer them to first boot, > then please place them into pkg_postinst_ontarget_${PN} ()....". 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. 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. 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. Please, can someone help about this? Or at least add in CC someone with more experience about these topics. Thank you. Il giorno ven 4 ott 2019 alle ore 14:26 Stefano Cappa < stefano.cappa.ks89@gmail.com> ha scritto: > I investigated a little bit. > Probably, I didn't understand your point. > > The postinst script modifies nsswitch adding mdns and this is right, but > why is this interfering with the license create package? > > If I remove the postinst I can build with license create package, however > I need this change to nsswitch. > > Is it possibile to change the recipe of mdns to modify nsswitch without > interfering with license create package in another xxxx() { }? > > Thanks > > > > Il gio 3 ott 2019, 14:24 Stefano Cappa <stefano.cappa.ks89@gmail.com> ha > scritto: > >> I resend this email because it's not visible in yocto mailing list. >> >> >> >> Hi thank you for the answer. >> >> In my rootfs I have this nsswitch.conf: >> ------------------------------------------------------- >> # /etc/nsswitch.conf >> # >> # Example configuration of GNU Name Service Switch functionality. >> # If you have the `glibc-doc' and `info' packages installed, try: >> # `info libc "Name Service Switch"' for information about this file. >> >> passwd: compat >> group: compat >> shadow: compat >> >> hosts: files myhostname mdns dns >> networks: files >> >> protocols: db files >> services: db files >> ethers: db files >> rpc: db files >> >> netgroup: nis >> ------------------------------------------------------- >> >> I'm not familiar with this file. >> 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. >> >> What should I change to fix this issue? >> >> >> >> >> Il mar 1 ott 2019, 11:29 Stefano Cappa <stefano.cappa.ks89@gmail.com> ha >> scritto: >> >>> Hi thank you for the answer. >>> >>> In my rootfs I have this nsswitch.conf: >>> ------------------------------------------------------- >>> # /etc/nsswitch.conf >>> # >>> # Example configuration of GNU Name Service Switch functionality. >>> # If you have the `glibc-doc' and `info' packages installed, try: >>> # `info libc "Name Service Switch"' for information about this file. >>> >>> passwd: compat >>> group: compat >>> shadow: compat >>> >>> hosts: files myhostname mdns dns >>> networks: files >>> >>> protocols: db files >>> services: db files >>> ethers: db files >>> rpc: db files >>> >>> netgroup: nis >>> ------------------------------------------------------- >>> >>> I'm not familiar with this file. >>> 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. >>> >>> What should I change to fix this issue? >>> >>> >>> Il lun 30 set 2019, 22:45 Khem Raj <raj.khem@gmail.com> ha scritto: >>> >>>> >>>> >>>> On 9/30/19 8:17 AM, Stefano Cappa wrote: >>>> > I saw your last patch to upgrade mdns, so I'm sending this email also >>>> to >>>> > you to try to get help. >>>> > >>>> > mdns is working correctly, however, when I try to build my image with >>>> > "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described >>>> > here >>>> https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text >>>> I >>>> > get this error message: >>>> > >>>> > ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of >>>> > ['mdns'] have failed. If the intention is to defer them to first boot, >>>> > then please place them into pkg_postinst_ontarget_${PN} (). >>>> > Deferring to first boot via 'exit 1' is no longer supported. >>>> > Details of the failure are in >>>> > >>>> /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs. >>>> > ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs >>>> > ERROR: Logfile of failure stored in: >>>> > >>>> /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586 >>>> > ERROR: Task (MY CUSTOM LAYER >>>> > PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with >>>> exit >>>> > code '1' >>>> > NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need to >>>> > be rerun and 1 failed. >>>> > >>>> > Do you have a solution? Why is it happening? >>>> > >>>> >>>> see mdns recipe especially >>>> >>>> pkg_postinst_${PN} (), that function is not able to execute offline >>>> during build. It could be that nsswitch.conf does not exist in your >>>> image rootfs >>>> >>>> > thank u. >>>> >>> [-- Attachment #2: Type: text/html, Size: 9948 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns 2019-10-04 15:04 ` Stefano Cappa @ 2019-10-04 15:17 ` Stefano Cappa 0 siblings, 0 replies; 7+ messages in thread From: Stefano Cappa @ 2019-10-04 15:17 UTC (permalink / raw) To: yocto [-- Attachment #1: Type: text/plain, Size: 8020 bytes --] Oh, another update to integrate the previous email. Inside the source code of mDNSResponder ( https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.260.1.tar.gz) I found in "mDNSPosix/Makefile" this: " # Check the nsswitch.conf file. # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns' cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf " 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. What do you think? Il giorno ven 4 ott 2019 alle ore 17:04 Stefano Cappa < stefano.cappa.ks89@gmail.com> ha scritto: > I fixed this issue in this way: > > I modified the recipe replacing this: > ------------------------------ > pkg_postinst_${PN} () { > sed -e '/^hosts:/s/\s*\<mdns\>//' \ > -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 > mdns\3\4\5/' \ > -i $D/etc/nsswitch.conf > } > > pkg_prerm_${PN} () { > sed -e '/^hosts:/s/\s*\<mdns\>//' \ > -e '/^hosts:/s/\s*mdns//' \ > -i $D/etc/nsswitch.conf > }------------------------------ > > with this: > ------------------------------ > pkg_postinst_ontarget_${PN} () { > sed -e '/^hosts:/s/\s*\<mdns\>//' \ > -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2\3mdns > \4\5/' \ > -i $D/etc/nsswitch.conf > } > > pkg_prerm_ontarget_${PN} () { > sed -e '/^hosts:/s/\s*\<mdns\>//' \ > -e '/^hosts:/s/\s*mdns//' \ > -i $D/etc/nsswitch.conf > } > ------------------------------ > > > Basically, I added _ontarget_ as suggested by yocto error that says: "... > If the intention is to defer them to first boot, > > then please place them into pkg_postinst_ontarget_${PN} ()....". > > 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. > > 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. > > 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. > > Please, can someone help about this? Or at least add in CC someone with > more experience about these topics. > > Thank you. > > > Il giorno ven 4 ott 2019 alle ore 14:26 Stefano Cappa < > stefano.cappa.ks89@gmail.com> ha scritto: > >> I investigated a little bit. >> Probably, I didn't understand your point. >> >> The postinst script modifies nsswitch adding mdns and this is right, but >> why is this interfering with the license create package? >> >> If I remove the postinst I can build with license create package, however >> I need this change to nsswitch. >> >> Is it possibile to change the recipe of mdns to modify nsswitch without >> interfering with license create package in another xxxx() { }? >> >> Thanks >> >> >> >> Il gio 3 ott 2019, 14:24 Stefano Cappa <stefano.cappa.ks89@gmail.com> ha >> scritto: >> >>> I resend this email because it's not visible in yocto mailing list. >>> >>> >>> >>> Hi thank you for the answer. >>> >>> In my rootfs I have this nsswitch.conf: >>> ------------------------------------------------------- >>> # /etc/nsswitch.conf >>> # >>> # Example configuration of GNU Name Service Switch functionality. >>> # If you have the `glibc-doc' and `info' packages installed, try: >>> # `info libc "Name Service Switch"' for information about this file. >>> >>> passwd: compat >>> group: compat >>> shadow: compat >>> >>> hosts: files myhostname mdns dns >>> networks: files >>> >>> protocols: db files >>> services: db files >>> ethers: db files >>> rpc: db files >>> >>> netgroup: nis >>> ------------------------------------------------------- >>> >>> I'm not familiar with this file. >>> 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. >>> >>> What should I change to fix this issue? >>> >>> >>> >>> >>> Il mar 1 ott 2019, 11:29 Stefano Cappa <stefano.cappa.ks89@gmail.com> >>> ha scritto: >>> >>>> Hi thank you for the answer. >>>> >>>> In my rootfs I have this nsswitch.conf: >>>> ------------------------------------------------------- >>>> # /etc/nsswitch.conf >>>> # >>>> # Example configuration of GNU Name Service Switch functionality. >>>> # If you have the `glibc-doc' and `info' packages installed, try: >>>> # `info libc "Name Service Switch"' for information about this file. >>>> >>>> passwd: compat >>>> group: compat >>>> shadow: compat >>>> >>>> hosts: files myhostname mdns dns >>>> networks: files >>>> >>>> protocols: db files >>>> services: db files >>>> ethers: db files >>>> rpc: db files >>>> >>>> netgroup: nis >>>> ------------------------------------------------------- >>>> >>>> I'm not familiar with this file. >>>> 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. >>>> >>>> What should I change to fix this issue? >>>> >>>> >>>> Il lun 30 set 2019, 22:45 Khem Raj <raj.khem@gmail.com> ha scritto: >>>> >>>>> >>>>> >>>>> On 9/30/19 8:17 AM, Stefano Cappa wrote: >>>>> > I saw your last patch to upgrade mdns, so I'm sending this email >>>>> also to >>>>> > you to try to get help. >>>>> > >>>>> > mdns is working correctly, however, when I try to build my image with >>>>> > "LICENSE_CREATE_PACKAGE = "1"" in my local.conf as described >>>>> > here >>>>> https://www.yoctoproject.org/docs/2.8/dev-manual/dev-manual.html#providing-license-text >>>>> I >>>>> > get this error message: >>>>> > >>>>> > ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of >>>>> > ['mdns'] have failed. If the intention is to defer them to first >>>>> boot, >>>>> > then please place them into pkg_postinst_ontarget_${PN} (). >>>>> > Deferring to first boot via 'exit 1' is no longer supported. >>>>> > Details of the failure are in >>>>> > >>>>> /home/user/git/poky/build/tmp/work/mydevice1-image-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs. >>>>> > ERROR: mydevice-image-1.0-r0 do_rootfs: Function failed: do_rootfs >>>>> > ERROR: Logfile of failure stored in: >>>>> > >>>>> /home/user/git/poky/build/tmp/work/mydevice1-poky-linux-gnueabi/mydevice-image/1.0-r0/temp/log.do_rootfs.14586 >>>>> > ERROR: Task (MY CUSTOM LAYER >>>>> > PATH/recipes-core/images/mydevice-image.bb:do_rootfs) failed with >>>>> exit >>>>> > code '1' >>>>> > NOTE: Tasks Summary: Attempted 4871 tasks of which 4654 didn't need >>>>> to >>>>> > be rerun and 1 failed. >>>>> > >>>>> > Do you have a solution? Why is it happening? >>>>> > >>>>> >>>>> see mdns recipe especially >>>>> >>>>> pkg_postinst_${PN} (), that function is not able to execute offline >>>>> during build. It could be that nsswitch.conf does not exist in your >>>>> image rootfs >>>>> >>>>> > thank u. >>>>> >>>> [-- Attachment #2: Type: text/html, Size: 11369 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-10-04 15:17 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-09-30 15:17 Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns Stefano Cappa 2019-09-30 20:45 ` Khem Raj 2019-10-01 9:29 ` Stefano Cappa 2019-10-03 12:24 ` Stefano Cappa 2019-10-04 12:26 ` Stefano Cappa 2019-10-04 15:04 ` Stefano Cappa 2019-10-04 15:17 ` Stefano Cappa
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.