summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/imager/direct.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/plugins/imager/direct.py')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 96168aadb4..9d10ec01d0 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -77,7 +77,8 @@ class DirectPlugin(ImagerPlugin):
77 77
78 image_path = self._full_path(self.workdir, self.parts[0].disk, "direct") 78 image_path = self._full_path(self.workdir, self.parts[0].disk, "direct")
79 self._image = PartitionedImage(image_path, self.ptable_format, 79 self._image = PartitionedImage(image_path, self.ptable_format,
80 self.parts, self.native_sysroot) 80 self.parts, self.native_sysroot,
81 options.extra_space)
81 82
82 def setup_workdir(self, workdir): 83 def setup_workdir(self, workdir):
83 if workdir: 84 if workdir:
@@ -293,7 +294,7 @@ class PartitionedImage():
293 Partitioned image in a file. 294 Partitioned image in a file.
294 """ 295 """
295 296
296 def __init__(self, path, ptable_format, partitions, native_sysroot=None): 297 def __init__(self, path, ptable_format, partitions, native_sysroot=None, extra_space=0):
297 self.path = path # Path to the image file 298 self.path = path # Path to the image file
298 self.numpart = 0 # Number of allocated partitions 299 self.numpart = 0 # Number of allocated partitions
299 self.realpart = 0 # Number of partitions in the partition table 300 self.realpart = 0 # Number of partitions in the partition table
@@ -314,6 +315,7 @@ class PartitionedImage():
314 self.sector_size = SECTOR_SIZE 315 self.sector_size = SECTOR_SIZE
315 self.native_sysroot = native_sysroot 316 self.native_sysroot = native_sysroot
316 num_real_partitions = len([p for p in self.partitions if not p.no_table]) 317 num_real_partitions = len([p for p in self.partitions if not p.no_table])
318 self.extra_space = extra_space
317 319
318 # calculate the real partition number, accounting for partitions not 320 # calculate the real partition number, accounting for partitions not
319 # in the partition table and logical partitions 321 # in the partition table and logical partitions
@@ -483,6 +485,7 @@ class PartitionedImage():
483 self.min_size += GPT_OVERHEAD 485 self.min_size += GPT_OVERHEAD
484 486
485 self.min_size *= self.sector_size 487 self.min_size *= self.sector_size
488 self.min_size += self.extra_space
486 489
487 def _create_partition(self, device, parttype, fstype, start, size): 490 def _create_partition(self, device, parttype, fstype, start, size):
488 """ Create a partition on an image described by the 'device' object. """ 491 """ Create a partition on an image described by the 'device' object. """