wic: plugins: rawcopy: Fixed wrong variable type
PATCH 1/2 wic: plugins: rawcopy: Fixed wrong variable type
Without the int() function this variable will be a string. This will led to a error in Filemap on line 545 due wrong types.
Quoted 5 lines
[...]
File
".../poky/scripts/lib/wic/filemap.py", line 545, insparse_copy
if start < skip < end:
TypeError: unorderable types:int()<str()
Signed-off-by Daniel Schultz <[email protected]>
--- scripts/lib/wic/plugins/source/rawcopy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/plugins/source/rawcopy.py +1 -1
@@ -71,7 +71,7 @@ class RawCopyPlugin(SourcePlugin): dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno)) if 'skip' in source_params: - sparse_copy(src, dst, skip=source_params['skip']) + sparse_copy(src, dst, skip=int(source_params['skip'])) else: sparse_copy(src, dst)
Signature · 1 line
1.9.1
PATCH 2/2 wic: filemap: Fixed spared_copy skip
This patches removes the empty space in front of the copied file which was skipped. Without this reduction it's not possible to place a partition with rawcopy and skip parameter on a desired alignment.
Signed-off-by Daniel Schultz <[email protected]>
--- scripts/lib/wic/filemap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/lib/wic/filemap.py +3 -3
@@ -543,9 +543,9 @@ def sparse_copy(src_fname, dst_fname, offset=0, skip=0): end = (last + 1) * fmap.block_size if start < skip < end: - start = skip - - fmap._f_image.seek(start, os.SEEK_SET) + fmap._f_image.seek(skip, os.SEEK_SET) + else: + fmap._f_image.seek(start, os.SEEK_SET) dst_file.seek(offset + start, os.SEEK_SET) chunk_size = 1024 * 1024
Signature · 1 line
1.9.1