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.

Signed-off-by: Ricardo Ribalda Delgado <rica...@ribalda.com>
---
 scripts/lib/wic/plugins/source/rootfs.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/lib/wic/plugins/source/rootfs.py 
b/scripts/lib/wic/plugins/source/rootfs.py
index d3742802bb..8874ac62c4 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -131,6 +131,9 @@ class RootfsPlugin(SourcePlugin):
                     sys.exit(1)
 
                 full_path = os.path.realpath(os.path.join(new_rootfs, path))
+                
+                if not os.path.lexists(full_path):
+                    continue
 
                 # Disallow climbing outside of parent directory using '..',
                 # because doing so could be quite disastrous (we will delete 
the
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#137160): 
https://lists.openembedded.org/g/openembedded-core/message/137160
Mute This Topic: https://lists.openembedded.org/mt/72899597/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to