mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 12:49:34 +02:00
wic: call os.ftruncate instead of running truncate
Replaced running of truncate utility with the standard library call os.ftruncate (From OE-Core rev: 1ba6101ceaee354816e690d44bc9a5dd8dcf4011) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
eb345ca720
commit
c8669749e3
@@ -56,8 +56,9 @@ class DiskImage():
|
||||
if self.created:
|
||||
return
|
||||
# create sparse disk image
|
||||
cmd = "truncate %s -s %s" % (self.device, self.size)
|
||||
exec_cmd(cmd)
|
||||
with open(self.device, 'w') as sparse:
|
||||
os.ftruncate(sparse.fileno(), self.size)
|
||||
|
||||
self.created = True
|
||||
|
||||
class DirectImageCreator(BaseImageCreator):
|
||||
|
||||
Reference in New Issue
Block a user