summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/source/rootfs.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/plugins/source/rootfs.py')
-rw-r--r--scripts/lib/wic/plugins/source/rootfs.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
index e26e95b991..705aeb5563 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -71,7 +71,7 @@ class RootfsPlugin(SourcePlugin):
71 71
72 new_rootfs = None 72 new_rootfs = None
73 # Handle excluded paths. 73 # Handle excluded paths.
74 if part.exclude_path is not None: 74 if part.exclude_path or part.include_path:
75 # We need a new rootfs directory we can delete files from. Copy to 75 # We need a new rootfs directory we can delete files from. Copy to
76 # workdir. 76 # workdir.
77 new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno)) 77 new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno))
@@ -81,7 +81,10 @@ class RootfsPlugin(SourcePlugin):
81 81
82 copyhardlinktree(part.rootfs_dir, new_rootfs) 82 copyhardlinktree(part.rootfs_dir, new_rootfs)
83 83
84 for orig_path in part.exclude_path: 84 for path in part.include_path or []:
85 copyhardlinktree(path, new_rootfs)
86
87 for orig_path in part.exclude_path or []:
85 path = orig_path 88 path = orig_path
86 if os.path.isabs(path): 89 if os.path.isabs(path):
87 logger.error("Must be relative: --exclude-path=%s" % orig_path) 90 logger.error("Must be relative: --exclude-path=%s" % orig_path)