diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2020-04-19 08:35:32 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-04-26 13:58:45 +0100 |
commit | 2dbd692b8e563cf991fb4ae1ef6129fda0d7e3c4 (patch) | |
tree | 6e4bb32b72cd0e26d9252a1daebd131e48f2012c /scripts/lib | |
parent | 2265d089a58e1f78f26d623ee667c420cb1c3bd4 (diff) | |
download | openembedded-core-contrib-2dbd692b8e563cf991fb4ae1ef6129fda0d7e3c4.tar.gz |
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>
Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/plugins/source/rootfs.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index 85c634f8a1..247f61ff7c 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py @@ -136,7 +136,6 @@ class RootfsPlugin(SourcePlugin): sys.exit(1) full_path = os.path.realpath(os.path.join(new_rootfs, path)) - # Disallow climbing outside of parent directory using '..', # because doing so could be quite disastrous (we will delete the # directory). @@ -144,6 +143,9 @@ class RootfsPlugin(SourcePlugin): logger.error("'%s' points to a path outside the rootfs" % orig_path) sys.exit(1) + if not os.path.lexists(full_path): + continue + if path.endswith(os.sep): # Delete content only. for entry in os.listdir(full_path): |