kernel-fitimage.bbclass: introduce OVERLAY_FDT_DEFAULT_BOOT
PATCH 1/1 kernel-fitimage.bbclass: introduce OVERLAY_FDT_DEFAULT_BOOT
From: Ming Liu <[email protected]>
The FDT overlays can be applied to a base DT configuration by setting this variable.
The FDT overlays set in this variable must be available in KERNEL_DEVICETREE.
Signed-off-by Ming Liu <[email protected]>
--- meta/classes/kernel-fitimage.bbclass | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
meta/classes/kernel-fitimage.bbclass +18 -0
@@ -36,11 +36,23 @@ python __anonymous () { if d.getVar('UBOOT_SIGN_ENABLE') == "1": uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot' d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % uboot_pn) + + # Verified any FDT listed in OVERLAY_FDT_DEFAULT_BOOT must be availabe + # in KERNEL_DEVICETREE. + kernel_devicetree = set((d.getVar('KERNEL_DEVICETREE') or '').split()) + fdt_default_boot = set((d.getVar('OVERLAY_FDT_DEFAULT_BOOT') or '').split()) + if fdt_default_boot: + missing = set.difference(fdt_default_boot, kernel_devicetree) + if missing: + bb.fatal("Any FDT set in OVERLAY_FDT_DEFAULT_BOOT must be available in KERNEL_DEVICETREE.") } # Options for the device tree compiler passed to mkimage '-D' feature: UBOOT_MKIMAGE_DTCOPTS ??= "" +# FDT Overlay to be set in the default boot configuration +OVERLAY_FDT_DEFAULT_BOOT ??= "" + # # Emit the fitImage ITS header #
@@ -291,6 +303,12 @@ fitimage_emit_section_config() { if [ "${6}" = "1" ]; then default_line="default = \"conf@${3}\";" + + for dtbo in ${OVERLAY_FDT_DEFAULT_BOOT}; do + dbto=$(echo "${dtbo}" | tr '/' '_') + dtbos="$dtbos, \"fdt@$dbto\"" + done + fdt_line=$(echo $fdt_line | sed "s/;/$dtbos;/") fi cat << EOF >> ${1}
Signature · 1 line
2.7.4