diff options
Diffstat (limited to 'scripts/lib')
| -rw-r--r-- | scripts/lib/wic/imager/direct.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 57b1335a17..d68fd2a8c5 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py | |||
| @@ -29,6 +29,7 @@ import shutil | |||
| 29 | 29 | ||
| 30 | from wic import kickstart, msger | 30 | from wic import kickstart, msger |
| 31 | from wic.utils import fs_related | 31 | from wic.utils import fs_related |
| 32 | from wic.utils.oe.misc import get_bitbake_var | ||
| 32 | from wic.utils.partitionedfs import Image | 33 | from wic.utils.partitionedfs import Image |
| 33 | from wic.utils.errors import CreatorError, ImageError | 34 | from wic.utils.errors import CreatorError, ImageError |
| 34 | from wic.imager.baseimager import BaseImageCreator | 35 | from wic.imager.baseimager import BaseImageCreator |
| @@ -229,6 +230,19 @@ class DirectImageCreator(BaseImageCreator): | |||
| 229 | fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR")) | 230 | fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR")) |
| 230 | 231 | ||
| 231 | for p in parts: | 232 | for p in parts: |
| 233 | # get rootfs size from bitbake variable if it's not set in .ks file | ||
| 234 | if not p.size: | ||
| 235 | # and if rootfs name is specified for the partition | ||
| 236 | image_name = p.get_rootfs() | ||
| 237 | if image_name: | ||
| 238 | # Bitbake variable ROOTFS_SIZE is calculated in | ||
| 239 | # Image._get_rootfs_size method from meta/lib/oe/image.py | ||
| 240 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, | ||
| 241 | # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE | ||
| 242 | rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name) | ||
| 243 | if rsize_bb: | ||
| 244 | # convert from Kb to Mb | ||
| 245 | p.size = int(rsize_bb) / 1024 | ||
| 232 | # need to create the filesystems in order to get their | 246 | # need to create the filesystems in order to get their |
| 233 | # sizes before we can add them and do the layout. | 247 | # sizes before we can add them and do the layout. |
| 234 | # Image.create() actually calls __format_disks() to create | 248 | # Image.create() actually calls __format_disks() to create |
