summaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2016-04-04 21:02:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 10:29:23 +0100
commitf7fed7ce75457a270443fba926eaf0fdcffbf998 (patch)
treef0754bf840dc05602544969e046b59a44a12df3b /meta/classes/license.bbclass
parent43071a0d67a347ee1e197cbf573ffe222f89d199 (diff)
downloadpoky-f7fed7ce75457a270443fba926eaf0fdcffbf998.tar.gz
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 rev: d00b2250a6afebd7d1373c04b4006290f0cd4043) Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index ba95c9ac84..94be559f44 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -354,9 +354,11 @@ def copy_license_files(lic_files_paths, destdir):
354 os.chown(dst,0,0) 354 os.chown(dst,0,0)
355 except OSError as err: 355 except OSError as err:
356 import errno 356 import errno
357 if err.errno == errno.EPERM: 357 if err.errno in (errno.EPERM, errno.EINVAL):
358 # suppress "Operation not permitted" error, as 358 # Suppress "Operation not permitted" error, as
359 # sometimes this function is not executed under pseudo 359 # sometimes this function is not executed under pseudo.
360 # Also ignore "Invalid argument" errors that happen in
361 # some (unprivileged) container environments (no root).
360 pass 362 pass
361 else: 363 else:
362 raise 364 raise