diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-06-13 14:22:07 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-14 10:18:29 +0100 |
commit | 1a07d3502b8115011d29d63767694ea3a650be86 (patch) | |
tree | 7944c30e5c84866347bd65d8bd6d1c79ede25e06 /scripts/lib/wic/engine.py | |
parent | 0a84187b86f4430aef2bcbfccc656a07b8ba89a6 (diff) | |
download | poky-1a07d3502b8115011d29d63767694ea3a650be86.tar.gz |
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]
(From OE-Core rev: 416e4599960987f0ce31b3f16f3c6af0bf633a26)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/engine.py')
-rw-r--r-- | scripts/lib/wic/engine.py | 11 |
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: | |||
310 | self._get_part_image(pnum), | 310 | self._get_part_image(pnum), |
311 | path)) | 311 | path)) |
312 | 312 | ||
313 | def copy(self, src, pnum, path): | ||
314 | """Copy partition image into wic image.""" | ||
315 | cmd = "{} -i {} -snop {} ::{}".format(self.mcopy, | ||
316 | self._get_part_image(pnum), | ||
317 | src, path) | ||
318 | exec_cmd(cmd) | ||
319 | self._put_part_image(pnum) | ||
320 | |||
313 | def wic_ls(args, native_sysroot): | 321 | def wic_ls(args, native_sysroot): |
314 | """List contents of partitioned image or vfat partition.""" | 322 | """List contents of partitioned image or vfat partition.""" |
315 | disk = Disk(args.path.image, native_sysroot) | 323 | disk = Disk(args.path.image, native_sysroot) |
@@ -329,7 +337,8 @@ def wic_cp(args, native_sysroot): | |||
329 | Copy local file or directory to the vfat partition of | 337 | Copy local file or directory to the vfat partition of |
330 | partitioned image. | 338 | partitioned image. |
331 | """ | 339 | """ |
332 | pass | 340 | disk = Disk(args.dest.image, native_sysroot) |
341 | disk.copy(args.src, args.dest.part, args.dest.path) | ||
333 | 342 | ||
334 | def find_canned(scripts_path, file_name): | 343 | def find_canned(scripts_path, file_name): |
335 | """ | 344 | """ |