summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/image.bbclass12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index d93de02b75..ec940a4b65 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -534,21 +534,29 @@ def get_rootfs_size(d):
534 output = subprocess.check_output(['du', '-ks', 534 output = subprocess.check_output(['du', '-ks',
535 d.getVar('IMAGE_ROOTFS')]) 535 d.getVar('IMAGE_ROOTFS')])
536 size_kb = int(output.split()[0]) 536 size_kb = int(output.split()[0])
537
537 base_size = size_kb * overhead_factor 538 base_size = size_kb * overhead_factor
538 base_size = max(base_size, rootfs_req_size) + rootfs_extra_space 539 bb.debug(1, '%f = %d * %f' % (base_size, size_kb, overhead_factor))
540 base_size2 = max(base_size, rootfs_req_size) + rootfs_extra_space
541 bb.debug(1, '%f = max(%f, %d)[%f] + %d' % (base_size2, base_size, rootfs_req_size, max(base_size, rootfs_req_size), overhead_factor))
539 542
543 base_size = base_size2
540 if base_size != int(base_size): 544 if base_size != int(base_size):
541 base_size = int(base_size + 1) 545 base_size = int(base_size + 1)
542 else: 546 else:
543 base_size = int(base_size) 547 base_size = int(base_size)
548 bb.debug(1, '%f = int(%f)' % (base_size, base_size2))
544 549
550 base_size_saved = base_size
545 base_size += rootfs_alignment - 1 551 base_size += rootfs_alignment - 1
546 base_size -= base_size % rootfs_alignment 552 base_size -= base_size % rootfs_alignment
553 bb.debug(1, '%d = aligned(%d)' % (base_size, base_size_saved))
547 554
548 # Do not check image size of the debugfs image. This is not supposed 555 # Do not check image size of the debugfs image. This is not supposed
549 # to be deployed, etc. so it doesn't make sense to limit the size 556 # to be deployed, etc. so it doesn't make sense to limit the size
550 # of the debug. 557 # of the debug.
551 if (d.getVar('IMAGE_BUILDING_DEBUGFS') or "") == "true": 558 if (d.getVar('IMAGE_BUILDING_DEBUGFS') or "") == "true":
559 bb.debug(1, 'returning debugfs size %d' % (base_size))
552 return base_size 560 return base_size
553 561
554 # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set) 562 # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set)
@@ -566,6 +574,8 @@ def get_rootfs_size(d):
566 (base_size, initramfs_maxsize_int)) 574 (base_size, initramfs_maxsize_int))
567 bb.error("You can set INITRAMFS_MAXSIZE a larger value. Usually, it should") 575 bb.error("You can set INITRAMFS_MAXSIZE a larger value. Usually, it should")
568 bb.fatal("be less than 1/2 of ram size, or you may fail to boot it.\n") 576 bb.fatal("be less than 1/2 of ram size, or you may fail to boot it.\n")
577
578 bb.debug(1, 'returning %d' % (base_size))
569 return base_size 579 return base_size
570 580
571python set_image_size () { 581python set_image_size () {