summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2019-05-22 19:02:51 +0200
committerMing Liu <ming.liu@toradex.com>2019-08-11 17:27:33 +0800
commit8a3847fbbf9cfad90919a99878b3df2e11389f24 (patch)
treedaefb5c218b93282245d3b6ead4b29671480b08c
parentd2dc36988fc0d2304c655a4f2866473351350eeb (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>
-rw-r--r--classes/image_type_tezi.bbclass14
1 files changed, 11 insertions, 3 deletions
diff --git a/classes/image_type_tezi.bbclass b/classes/image_type_tezi.bbclass
index e612bc5..f3d5bfa 100644
--- a/classes/image_type_tezi.bbclass
+++ b/classes/image_type_tezi.bbclass
@@ -53,6 +53,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')
@@ -81,7 +89,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",
@@ -274,7 +282,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"
@@ -350,7 +358,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"