From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 9C532E00C5C; Fri, 4 Oct 2019 08:04:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no * trust * [209.85.221.193 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (stefano.cappa.ks89[at]gmail.com) * 0.0 HTML_MESSAGE BODY: HTML included in message * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's * domain * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid Received: from mail-vk1-f193.google.com (mail-vk1-f193.google.com [209.85.221.193]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 372EBE0049C for ; Fri, 4 Oct 2019 08:04:13 -0700 (PDT) Received: by mail-vk1-f193.google.com with SMTP id j21so1523982vki.11 for ; Fri, 04 Oct 2019 08:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xU5Z/9LVC4rCEXbVNciEwwUrIXRHpqI+l4MmwQ6wMbs=; b=OQqnW/VvaP9qLRyeHXMSiPPYfig7pIdP16I6h81EQ5ri5NfFan6dp6UvlI1yhMZD+I c334wRWQcofEa4mPbypnMXmQpbHcByiVEZuv0gj63BGcJLnbL1poArYdO3xMinmTQjBL DWn1cM7SjXkDKrXTouLTuhxXt0+zPol4ZpClAzFDbT9PAhWhvb8rOBDhh8lDjl4IqgnY 3ioVc+mdsa5APdoayTNXIGpBmzSEdjamE7koOZQQMcVjLxU4iDYYFzUGKsHJrv9adzF8 z/7FwjwSV8v+hbawg8DP0drKRK2dal0dGScvPKmXGH2Mjh1BOzJWdz9eAk5Crz3YfeDC l2+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xU5Z/9LVC4rCEXbVNciEwwUrIXRHpqI+l4MmwQ6wMbs=; b=UPoFyaKjhP32UhwkFw6zZj/4UqX7t4kk2EEVlZgLxMh8Srs/dVh97xonAS6j7jGFF4 ZxeWpGm+aZ7AmUM8xR7jXVqyqFG5LcqxK7dXyVSKRIkyBJ6QXOKG1vDBNysh5nkthf9q DpbH8UaSwk/AvrGn+FLpm7E6NZfHWVE7QnSlvK5kwTjJ+DdL9dU31WhQYi6zrPqcOvlW MHxePywwW41/A5kNlt65amrIZRiHdGbySwq4jxOKiEmA0VZhZIQyhUzNxsh4EVMSO7az swv5wflTTCIuUc/Sjkg7LSvAouqfhK6KZ4ddeJHqfqX9JUc/kXlku7Jd15FxOEeSsHmi dJNw== X-Gm-Message-State: APjAAAXGbdN+Fxp0XBE67gWsbUygA9WMoPqaYD+Bvi8WKOCzvILo2Jxv rQzRNbkETa6hRpwZV0p2mtLSIxcC1f1xAI6lFBrQBd/0Mnw= X-Google-Smtp-Source: APXvYqwVQpL6LO2OtQhjL7UsCLaTviId16jVGzUzuK0LspTKaSx17eQw/HBFo0VwEjNi/XMdM5bT87szc9bVB/XbVOQ= X-Received: by 2002:a1f:dc41:: with SMTP id t62mr8175759vkg.5.1570201452007; Fri, 04 Oct 2019 08:04:12 -0700 (PDT) MIME-Version: 1.0 References: <35712e36-d517-2665-fd80-50f4b089b16b@gmail.com> In-Reply-To: From: Stefano Cappa Date: Fri, 4 Oct 2019 17:04:00 +0200 Message-ID: To: yocto@yoctoproject.org Subject: Re: Cannot use "LICENSE_CREATE_PACKAGE = 1" when building the image with mdns X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2019 15:04:15 -0000 Content-Type: multipart/alternative; boundary="000000000000c5d5c70594170307" --000000000000c5d5c70594170307 Content-Type: text/plain; charset="UTF-8" I fixed this issue in this way: I modified the recipe replacing this: ------------------------------ pkg_postinst_${PN} () { sed -e '/^hosts:/s/\s*\//' \ -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 mdns\3\4\5/' \ -i $D/etc/nsswitch.conf } pkg_prerm_${PN} () { sed -e '/^hosts:/s/\s*\//' \ -e '/^hosts:/s/\s*mdns//' \ -i $D/etc/nsswitch.conf }------------------------------ with this: ------------------------------ pkg_postinst_ontarget_${PN} () { sed -e '/^hosts:/s/\s*\//' \ -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2\3mdns \4\5/' \ -i $D/etc/nsswitch.conf } pkg_prerm_ontarget_${PN} () { sed -e '/^hosts:/s/\s*\//' \ -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 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 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 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. >>>> >>> --000000000000c5d5c70594170307 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I fixed this issue in this way:

<= /div>
I modified the recipe replacing this:
-----------------= -------------
pkg_postinst_${PN} () {
=C2=A0 =C2=A0 sed -e '= ;/^hosts:/s/\s*\<mdns\>//' \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -e &#= 39;s/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdn= s\3\4\5/' \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -i $D/etc/nsswitch.conf
}=

pkg_prerm_${PN} () {
=C2=A0 =C2=A0 sed -e '/^hosts:/s/\s*\&l= t;mdns\>//' \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -e '/^hosts:/s/\s*m= dns//' \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -i $D/etc/nsswitch.conf
}------------------------------

with this:
------------------------------
pkg_postinst_ontarget_${PN= } () {
=C2=A0 =C2=A0 sed -e '/^hosts:/s/\s*\<mdns\>//' \=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -e 's/\(^hosts:.*\)\(\<files\>\)\= (.*\)\(\<dns\>\)\(.*\)/\1\2\3mdns \4\5/' \
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 -i $D/etc/nsswitch.conf
}

pkg_prerm_ontarget_${PN} () = {
=C2=A0 =C2=A0 sed -e '/^hosts:/s/\s*\<mdns\>//' \
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 -e '/^hosts:/s/\s*mdns//' \
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 -i $D/etc/nsswitch.conf
}
--------------------= ----------


Basically, I added=C2=A0= _ontarget_ as suggested by yocto error that says: "... If the intentio= n is to defer them to first boot,
> then please place them int= o pkg_postinst_ontarget_${PN} ()....".

In thi= s way I can build the final image with LICENSE_CREATE_PACKAGE=3D1. Why? I d= on't know. I didn't understand why there was this error.
<= div>
However, the final result on the device when my os is ru= nning is different, because my nsswitch.conf changes from "hosts:=C2= =A0 files myhostname=C2=A0 mdns dns" to "hosts:=C2=A0 files mdns = myhostname=C2=A0 dns". Why? I don't know, however I changed the re= gex in sed from "\1\2 mdns\3\4\5" to "\1\2\3mdns \4\5" = to restore the original result.

Why is it happenin= g? Honestly, I don't know the reason. My solution worked, but since I d= on't know why, I want to ask to someone more expert about nsswitch.conf= and in particular about=C2=A0pkg_prerm_ and=C2=A0pkg_postinst_ because I r= eally don't understand why I cannot change nsswitch without those and w= hy without=C2=A0LICENSE_CREATE_PACKAGE they are working also without adding= ontarget_, but with=C2=A0LICENSE_CREATE_PACKAGE =3D 1 the=C2=A0ontarget_ i= s required.

Please, can someone help about this? O= r 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.= =C2=A0

The postinst = script modifies nsswitch adding mdns and this is right, but why is this int= erfering with the license create package?=C2=A0

=
If I remove the postinst I can build with license c= reate 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 anot= her xxxx() { }?=C2=A0

Th= anks=C2=A0



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.=C2=A0

<= br>

Hi thank you for the answe= r.

In my rootfs I have this ns= switch.conf:
---------------------------------------= ----------------
# /etc/nsswitch.conf
#
# Exam= ple configuration of GNU Name Service Switch functionality.
# If you hav= e the `glibc-doc' and `info' packages installed, try:
# `info li= bc "Name Service Switch"' for information about this file.
passwd: =C2=A0 =C2=A0 =C2=A0 =C2=A0 compat
group: =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0compat
shadow: =C2=A0 =C2=A0 =C2=A0 =C2=A0 compat
hosts: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0files myhostname =C2=A0mdns dns<= br>networks: =C2=A0 =C2=A0 =C2=A0 files

protocols: =C2=A0 =C2=A0 =C2= =A0db files
services: =C2=A0 =C2=A0 =C2=A0 db files
ethers: =C2=A0 = =C2=A0 =C2=A0 =C2=A0 db files
rpc: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0db files

netgroup: =C2=A0 =C2=A0 =C2=A0 nis
-------------------------------------------------------
=

I'm not familiar with thi= s file.
Also changing "hosts: files myhostname = =C2=A0mdns dns" to "hosts: files mdns4_minimal [NOTFOUND=3Dreturn= ] dns" (copied from a raspberry pi 3) I'm still having the same=C2= =A0problem.

What sho= uld I change to fix this issue?


<= div dir=3D"auto">

Il mar 1 ott 2019, 11:29 Stefano Cappa <= ;stefano.cappa.ks89@gmail.com> ha scritto:
<= /div>
Hi thank you for the answer.

In my rootfs I have this nsswitch.conf:
-------------------------------------------------------
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Serv= ice Switch functionality.
# If you have the `glibc-doc' and `info= 9; packages installed, try:
# `info libc "Name Service Switch"= ' for information about this file.

passwd: =C2=A0 =C2=A0 =C2=A0 = =C2=A0 compat
group: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0compat
shadow:= =C2=A0 =C2=A0 =C2=A0 =C2=A0 compat

hosts: =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0files myhostname =C2=A0mdns dns
networks: =C2=A0 =C2=A0 =C2=A0= files

protocols: =C2=A0 =C2=A0 =C2=A0db files
services: =C2=A0 = =C2=A0 =C2=A0 db files
ethers: =C2=A0 =C2=A0 =C2=A0 =C2=A0 db files
r= pc: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0db files

netgroup: =C2= =A0 =C2=A0 =C2=A0 nis
--------------------------= -----------------------------

I'm not familiar with this file.
Also = changing "hosts: files myhostname =C2=A0mdns dns" to "hosts:= files mdns4_minimal [NOTFOUND=3Dreturn] dns" (copied from a raspberry= pi 3) I'm still having the same=C2=A0problem.

What should I change to fix this issue?


Il lun 30 set 2019, 22:45 Khe= m Raj <raj.khem@gmail.com> ha scritto:
<= /div>


On 9/30/19 8:17 AM, Stefano Cappa wrote:
> I saw your last patch to upgrade mdns, so I'm sending this email a= lso to
> you to try to get help.
>
> mdns is working correctly, however, when I try to build my image with<= br> > "LICENSE_CREATE_PACKAGE =3D "1"" in my local.conf = as described
> here=C2=A0https://www.yoctoproject.org/= docs/2.8/dev-manual/dev-manual.html#providing-license-text=C2=A0I
> get this error=C2=A0message:
>
> ERROR: mydevice-image-1.0-r0 do_rootfs: Postinstall scriptlets of
> ['mdns'] have failed. If the intention is to defer them to fir= st 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/mydevi= ce-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 nee= d to
> be rerun and 1 failed.
>
> Do you have a solution? Why is it happening?=C2=A0
>

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.
--000000000000c5d5c70594170307--