summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/partition.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index f427c8101b..2a71d7b1d6 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -212,19 +212,13 @@ class Partition():
212 if os.path.isfile(rootfs): 212 if os.path.isfile(rootfs):
213 os.remove(rootfs) 213 os.remove(rootfs)
214 214
215 # Get rootfs size from bitbake variable if it's not set in .ks file 215 # If size is not specified compute it from the rootfs_dir size
216 if not self.size and real_rootfs: 216 if not self.size and real_rootfs:
217 # Bitbake variable ROOTFS_SIZE is calculated in 217 # Use the same logic found in get_rootfs_size()
218 # Image._get_rootfs_size method from meta/lib/oe/image.py 218 # from meta/classes/image.bbclass
219 # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, 219 du_cmd = "du -ks %s" % rootfs_dir
220 # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE 220 out = exec_cmd(du_cmd)
221 rsize_bb = get_bitbake_var('ROOTFS_SIZE') 221 self.size = int(out.split()[0])
222 if rsize_bb:
223 logger.warning('overhead-factor was specified, but size was not,'
224 ' so bitbake variables will be used for the size.'
225 ' In this case both IMAGE_OVERHEAD_FACTOR and '
226 '--overhead-factor will be applied')
227 self.size = int(round(float(rsize_bb)))
228 222
229 prefix = "ext" if self.fstype.startswith("ext") else self.fstype 223 prefix = "ext" if self.fstype.startswith("ext") else self.fstype
230 method = getattr(self, "prepare_rootfs_" + prefix) 224 method = getattr(self, "prepare_rootfs_" + prefix)