diff options
Diffstat (limited to 'scripts/lib/wic/partition.py')
-rw-r--r-- | scripts/lib/wic/partition.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index ac4c836bdb..b191cdee54 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -28,7 +28,7 @@ import os | |||
28 | import tempfile | 28 | import tempfile |
29 | 29 | ||
30 | from wic.utils.oe.misc import msger, parse_sourceparams | 30 | from wic.utils.oe.misc import msger, parse_sourceparams |
31 | from wic.utils.oe.misc import exec_cmd, exec_native_cmd | 31 | from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var |
32 | from wic.plugin import pluginmgr | 32 | from wic.plugin import pluginmgr |
33 | 33 | ||
34 | partition_methods = { | 34 | partition_methods = { |
@@ -194,6 +194,17 @@ class Partition(): | |||
194 | msger.error("File system for partition %s not specified in kickstart, " \ | 194 | msger.error("File system for partition %s not specified in kickstart, " \ |
195 | "use --fstype option" % (self.mountpoint)) | 195 | "use --fstype option" % (self.mountpoint)) |
196 | 196 | ||
197 | # Get rootfs size from bitbake variable if it's not set in .ks file | ||
198 | if not self.size: | ||
199 | # Bitbake variable ROOTFS_SIZE is calculated in | ||
200 | # Image._get_rootfs_size method from meta/lib/oe/image.py | ||
201 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, | ||
202 | # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE | ||
203 | rsize_bb = get_bitbake_var('ROOTFS_SIZE') | ||
204 | if rsize_bb: | ||
205 | msger.warning('overhead-factor was specified, but size was not, so bitbake variables will be used for the size. In this case both IMAGE_OVERHEAD_FACTOR and --overhead-factor will be applied') | ||
206 | self.size = int(round(float(rsize_bb))) | ||
207 | |||
197 | for prefix in ("ext", "btrfs", "vfat", "squashfs"): | 208 | for prefix in ("ext", "btrfs", "vfat", "squashfs"): |
198 | if self.fstype.startswith(prefix): | 209 | if self.fstype.startswith(prefix): |
199 | method = getattr(self, "prepare_rootfs_" + prefix) | 210 | method = getattr(self, "prepare_rootfs_" + prefix) |