]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: implement ext fs support for 'wic cp'
authorEd Bartosh <ed.bartosh@linux.intel.com>
Tue, 5 Sep 2017 11:54:37 +0000 (14:54 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Sep 2017 16:30:11 +0000 (17:30 +0100)
Implemented copying files to the ext partition
using debugfs tool.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/engine.py

index c6a63f2080a977e95177cb2fd7733434d421628a..9ebd93ae2783c6328b9e1c7c666c47cea66890b4 100644 (file)
@@ -325,10 +325,15 @@ class Disk:
 
     def copy(self, src, pnum, path):
         """Copy partition image into wic image."""
-        cmd = "{} -i {} -snop {} ::{}".format(self.mcopy,
-                                              self._get_part_image(pnum),
-                                              src, path)
-        exec_cmd(cmd)
+        if self.partitions[pnum].fstype.startswith('ext'):
+            cmd = "echo -e 'cd {}\nwrite {} {}' | {} -w {}".\
+                      format(path, src, os.path.basename(src),
+                             self.debugfs, self._get_part_image(pnum))
+        else: # fat
+            cmd = "{} -i {} -snop {} ::{}".format(self.mcopy,
+                                                  self._get_part_image(pnum),
+                                                  src, path)
+        exec_cmd(cmd, as_shell=True)
         self._put_part_image(pnum)
 
     def remove(self, pnum, path):