diff options
Diffstat (limited to 'meta/classes/image.bbclass')
| -rw-r--r-- | meta/classes/image.bbclass | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 797f342521..56a49e7dd4 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
| @@ -423,6 +423,9 @@ def get_rootfs_size(d): | |||
| 423 | rootfs_req_size = int(d.getVar('IMAGE_ROOTFS_SIZE', True)) | 423 | rootfs_req_size = int(d.getVar('IMAGE_ROOTFS_SIZE', True)) |
| 424 | rootfs_extra_space = eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True)) | 424 | rootfs_extra_space = eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True)) |
| 425 | rootfs_maxsize = d.getVar('IMAGE_ROOTFS_MAXSIZE', True) | 425 | rootfs_maxsize = d.getVar('IMAGE_ROOTFS_MAXSIZE', True) |
| 426 | image_fstypes = d.getVar('IMAGE_FSTYPES', True) or '' | ||
| 427 | initramfs_fstypes = d.getVar('INITRAMFS_FSTYPES', True) or '' | ||
| 428 | initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE', True) | ||
| 426 | 429 | ||
| 427 | output = subprocess.check_output(['du', '-ks', | 430 | output = subprocess.check_output(['du', '-ks', |
| 428 | d.getVar('IMAGE_ROOTFS', True)]) | 431 | d.getVar('IMAGE_ROOTFS', True)]) |
| @@ -443,8 +446,17 @@ def get_rootfs_size(d): | |||
| 443 | if rootfs_maxsize: | 446 | if rootfs_maxsize: |
| 444 | rootfs_maxsize_int = int(rootfs_maxsize) | 447 | rootfs_maxsize_int = int(rootfs_maxsize) |
| 445 | if base_size > rootfs_maxsize_int: | 448 | if base_size > rootfs_maxsize_int: |
| 446 | bb.fatal("The rootfs size %d(K) overrides the max size %d(K)" % \ | 449 | bb.fatal("The rootfs size %d(K) overrides IMAGE_ROOTFS_MAXSIZE: %d(K)" % \ |
| 447 | (base_size, rootfs_maxsize_int)) | 450 | (base_size, rootfs_maxsize_int)) |
| 451 | |||
| 452 | # Check the initramfs size against INITRAMFS_MAXSIZE (if set) | ||
| 453 | if image_fstypes == initramfs_fstypes != '' and initramfs_maxsize: | ||
| 454 | initramfs_maxsize_int = int(initramfs_maxsize) | ||
| 455 | if base_size > initramfs_maxsize_int: | ||
| 456 | bb.error("The initramfs size %d(K) overrides INITRAMFS_MAXSIZE: %d(K)" % \ | ||
| 457 | (base_size, initramfs_maxsize_int)) | ||
| 458 | bb.error("You can set INITRAMFS_MAXSIZE a larger value. Usually, it should") | ||
| 459 | bb.fatal("be less than 1/2 of ram size, or you may fail to boot it.\n") | ||
| 448 | return base_size | 460 | return base_size |
| 449 | 461 | ||
| 450 | python set_image_size () { | 462 | python set_image_size () { |
