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>
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).
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):