summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic')
-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):