[oe-commits] [openembedded-core] 03/06: license.bbclass: fix warnings when run in unprivileged "container" env
git at git.openembedded.org
git at git.openembedded.org
Mon May 9 13:37:50 UTC 2016
rpurdie pushed a commit to branch jethro
in repository openembedded-core.
commit e49794b9fe3391073138cb6116a46b37dd5119e7
Author: Bjørn Forsman <bjorn.forsman at gmail.com>
AuthorDate: Sun Apr 24 18:10:35 2016 -0700
license.bbclass: fix warnings when run in unprivileged "container" env
An unprivileged "container" environment like this[1] doesn't have root
account (uid 0) which causes tons of "Invalid argument" warnings:
$ bitbake ...
...
WARNING: Could not copy license file [src] to [dest]: [Errno 22] Invalid argument: '[src]'
WARNING: Could not copy license file [src] to [dest]: [Errno 22] Invalid argument: '[src]'
WARNING: Could not copy license file [src] to [dest]: [Errno 22] Invalid argument: '[src]'
...
Fix it by handling EINVAL similar to existing handling of EPERM (which
was added for when not running under pseudo).
[1]: The real environemnt is buildFHSUserEnv from NixOS/nixpkgs, but a
demonstration of the issue can be done like this:
$ touch f
$ unshare --user --mount chown 0:0 f
chown: changing ownership of ‘f’: Invalid argument
(From OE-Core master rev: d00b2250a6afebd7d1373c04b4006290f0cd4043)
Signed-off-by: Bjørn Forsman <bjorn.forsman at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/license.bbclass | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index c714da3..db0fc51 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -189,9 +189,11 @@ def copy_license_files(lic_files_paths, destdir):
os.chown(dst,0,0)
except OSError as err:
import errno
- if err.errno == errno.EPERM:
- # suppress "Operation not permitted" error, as
- # sometimes this function is not executed under pseudo
+ if err.errno in (errno.EPERM, errno.EINVAL):
+ # Suppress "Operation not permitted" error, as
+ # sometimes this function is not executed under pseudo.
+ # Also ignore "Invalid argument" errors that happen in
+ # some (unprivileged) container environments (no root).
pass
else:
raise
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list