summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2017-12-06 20:28:34 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-18 18:03:58 +0000
commit370483fce1c2429c81b19dcf8a36394dc3fc3d92 (patch)
treeb345021cde3cc19e69de05a7f441e4c51c55a668 /meta/classes/image.bbclass
parentd0de33c5d4c33a212e6ae9d312f780dc7526332a (diff)
downloadpoky-370483fce1c2429c81b19dcf8a36394dc3fc3d92.tar.gz
image.bbclass: Add additional bb.debug to help track 12304
We actually caught the ext4 size issue in the wild with the debug output in the oe_mkext234fs() code, but it did not help. What that showed was that the get_rootfs_size was returning a default size of 8192, where as the actual rootfs was more like 10572, thus too large to fit in the created sparse file. This additional temporary debug code should help us determine where the failure might be. More debug for [YOCTO #12304] (From OE-Core rev: 978472c58629d1448399207873bbead96b27102e) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-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 () {