summaryrefslogtreecommitdiffstats
path: root/scripts
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:11 +0100
commit1a2bc70e6f85f414e7af48489e24c09ff335486d (patch)
tree25b507bc8ca6dcb42b2e1f24b6d4e691d028d39f /scripts
parentb591ba6f4d684aef3d7666bbdc678954e3255df5 (diff)
downloadopenembedded-core-contrib-1a2bc70e6f85f414e7af48489e24c09ff335486d.tar.gz
wic: implement ext fs support for 'wic cp'
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>
Diffstat (limited to 'scripts')
-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 c6a63f2080a..9ebd93ae278 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -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):