summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/partition.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/partition.py')
-rw-r--r--scripts/lib/wic/partition.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 227b685137..6d21193902 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -220,9 +220,7 @@ class Partition(object):
220 msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \ 220 msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
221 (extra_blocks, self.mountpoint, rootfs_size)) 221 (extra_blocks, self.mountpoint, rootfs_size))
222 222
223 dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k" % \ 223 exec_cmd("truncate %s -s %d" % (rootfs, rootfs_size * 1024))
224 (rootfs, rootfs_size)
225 exec_cmd(dd_cmd)
226 224
227 extra_imagecmd = "-i 8192" 225 extra_imagecmd = "-i 8192"
228 226
@@ -255,9 +253,7 @@ class Partition(object):
255 msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \ 253 msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
256 (extra_blocks, self.mountpoint, rootfs_size)) 254 (extra_blocks, self.mountpoint, rootfs_size))
257 255
258 dd_cmd = "dd if=/dev/zero of=%s bs=1024 seek=%d count=0 bs=1k" % \ 256 exec_cmd("truncate %s -s %d" % (rootfs, rootfs_size * 1024))
259 (rootfs, rootfs_size)
260 exec_cmd(dd_cmd)
261 257
262 label_str = "" 258 label_str = ""
263 if self.label: 259 if self.label:
@@ -320,9 +316,7 @@ class Partition(object):
320 """ 316 """
321 Prepare an empty ext2/3/4 partition. 317 Prepare an empty ext2/3/4 partition.
322 """ 318 """
323 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ 319 exec_cmd("truncate %s -s %d" % (rootfs, self.size * 1024))
324 (rootfs, self.size)
325 exec_cmd(dd_cmd)
326 320
327 extra_imagecmd = "-i 8192" 321 extra_imagecmd = "-i 8192"
328 322
@@ -339,9 +333,7 @@ class Partition(object):
339 """ 333 """
340 Prepare an empty btrfs partition. 334 Prepare an empty btrfs partition.
341 """ 335 """
342 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ 336 exec_cmd("truncate %s -s %d" % (rootfs, self.size * 1024))
343 (rootfs, self.size)
344 exec_cmd(dd_cmd)
345 337
346 label_str = "" 338 label_str = ""
347 if self.label: 339 if self.label:
@@ -402,9 +394,7 @@ class Partition(object):
402 """ 394 """
403 path = "%s/fs.%s" % (cr_workdir, self.fstype) 395 path = "%s/fs.%s" % (cr_workdir, self.fstype)
404 396
405 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ 397 exec_cmd("truncate %s -s %d" % (path, self.size * 1024))
406 (path, self.size)
407 exec_cmd(dd_cmd)
408 398
409 import uuid 399 import uuid
410 label_str = "" 400 label_str = ""