diff options
Diffstat (limited to 'scripts/lib/wic/plugins/source/rootfs.py')
-rw-r--r-- | scripts/lib/wic/plugins/source/rootfs.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index afb1eb9202..6fd415af5b 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py | |||
@@ -103,9 +103,9 @@ class RootfsPlugin(SourcePlugin): | |||
103 | new_rootfs = None | 103 | new_rootfs = None |
104 | new_pseudo = None | 104 | new_pseudo = None |
105 | # Handle excluded paths. | 105 | # Handle excluded paths. |
106 | if part.exclude_path or part.include_path or part.change_directory: | 106 | if part.exclude_path or part.include_path or part.change_directory or part.updated_fstab_path: |
107 | # We need a new rootfs directory we can delete files from. Copy to | 107 | # We need a new rootfs directory we can safely modify without |
108 | # workdir. | 108 | # interfering with other tasks. Copy to workdir. |
109 | new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno)) | 109 | new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno)) |
110 | 110 | ||
111 | if os.path.lexists(new_rootfs): | 111 | if os.path.lexists(new_rootfs): |
@@ -214,6 +214,17 @@ class RootfsPlugin(SourcePlugin): | |||
214 | rm_cmd = "rm -rf %s" % (full_path) | 214 | rm_cmd = "rm -rf %s" % (full_path) |
215 | exec_native_cmd(rm_cmd, native_sysroot, pseudo) | 215 | exec_native_cmd(rm_cmd, native_sysroot, pseudo) |
216 | 216 | ||
217 | has_fstab = os.path.exists(os.path.join(new_rootfs, "etc/fstab")) | ||
218 | if part.updated_fstab_path and has_fstab: | ||
219 | fstab_path = os.path.join(new_rootfs, "etc/fstab") | ||
220 | # Assume that fstab should always be owned by root with fixed permissions | ||
221 | install_cmd = "install -m 0644 %s %s" % (part.updated_fstab_path, fstab_path) | ||
222 | if new_pseudo: | ||
223 | pseudo = cls.__get_pseudo(native_sysroot, new_rootfs, new_pseudo) | ||
224 | else: | ||
225 | pseudo = None | ||
226 | exec_native_cmd(install_cmd, native_sysroot, pseudo) | ||
227 | |||
217 | part.prepare_rootfs(cr_workdir, oe_builddir, | 228 | part.prepare_rootfs(cr_workdir, oe_builddir, |
218 | new_rootfs or part.rootfs_dir, native_sysroot, | 229 | new_rootfs or part.rootfs_dir, native_sysroot, |
219 | pseudo_dir = new_pseudo or pseudo_dir) | 230 | pseudo_dir = new_pseudo or pseudo_dir) |