diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-08-31 00:14:27 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-30 23:26:26 +0100 |
commit | 7b421dccc12e0caa001227717bb7231471cd29e6 (patch) | |
tree | e0651c01dab31716c05eecfa6de4545db139dc1c /scripts/lib | |
parent | 4f7b72a07dea986103ec5bf5d088dba36f4f1b3c (diff) | |
download | poky-7b421dccc12e0caa001227717bb7231471cd29e6.tar.gz |
wic: use bitbake variable ROOTFS_SIZE
If bitbake image is referenced in .ks file and --size is not used
there wic uses ROOTFS_SIZE variable to set minimum partition size.
ROOTFS_SIZE is calculated in meta/lib/oe/image.py when rootfs is
created. The calculation is done using other image parameters:
IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, IMAGE_OVERHEAD_FACTOR
and IMAGE_ROOTFS_EXTRA_SPACE.
(From OE-Core rev: 173d440c14ee3140ae08c6a87decc9b2f4c9e391)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 |