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.py17
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 ff1313717e..f19ec3312b 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -86,9 +86,9 @@ class RootfsPlugin(SourcePlugin):
86 new_rootfs = None 86 new_rootfs = None
87 new_pseudo = None 87 new_pseudo = None
88 # Handle excluded paths. 88 # Handle excluded paths.
89 if part.exclude_path or part.include_path or part.change_directory: 89 if part.exclude_path or part.include_path or part.change_directory or part.updated_fstab_path:
90 # We need a new rootfs directory we can delete files from. Copy to 90 # We need a new rootfs directory we can safely modify without
91 # workdir. 91 # interfering with other tasks. Copy to workdir.
92 new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno)) 92 new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno))
93 93
94 if os.path.lexists(new_rootfs): 94 if os.path.lexists(new_rootfs):
@@ -159,6 +159,17 @@ class RootfsPlugin(SourcePlugin):
159 rm_cmd = "rm -rf %s" % (full_path) 159 rm_cmd = "rm -rf %s" % (full_path)
160 exec_native_cmd(rm_cmd, native_sysroot, pseudo) 160 exec_native_cmd(rm_cmd, native_sysroot, pseudo)
161 161
162 has_fstab = os.path.exists(os.path.join(new_rootfs, "etc/fstab"))
163 if part.updated_fstab_path and has_fstab:
164 fstab_path = os.path.join(new_rootfs, "etc/fstab")
165 # Assume that fstab should always be owned by root with fixed permissions
166 install_cmd = "install -m 0644 %s %s" % (part.updated_fstab_path, fstab_path)
167 if new_pseudo:
168 pseudo = cls.__get_pseudo(native_sysroot, new_rootfs, new_pseudo)
169 else:
170 pseudo = None
171 exec_native_cmd(install_cmd, native_sysroot, pseudo)
172
162 part.prepare_rootfs(cr_workdir, oe_builddir, 173 part.prepare_rootfs(cr_workdir, oe_builddir,
163 new_rootfs or part.rootfs_dir, native_sysroot, 174 new_rootfs or part.rootfs_dir, native_sysroot,
164 pseudo_dir = new_pseudo or pseudo_dir) 175 pseudo_dir = new_pseudo or pseudo_dir)