summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-09-05 14:54:37 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-11 17:30:28 +0100
commit9f90956967caca7be50e501b3843dfaf03d90943 (patch)
treea44ae893ba4588d9f2ebd6022daaa77f31df9839
parent798f696623508220fefef8d6bd1adf8cacac45d9 (diff)
downloadpoky-9f90956967caca7be50e501b3843dfaf03d90943.tar.gz
wic: implement ext fs support for 'wic cp'
Implemented copying files to the ext partition using debugfs tool. (From OE-Core rev: 1a2bc70e6f85f414e7af48489e24c09ff335486d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/engine.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index c6a63f2080..9ebd93ae27 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -325,10 +325,15 @@ class Disk:
325 325
326 def copy(self, src, pnum, path): 326 def copy(self, src, pnum, path):
327 """Copy partition image into wic image.""" 327 """Copy partition image into wic image."""
328 cmd = "{} -i {} -snop {} ::{}".format(self.mcopy, 328 if self.partitions[pnum].fstype.startswith('ext'):
329 self._get_part_image(pnum), 329 cmd = "echo -e 'cd {}\nwrite {} {}' | {} -w {}".\
330 src, path) 330 format(path, src, os.path.basename(src),
331 exec_cmd(cmd) 331 self.debugfs, self._get_part_image(pnum))
332 else: # fat
333 cmd = "{} -i {} -snop {} ::{}".format(self.mcopy,
334 self._get_part_image(pnum),
335 src, path)
336 exec_cmd(cmd, as_shell=True)
332 self._put_part_image(pnum) 337 self._put_part_image(pnum)
333 338
334 def remove(self, pnum, path): 339 def remove(self, pnum, path):