diff options
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r-- | scripts/lib/wic/plugins/source/rawcopy.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py index b3b55fa022..cf6236a04f 100644 --- a/scripts/lib/wic/plugins/source/rawcopy.py +++ b/scripts/lib/wic/plugins/source/rawcopy.py | |||
@@ -64,14 +64,21 @@ class RawCopyPlugin(SourcePlugin): | |||
64 | return | 64 | return |
65 | 65 | ||
66 | src = os.path.join(bootimg_dir, source_params['file']) | 66 | src = os.path.join(bootimg_dir, source_params['file']) |
67 | dst = src | ||
68 | |||
69 | if ('skip' in source_params): | ||
70 | dst = os.path.join(cr_workdir, source_params['file']) | ||
71 | dd_cmd = "dd if=%s of=%s ibs=%s skip=1 conv=notrunc" % \ | ||
72 | (src, dst, source_params['skip']) | ||
73 | exec_cmd(dd_cmd) | ||
67 | 74 | ||
68 | # get the size in the right units for kickstart (kB) | 75 | # get the size in the right units for kickstart (kB) |
69 | du_cmd = "du -Lbks %s" % src | 76 | du_cmd = "du -Lbks %s" % dst |
70 | out = exec_cmd(du_cmd) | 77 | out = exec_cmd(du_cmd) |
71 | filesize = out.split()[0] | 78 | filesize = out.split()[0] |
72 | 79 | ||
73 | if filesize > part.size: | 80 | if filesize > part.size: |
74 | part.size = filesize | 81 | part.size = filesize |
75 | 82 | ||
76 | part.source_file = src | 83 | part.source_file = dst |
77 | 84 | ||