All of lore.kernel.org
 help / color / mirror / Atom feed
* [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
@ 2015-11-28  8:09 Jagadeesh Krishnanjanappa
  2015-12-04 15:27 ` Jagadeesh Krishnanjanappa
  2016-03-07 15:59 ` Burton, Ross
  0 siblings, 2 replies; 8+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-11-28  8:09 UTC (permalink / raw)
  To: openembedded-core

We get below host contamination warnings of license files for
each recipe, when we try to create a separate ${PN}-lic package (which
contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
in local.conf.

-- snip --
WARNING: QA Issue: libcgroup: /libcgroup-lic/usr/share/licenses/libcgroup/generic_LGPLv2.1 is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
WARNING: QA Issue: attr: /attr-lic/usr/share/licenses/attr/libattr.c is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
WARNING: QA Issue: bash: /bash-lic/usr/share/licenses/bash/COPYING is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
-- CUT --

Since the license files from source and OE-core, are populated in a normal
shell environment rather in pseudo environment (fakeroot); the ownership of
these files will be same as host user running bitbake. During the do_package
task (which runs in pseudo environment (fakeroot)), os.link preserves the
ownership of these license files as host user instead of root user.
This causes license files to have UID same as host user id and resulting in
above warnings during do_package_qa task.

Changing ownership of license files to root user (which has UID and GID as 0)
under pseudo environment will solve above warnings, and on exiting pseudo
environment the license files will continue to be owned by host user. Perform
this manipulation within try/except statements, as tasks which are not exected
under pseudo (such as do_populate_lic) result in OSError when trying to
change ownership of license files.

Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
---
 meta/classes/license.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index c616a20..8fff156 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -185,6 +185,15 @@ def copy_license_files(lic_files_paths, destdir):
                 os.remove(dst)
             if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
                 os.link(src, dst)
+                try:
+                    os.chown(dst,0,0)
+                except OSError as err:
+                    if err.errno == 1:
+                        # suppress "Operation not permitted" error, as 
+                        # sometimes this function is not executed under pseudo
+                        pass
+                    else:
+                        raise
             else:
                 shutil.copyfile(src, dst)
         except Exception as e:
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
  2015-11-28  8:09 [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files Jagadeesh Krishnanjanappa
@ 2015-12-04 15:27 ` Jagadeesh Krishnanjanappa
  2015-12-10 10:49   ` Jagadeesh Krishnanjanappa
  2016-03-04 12:51   ` Martin Jansa
  2016-03-07 15:59 ` Burton, Ross
  1 sibling, 2 replies; 8+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-12-04 15:27 UTC (permalink / raw)
  To: OE-core

[-- Attachment #1: Type: text/plain, Size: 3183 bytes --]

Ping.
Any updates regarding this patch?

Regards,
Jagadeesh


On Sat, Nov 28, 2015 at 1:39 PM, Jagadeesh Krishnanjanappa <
jkrishnanjanappa@mvista.com> wrote:

> We get below host contamination warnings of license files for
> each recipe, when we try to create a separate ${PN}-lic package (which
> contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
> in local.conf.
>
> -- snip --
> WARNING: QA Issue: libcgroup:
> /libcgroup-lic/usr/share/licenses/libcgroup/generic_LGPLv2.1 is owned by
> uid 5001, which is the same as the user running bitbake. This may be due to
> host contamination [host-user-contaminated]
> WARNING: QA Issue: attr: /attr-lic/usr/share/licenses/attr/libattr.c is
> owned by uid 5001, which is the same as the user running bitbake. This may
> be due to host contamination [host-user-contaminated]
> WARNING: QA Issue: bash: /bash-lic/usr/share/licenses/bash/COPYING is
> owned by uid 5001, which is the same as the user running bitbake. This may
> be due to host contamination [host-user-contaminated]
> -- CUT --
>
> Since the license files from source and OE-core, are populated in a normal
> shell environment rather in pseudo environment (fakeroot); the ownership of
> these files will be same as host user running bitbake. During the
> do_package
> task (which runs in pseudo environment (fakeroot)), os.link preserves the
> ownership of these license files as host user instead of root user.
> This causes license files to have UID same as host user id and resulting in
> above warnings during do_package_qa task.
>
> Changing ownership of license files to root user (which has UID and GID as
> 0)
> under pseudo environment will solve above warnings, and on exiting pseudo
> environment the license files will continue to be owned by host user.
> Perform
> this manipulation within try/except statements, as tasks which are not
> exected
> under pseudo (such as do_populate_lic) result in OSError when trying to
> change ownership of license files.
>
> Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
> ---
>  meta/classes/license.bbclass | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> index c616a20..8fff156 100644
> --- a/meta/classes/license.bbclass
> +++ b/meta/classes/license.bbclass
> @@ -185,6 +185,15 @@ def copy_license_files(lic_files_paths, destdir):
>                  os.remove(dst)
>              if os.access(src, os.W_OK) and (os.stat(src).st_dev ==
> os.stat(destdir).st_dev):
>                  os.link(src, dst)
> +                try:
> +                    os.chown(dst,0,0)
> +                except OSError as err:
> +                    if err.errno == 1:
> +                        # suppress "Operation not permitted" error, as
> +                        # sometimes this function is not executed under
> pseudo
> +                        pass
> +                    else:
> +                        raise
>              else:
>                  shutil.copyfile(src, dst)
>          except Exception as e:
> --
> 1.9.1
>
>

[-- Attachment #2: Type: text/html, Size: 3882 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
  2015-12-04 15:27 ` Jagadeesh Krishnanjanappa
@ 2015-12-10 10:49   ` Jagadeesh Krishnanjanappa
  2016-03-04 12:51   ` Martin Jansa
  1 sibling, 0 replies; 8+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-12-10 10:49 UTC (permalink / raw)
  To: OE-core

[-- Attachment #1: Type: text/plain, Size: 3444 bytes --]

Ping again.
Waiting for your feedback.

Regards,
Jagadeesh

On Fri, Dec 4, 2015 at 8:57 PM, Jagadeesh Krishnanjanappa <
jkrishnanjanappa@mvista.com> wrote:

> Ping.
> Any updates regarding this patch?
>
> Regards,
> Jagadeesh
>
>
> On Sat, Nov 28, 2015 at 1:39 PM, Jagadeesh Krishnanjanappa <
> jkrishnanjanappa@mvista.com> wrote:
>
>> We get below host contamination warnings of license files for
>> each recipe, when we try to create a separate ${PN}-lic package (which
>> contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
>> in local.conf.
>>
>> -- snip --
>> WARNING: QA Issue: libcgroup:
>> /libcgroup-lic/usr/share/licenses/libcgroup/generic_LGPLv2.1 is owned by
>> uid 5001, which is the same as the user running bitbake. This may be due to
>> host contamination [host-user-contaminated]
>> WARNING: QA Issue: attr: /attr-lic/usr/share/licenses/attr/libattr.c is
>> owned by uid 5001, which is the same as the user running bitbake. This may
>> be due to host contamination [host-user-contaminated]
>> WARNING: QA Issue: bash: /bash-lic/usr/share/licenses/bash/COPYING is
>> owned by uid 5001, which is the same as the user running bitbake. This may
>> be due to host contamination [host-user-contaminated]
>> -- CUT --
>>
>> Since the license files from source and OE-core, are populated in a normal
>> shell environment rather in pseudo environment (fakeroot); the ownership
>> of
>> these files will be same as host user running bitbake. During the
>> do_package
>> task (which runs in pseudo environment (fakeroot)), os.link preserves the
>> ownership of these license files as host user instead of root user.
>> This causes license files to have UID same as host user id and resulting
>> in
>> above warnings during do_package_qa task.
>>
>> Changing ownership of license files to root user (which has UID and GID
>> as 0)
>> under pseudo environment will solve above warnings, and on exiting pseudo
>> environment the license files will continue to be owned by host user.
>> Perform
>> this manipulation within try/except statements, as tasks which are not
>> exected
>> under pseudo (such as do_populate_lic) result in OSError when trying to
>> change ownership of license files.
>>
>> Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
>> ---
>>  meta/classes/license.bbclass | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
>> index c616a20..8fff156 100644
>> --- a/meta/classes/license.bbclass
>> +++ b/meta/classes/license.bbclass
>> @@ -185,6 +185,15 @@ def copy_license_files(lic_files_paths, destdir):
>>                  os.remove(dst)
>>              if os.access(src, os.W_OK) and (os.stat(src).st_dev ==
>> os.stat(destdir).st_dev):
>>                  os.link(src, dst)
>> +                try:
>> +                    os.chown(dst,0,0)
>> +                except OSError as err:
>> +                    if err.errno == 1:
>> +                        # suppress "Operation not permitted" error, as
>> +                        # sometimes this function is not executed under
>> pseudo
>> +                        pass
>> +                    else:
>> +                        raise
>>              else:
>>                  shutil.copyfile(src, dst)
>>          except Exception as e:
>> --
>> 1.9.1
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4433 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
  2015-12-04 15:27 ` Jagadeesh Krishnanjanappa
  2015-12-10 10:49   ` Jagadeesh Krishnanjanappa
@ 2016-03-04 12:51   ` Martin Jansa
  1 sibling, 0 replies; 8+ messages in thread
From: Martin Jansa @ 2016-03-04 12:51 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 3853 bytes --]

On Fri, Dec 04, 2015 at 08:57:04PM +0530, Jagadeesh Krishnanjanappa wrote:
> Ping.
> Any updates regarding this patch?

Ping.

AFAIK: This still wasn't applied in master nor jethro - I just got 250+
these warnings in small(ish) Jethro build.

$ grep "WARNING: QA Issue: .*/licenses/" consoleText.txt  | wc -l
257

> On Sat, Nov 28, 2015 at 1:39 PM, Jagadeesh Krishnanjanappa <
> jkrishnanjanappa@mvista.com> wrote:
> 
> > We get below host contamination warnings of license files for
> > each recipe, when we try to create a separate ${PN}-lic package (which
> > contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
> > in local.conf.
> >
> > -- snip --
> > WARNING: QA Issue: libcgroup:
> > /libcgroup-lic/usr/share/licenses/libcgroup/generic_LGPLv2.1 is owned by
> > uid 5001, which is the same as the user running bitbake. This may be due to
> > host contamination [host-user-contaminated]
> > WARNING: QA Issue: attr: /attr-lic/usr/share/licenses/attr/libattr.c is
> > owned by uid 5001, which is the same as the user running bitbake. This may
> > be due to host contamination [host-user-contaminated]
> > WARNING: QA Issue: bash: /bash-lic/usr/share/licenses/bash/COPYING is
> > owned by uid 5001, which is the same as the user running bitbake. This may
> > be due to host contamination [host-user-contaminated]
> > -- CUT --
> >
> > Since the license files from source and OE-core, are populated in a normal
> > shell environment rather in pseudo environment (fakeroot); the ownership of
> > these files will be same as host user running bitbake. During the
> > do_package
> > task (which runs in pseudo environment (fakeroot)), os.link preserves the
> > ownership of these license files as host user instead of root user.
> > This causes license files to have UID same as host user id and resulting in
> > above warnings during do_package_qa task.
> >
> > Changing ownership of license files to root user (which has UID and GID as
> > 0)
> > under pseudo environment will solve above warnings, and on exiting pseudo
> > environment the license files will continue to be owned by host user.
> > Perform
> > this manipulation within try/except statements, as tasks which are not
> > exected
> > under pseudo (such as do_populate_lic) result in OSError when trying to
> > change ownership of license files.
> >
> > Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
> > ---
> >  meta/classes/license.bbclass | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> > index c616a20..8fff156 100644
> > --- a/meta/classes/license.bbclass
> > +++ b/meta/classes/license.bbclass
> > @@ -185,6 +185,15 @@ def copy_license_files(lic_files_paths, destdir):
> >                  os.remove(dst)
> >              if os.access(src, os.W_OK) and (os.stat(src).st_dev ==
> > os.stat(destdir).st_dev):
> >                  os.link(src, dst)
> > +                try:
> > +                    os.chown(dst,0,0)
> > +                except OSError as err:
> > +                    if err.errno == 1:
> > +                        # suppress "Operation not permitted" error, as
> > +                        # sometimes this function is not executed under
> > pseudo
> > +                        pass
> > +                    else:
> > +                        raise
> >              else:
> >                  shutil.copyfile(src, dst)
> >          except Exception as e:
> > --
> > 1.9.1
> >
> >

> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
  2015-11-28  8:09 [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files Jagadeesh Krishnanjanappa
  2015-12-04 15:27 ` Jagadeesh Krishnanjanappa
@ 2016-03-07 15:59 ` Burton, Ross
  2016-03-07 16:45   ` Jagadeesh Krishnanjanappa
  1 sibling, 1 reply; 8+ messages in thread
From: Burton, Ross @ 2016-03-07 15:59 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

On 28 November 2015 at 08:09, Jagadeesh Krishnanjanappa <
jkrishnanjanappa@mvista.com> wrote:

> We get below host contamination warnings of license files for
> each recipe, when we try to create a separate ${PN}-lic package (which
> contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
> in local.conf.
>

If something is for master and jethro, please make it clear.

(Merged into mut)

Ross

[-- Attachment #2: Type: text/html, Size: 911 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
  2016-03-07 15:59 ` Burton, Ross
@ 2016-03-07 16:45   ` Jagadeesh Krishnanjanappa
  2016-03-07 17:16     ` Burton, Ross
  0 siblings, 1 reply; 8+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2016-03-07 16:45 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

This patch was applying  correctly for jethro and master, when it was sent
on 28th Nov 2015. Now, it applies correctly for jethro.  And for master it
applies with hunk warning as below

-- snip --
patching file meta/classes/license.bbclass
Hunk #1 succeeded at 350 (offset 165 lines).
-- snip --

I can send an updated patch for the master branch. For jethro, this patch
can be applied successfully.

Regards,
Jagadeesh



On Mon, Mar 7, 2016 at 9:29 PM, Burton, Ross <ross.burton@intel.com> wrote:

>
> On 28 November 2015 at 08:09, Jagadeesh Krishnanjanappa <
> jkrishnanjanappa@mvista.com> wrote:
>
>> We get below host contamination warnings of license files for
>> each recipe, when we try to create a separate ${PN}-lic package (which
>> contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
>> in local.conf.
>>
>
> If something is for master and jethro, please make it clear.
>
> (Merged into mut)
>
> Ross
>

[-- Attachment #2: Type: text/html, Size: 2034 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
  2016-03-07 16:45   ` Jagadeesh Krishnanjanappa
@ 2016-03-07 17:16     ` Burton, Ross
  2016-03-07 17:20       ` Jagadeesh Krishnanjanappa
  0 siblings, 1 reply; 8+ messages in thread
From: Burton, Ross @ 2016-03-07 17:16 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

On 7 March 2016 at 16:45, Jagadeesh Krishnanjanappa <
jkrishnanjanappa@mvista.com> wrote:

> I can send an updated patch for the master branch. For jethro, this patch
> can be applied successfully.
>

I've merged this into my staging branch for master, no need to send again.

Ross

[-- Attachment #2: Type: text/html, Size: 666 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files
  2016-03-07 17:16     ` Burton, Ross
@ 2016-03-07 17:20       ` Jagadeesh Krishnanjanappa
  0 siblings, 0 replies; 8+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2016-03-07 17:20 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]

>
> I've merged this into my staging branch for master, no need to send again.
>
> Thanks Martin and Ross.

Regards,
Jagadeesh

[-- Attachment #2: Type: text/html, Size: 514 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-07 17:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-28  8:09 [jethro][PATCH v3] license.bbclass: fix host contamination warnings for license files Jagadeesh Krishnanjanappa
2015-12-04 15:27 ` Jagadeesh Krishnanjanappa
2015-12-10 10:49   ` Jagadeesh Krishnanjanappa
2016-03-04 12:51   ` Martin Jansa
2016-03-07 15:59 ` Burton, Ross
2016-03-07 16:45   ` Jagadeesh Krishnanjanappa
2016-03-07 17:16     ` Burton, Ross
2016-03-07 17:20       ` Jagadeesh Krishnanjanappa

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.