diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2019-05-22 19:02:51 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2019-05-22 20:18:58 +0200 |
commit | 8972efbaae6835522f12ca50570348a6c02a2ad5 (patch) | |
tree | 57293457e8169a65e3c8c9ec7e4ce5cbc40b6fcf /classes | |
parent | 4be87f5ddb0c53e2d4c2e8aeeaa84842aa5fb4ab (diff) |
image_type_tezi.bbclass: extend for apalis-imx8
The i.MX8 kernel is currently 20MB and doesn't fit in the hard coded 16MB
boot partition size.
Set the boot partition size dynamically to twice the payload size
rounded up to the next power of 2, but at least to 16MB.
The Apalis iMX8 needs additional firmware for HDMI in the boot partition.
Provide a new MACHINE_BOOT_FILES variable which adds to the list of to be
installed files.
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_type_tezi.bbclass | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass index dffcc3e..6e7a00b 100644 --- a/classes/image_type_tezi.bbclass +++ b/classes/image_type_tezi.bbclass @@ -47,6 +47,14 @@ def get_uncompressed_size(d, type=""): size = f.read().strip() return float(size) +# Make an educated guess of the needed boot partition size +# max(16MB, twice the size of the payload rounded up to the next 2^x number) +def get_bootfs_part_size(d): + from math import log + payload_size = get_uncompressed_size(d, 'bootfs.tar') / 1024 + part_size = 2 ** (2 + int(log (payload_size, 2))) + return max(16, part_size) + def rootfs_tezi_emmc(d): from collections import OrderedDict offset_bootrom = d.getVar('OFFSET_BOOTROM_PAYLOAD') @@ -75,7 +83,7 @@ def rootfs_tezi_emmc(d): "name": "mmcblk0", "partitions": [ { - "partition_size_nominal": 16, + "partition_size_nominal": get_bootfs_part_size(d), "want_maximised": False, "content": { "label": "BOOT", @@ -247,7 +255,7 @@ python rootfs_tezi_run_json() { } create_tezi_bootfs () { - create_bootfs "${TEZI_KERNEL_IMAGETYPE}" "${TEZI_KERNEL_DEVICETREE}" + create_bootfs "${TEZI_KERNEL_IMAGETYPE}" "${TEZI_KERNEL_DEVICETREE}" "${MACHINE_BOOT_FILES}" } do_image_teziimg[prefuncs] += "create_tezi_bootfs rootfs_tezi_run_json" @@ -364,7 +372,7 @@ python rootfs_tezi_run_distro_json() { } create_tezi_distro_bootfs () { - create_bootfs "${TEZI_KERNEL_IMAGETYPE}" "${TEZI_KERNEL_DEVICETREE}" "boot.scr" + create_bootfs "${TEZI_KERNEL_IMAGETYPE}" "${TEZI_KERNEL_DEVICETREE}" "boot.scr" ${MACHINE_BOOT_FILES} } do_image_teziimg_distro[prefuncs] += "create_tezi_distro_bootfs rootfs_tezi_run_distro_json" |