summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-06-13 14:22:07 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 10:18:21 +0100
commit416e4599960987f0ce31b3f16f3c6af0bf633a26 (patch)
tree25c1a8ae63af3aee8dd1c8e79342b2f8436d7f2f
parent7a7e6635e2e2ddfff2bca58c860634b7a199b0df (diff)
downloadopenembedded-core-contrib-416e4599960987f0ce31b3f16f3c6af0bf633a26.tar.gz
openembedded-core-contrib-416e4599960987f0ce31b3f16f3c6af0bf633a26.tar.bz2
openembedded-core-contrib-416e4599960987f0ce31b3f16f3c6af0bf633a26.zip
wic: fully implement 'wic cp'
Added implementation of Disk.copy method and wic_cp function that copies files/directories to the vfat partition of the partitioned image. [YOCTO #11283] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/engine.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 6a4f55f348..a48c4adafb 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -310,6 +310,14 @@ class Disk:
self._get_part_image(pnum),
path))
+ 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)
+ self._put_part_image(pnum)
+
def wic_ls(args, native_sysroot):
"""List contents of partitioned image or vfat partition."""
disk = Disk(args.path.image, native_sysroot)
@@ -329,7 +337,8 @@ def wic_cp(args, native_sysroot):
Copy local file or directory to the vfat partition of
partitioned image.
"""
- pass
+ disk = Disk(args.dest.image, native_sysroot)
+ disk.copy(args.src, args.dest.part, args.dest.path)
def find_canned(scripts_path, file_name):
"""