diff options
Diffstat (limited to 'scripts/lib/wic/plugins/source')
| -rw-r--r-- | scripts/lib/wic/plugins/source/rootfs.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index 8b2a067385..c96c539d03 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py | |||
| @@ -129,17 +129,20 @@ class RootfsPlugin(SourcePlugin): | |||
| 129 | logger.error("'%s' points to a path outside the rootfs" % orig_path) | 129 | logger.error("'%s' points to a path outside the rootfs" % orig_path) |
| 130 | sys.exit(1) | 130 | sys.exit(1) |
| 131 | 131 | ||
| 132 | if new_pseudo: | ||
| 133 | pseudo = cls.__get_pseudo(native_sysroot, new_rootfs, new_pseudo) | ||
| 134 | else: | ||
| 135 | pseudo = None | ||
| 132 | if path.endswith(os.sep): | 136 | if path.endswith(os.sep): |
| 133 | # Delete content only. | 137 | # Delete content only. |
| 134 | for entry in os.listdir(full_path): | 138 | for entry in os.listdir(full_path): |
| 135 | full_entry = os.path.join(full_path, entry) | 139 | full_entry = os.path.join(full_path, entry) |
| 136 | if os.path.isdir(full_entry) and not os.path.islink(full_entry): | 140 | rm_cmd = "rm -rf %s" % (full_entry) |
| 137 | shutil.rmtree(full_entry) | 141 | exec_native_cmd(rm_cmd, native_sysroot, pseudo) |
| 138 | else: | ||
| 139 | os.remove(full_entry) | ||
| 140 | else: | 142 | else: |
| 141 | # Delete whole directory. | 143 | # Delete whole directory. |
| 142 | shutil.rmtree(full_path) | 144 | rm_cmd = "rm -rf %s" % (full_path) |
| 145 | exec_native_cmd(rm_cmd, native_sysroot, pseudo) | ||
| 143 | 146 | ||
| 144 | part.prepare_rootfs(cr_workdir, oe_builddir, | 147 | part.prepare_rootfs(cr_workdir, oe_builddir, |
| 145 | new_rootfs or part.rootfs_dir, native_sysroot, | 148 | new_rootfs or part.rootfs_dir, native_sysroot, |
