mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 09:49:33 +02:00
wic: Continue if excluded_path does not exist
If an excuded path does not exist, continue without an error. This allows to seamleasly reuse .wks among different projects. Eg: part / --source rootfs --fstype=ext4 --exclude-path=opt/private_keys Where /opt/private_keys in only populated by some of the image.bb files. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 2dbd692b8e563cf991fb4ae1ef6129fda0d7e3c4) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d19004da2f
commit
19e778fe1b
@@ -136,7 +136,6 @@ class RootfsPlugin(SourcePlugin):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
full_path = os.path.realpath(os.path.join(new_rootfs, path))
|
full_path = os.path.realpath(os.path.join(new_rootfs, path))
|
||||||
|
|
||||||
# Disallow climbing outside of parent directory using '..',
|
# Disallow climbing outside of parent directory using '..',
|
||||||
# because doing so could be quite disastrous (we will delete the
|
# because doing so could be quite disastrous (we will delete the
|
||||||
# directory).
|
# directory).
|
||||||
@@ -144,6 +143,9 @@ class RootfsPlugin(SourcePlugin):
|
|||||||
logger.error("'%s' points to a path outside the rootfs" % orig_path)
|
logger.error("'%s' points to a path outside the rootfs" % orig_path)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if not os.path.lexists(full_path):
|
||||||
|
continue
|
||||||
|
|
||||||
if path.endswith(os.sep):
|
if path.endswith(os.sep):
|
||||||
# Delete content only.
|
# Delete content only.
|
||||||
for entry in os.listdir(full_path):
|
for entry in os.listdir(full_path):
|
||||||
|
|||||||
Reference in New Issue
Block a user