My Poky source tree is in /opt/amltd/poky and is not other/world writeable. I get this error: | ERROR: Error executing a python function in /opt/amltd/poky/meta-xyz/packages/images/xyz-server-image.bb: | OSError: [Errno 1] Operation not permitted: '/opt/amltd/poky/LICENSE' | | ERROR: The stack trace of python calls that resulted in this exception/failure was: | ERROR: File "do_populate_lic", line 78, in <module> | ERROR: | ERROR: File "do_populate_lic", line 34, in do_populate_lic | ERROR: | ERROR: File "/opt/amltd/poky/bitbake/lib/bb/__init__.py", line 114, in newFunc | ERROR: return func(*args, **kwargs) | ERROR: | ERROR: File "/opt/amltd/poky/bitbake/lib/bb/utils.py", line 773, in copyfile | ERROR: os.chmod(src, stat.S_IRUSR) # Make sure we can read it | ERROR: | ERROR: The code that was being executed was: | ERROR: 0074: bb.warn("This could be either because we do not have a generic for this license or the LICENSE field is incorrect") | ERROR: 0075: pass | ERROR: 0076: | ERROR: 0077: | ERROR: *** 0078:do_populate_lic(d) | ERROR: 0079: | ERROR: (file: 'do_populate_lic', lineno: 78, function: <module>) | ERROR: 0030: for url in lic_files.split(): | ERROR: 0031: (type, host, path, user, pswd, parm) = bb.decodeurl(url) | ERROR: 0032: # We want the license file to be copied into the destination | ERROR: 0033: srclicfile = os.path.join(srcdir, path) | ERROR: *** 0034: ret = bb.copyfile(srclicfile, os.path.join(destdir, os.path.basename(path))) | ERROR: 0035: # If the copy didn't occur, something horrible went wrong and we fail out | ERROR: 0036: if ret is False or ret == 0: | ERROR: 0037: bb.warn("%s could not be copied for some reason. It may not exist. WARN for now." % srclicfile) | ERROR: 0038: | ERROR: (file: 'do_populate_lic', lineno: 34, function: do_populate_lic) | ERROR: Function 'do_populate_lic' failed The image recipe has this line: LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 " indicating I want to use just the generic license. My Poky source tree looks like this: $ ls -l /opt/amltd/poky/ total 52 drwxrwxr-x 6 root root 4096 Feb 5 13:04 bitbake drwxrwxr-x 8 root root 4096 Feb 5 13:04 documentation drwxrwxr-x 3 root root 4096 Oct 22 23:39 handbook -rw-rw-r-- 1 root root 545 Aug 18 2010 LICENSE drwxrwxr-x 20 root root 4096 Feb 5 13:04 meta drwxrwxr-x 4 root root 4096 Oct 27 13:33 meta-amltd drwxrwxr-x 4 root root 4096 Feb 1 21:50 meta-efacec drwxrwxr-x 4 root root 4096 Feb 5 13:04 meta-oe drwxrwxr-x 4 root root 4096 Oct 12 21:34 meta-oe_extra -rwxrwxr-x 1 root root 1493 Feb 5 13:04 poky-init-build-env -rw-rw-r-- 1 root root 636 Aug 18 2010 README drwxrwxr-x 5 root root 4096 Feb 23 23:46 scripts drwxrwxr-x 2 root root 4096 Feb 24 01:27 sources I think this condition should only be a warning as it clearly is under other circumstances which print messages like: WARNING: zip: Something went wrong with copying: Info-ZIP to /opt/amltd/poky/meta/files/common-licenses WARNING: This could be either because we do not have a generic for this license or the LICENSE field is incorrect
Created attachment 96 [details] Better error handling in bb.copyfile If the destination directory is write protected, no actions can be taken on files, hence all operations must be protected from exceptions.
I've fixed this in http://git.pokylinux.org/cgit.cgi/poky/commit/?id=9166b9e32fd6f618f9597b07d88cef09a88916a1 I've taken a different approach to the attachment since I'd rather just not touch the file at all if we already have read access. If we don't and its on a readonly filesystem, we're in trouble regardless.