From: Kristian Amlie <kristian.amlie@northern.tech>
To: Cal Sullivan <california.l.sullivan@intel.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v7] do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature.
Date: Thu, 15 Mar 2018 10:29:10 +0100 [thread overview]
Message-ID: <0704502f-c045-3703-c903-9f43fe1e342c@northern.tech> (raw)
In-Reply-To: <3d9848f0-9432-0717-f4f0-0c37dba63b9f@intel.com>
On 13/02/18 02:29, Cal Sullivan wrote:
>> ...
>> +
>> + if path.endswith(os.sep):
> We need to check if full_path exists here, else it may try modifying
> things that don't exist. E.g., if I have IMAGE_ROOTFS_EXCLUDE_PATH =
> "boot" in local.conf and do 'bitbake core-image-minimal-initramfs' I get
> the following:
>
> ERROR: core-image-minimal-initramfs-1.0-r0 do_image_cpio: Error
> executing a python function in exec_python_func() autogenerated:
>
> The stack trace of python calls that resulted in this exception/failure
> was:
> File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
> 0001:
> *** 0002:prepare_excluded_directories(d)
> 0003:
> File: '/home/clsulliv/yocto/poky/meta/classes/image.bbclass', lineno:
> 572, function: prepare_excluded_directories
> 0568: else:
> 0569: os.remove(full_entry)
> 0570: else:
> 0571: # Delete whole directory.
> *** 0572: shutil.rmtree(full_path)
> 0573:
> 0574: # Save old value for cleanup later.
> 0575: d.setVar('IMAGE_ROOTFS_ORIG', rootfs_orig)
> 0576: d.setVar('IMAGE_ROOTFS', new_rootfs)
> File: '/usr/lib64/python3.6/shutil.py', lineno: 471, function: rmtree
> 0467: # lstat()/open()/fstat() trick.
> 0468: try:
> 0469: orig_st = os.lstat(path)
> 0470: except Exception:
> *** 0471: onerror(os.lstat, path, sys.exc_info())
> 0472: return
> 0473: try:
> 0474: fd = os.open(path, os.O_RDONLY)
> 0475: except Exception:
> File: '/usr/lib64/python3.6/shutil.py', lineno: 469, function: rmtree
> 0465: path = os.fsdecode(path)
> 0466: # Note: To guard against symlink races, we use the
> standard
> 0467: # lstat()/open()/fstat() trick.
> 0468: try:
> *** 0469: orig_st = os.lstat(path)
> 0470: except Exception:
> 0471: onerror(os.lstat, path, sys.exc_info())
> 0472: return
> 0473: try:
> Exception: FileNotFoundError: [Errno 2] No such file or directory:
> '/home/clsulliv/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/core-image-minimal-initramfs/1.0-r0/rootfs.image_cpio/boot'
>
>
> ERROR: core-image-minimal-initramfs-1.0-r0 do_image_cpio: Function
> failed: prepare_excluded_directories
> ERROR: Logfile of failure stored in:
> /home/clsulliv/yocto/poky/build/tmp/work/intel_corei7_64-poky-linux/core-image-minimal-initramfs/1.0-r0/temp/log.do_image_cpio.23514
>
> ERROR: Task
> (/home/clsulliv/yocto/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_cpio)
> failed with exit code '1'
>
> Besides this, it works well. I'm using it here[1] as part of my attempt
> to improve EFI images.
>
> [1].
> https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=clsulliv/image-creation-exclude-path
Sorry for coming late to the party here. Nice find though, and the fix
looks good too.
Will you be pushing to get this merged in master? The process of getting
it merged has been quite slow until now, so I've been considering
implementing this downstream in the meta-mender layer instead, even
though I think it could benefit many OE/poky users.
--
Kristian
next prev parent reply other threads:[~2018-03-15 9:29 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 15:03 do_image: Adding support for IMAGE_ROOTFS_EXCLUDE_PATH Kristian Amlie
2017-04-26 15:03 ` [PATCH] do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature Kristian Amlie
2017-05-22 7:08 ` do_image: Adding support for IMAGE_ROOTFS_EXCLUDE_PATH Kristian Amlie
2017-05-22 8:46 ` Ed Bartosh
2017-05-22 9:38 ` Kristian Amlie
2017-05-30 7:46 ` Kristian Amlie
2017-05-30 7:46 ` [PATCH v2] do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature Kristian Amlie
2017-06-19 9:01 ` Kristian Amlie
2017-06-19 14:01 ` Kristian Amlie
2017-06-19 14:01 ` [PATCH v3] " Kristian Amlie
2017-08-23 11:44 ` [PATCH v4] " Kristian Amlie
2017-08-23 11:46 ` Kristian Amlie
2017-08-23 11:46 ` [PATCH v4] " Kristian Amlie
2017-08-23 12:39 ` Kristian Amlie
2017-08-23 12:39 ` [PATCH v5] " Kristian Amlie
2017-08-23 12:47 ` Richard Purdie
2017-08-23 13:19 ` Kristian Amlie
2017-08-28 15:47 ` Kristian Amlie
2017-08-28 15:47 ` [PATCH v6] " Kristian Amlie
2017-09-18 6:45 ` Kristian Amlie
2017-10-13 9:08 ` Kristian Amlie
2017-10-13 9:08 ` [PATCH v7] " Kristian Amlie
2017-10-13 10:37 ` [PATCH v6] " Alexander Kanavin
2017-10-13 11:22 ` Kristian Amlie
2017-11-22 13:13 ` Kristian Amlie
2017-11-22 13:13 ` [PATCH v7] " Kristian Amlie
2017-11-22 13:31 ` [PATCH v6] " Alexander Kanavin
2017-11-22 13:35 ` Kristian Amlie
2018-01-25 10:33 ` Kristian Amlie
2018-01-25 10:33 ` [PATCH v7] " Kristian Amlie
2018-01-25 10:58 ` Martin Hundebøll
2018-02-13 1:29 ` Cal Sullivan
2018-03-15 9:29 ` Kristian Amlie [this message]
2017-08-23 12:46 ` Richard Purdie
2017-08-23 13:19 ` Kristian Amlie
2017-05-30 8:01 ` ✗ patchtest: failure for do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature. (rev2) Patchwork
2017-06-19 14:31 ` ✗ patchtest: failure for do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature. (rev3) Patchwork
2017-08-23 12:04 ` ✗ patchtest: failure for do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature. (rev4) Patchwork
2017-08-23 12:04 ` ✗ patchtest: failure for do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature. (rev5) Patchwork
2017-08-23 13:04 ` ✗ patchtest: failure for do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature. (rev6) Patchwork
2017-08-23 15:12 ` Leonardo Sandoval
[not found] <28aa69fb-383c-642f-c12c-66c8350029af@prevas.dk>
2018-01-26 9:56 ` [PATCH v7] do_image: Implement IMAGE_ROOTFS_EXCLUDE_PATH feature Kristian Amlie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0704502f-c045-3703-c903-9f43fe1e342c@northern.tech \
--to=kristian.amlie@northern.tech \
--cc=california.l.sullivan@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.