summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-03-01 13:54:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-10 10:47:42 +0000
commit1aa32a115addac9730bc52e8c98e166f201c29b9 (patch)
treea26a286bb2f87136fbb9fd780bd5480caa5be050 /scripts
parent5e2dd63d2bd808ba2b406dddea61d262c5d01212 (diff)
downloadpoky-1aa32a115addac9730bc52e8c98e166f201c29b9.tar.gz
wic: rawcopy: support skipping
Add support for skipping the beginning of a file with the rawcopy plugin. (From OE-Core rev: 89db37c85ac0d0035dbeb9643d7802ca28681e76) Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/source/rawcopy.py11
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