diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index dfd3306..809bd4d 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass @@ -20,7 +20,8 @@ python __anonymous () { # U-boot dtb. We ensure the U-Boot dtb is deployed before assembling # the fitImage: if d.getVar('UBOOT_SIGN_ENABLE', True): - d.appendVarFlag('do_assemble_fitimage', 'depends', ' u-boot:do_deploy') + uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot' + d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn) } # Options for the device tree compiler passed to mkimage '-D' feature: diff --git a/meta/classes/uboot-sign.bbclass b/meta/classes/uboot-sign.bbclass index adb24d4..f3d0c73 100644 --- a/meta/classes/uboot-sign.bbclass +++ b/meta/classes/uboot-sign.bbclass @@ -16,10 +16,14 @@ # # The signature support is limited to the use of CONFIG_OF_SEPARATE in U-Boot. # -# The tasks sequence is as below, using DEPLOY_IMAGE_DIR as common place to +# The tasks sequence is set as below, using DEPLOY_IMAGE_DIR as common place to # treat the device tree blob: # -# u-boot:do_deploy -> virtual/kernel:do_assemble_fitimage -> u-boot:do_install +# u-boot:do_deploy_dtb +# u-boot:do_deploy +# virtual/kernel:do_assemble_fitimage +# u-boot:do_concat_dtb +# u-boot:do_install # # For more details on signature process, please refer to U-boot documentation. @@ -38,8 +42,10 @@ UBOOT_NODTB_SYMLINK ?= "u-boot-nodtb-${MACHINE}.${UBOOT_SUFFIX}" # Following is relevant only for u-boot recipes: # -do_deploy_append_pn-u-boot () { - # OF_SEPARATE generated files deployment +do_deploy_dtb () { + mkdir -p ${DEPLOYDIR} + cd ${DEPLOYDIR} + if [ -f ${B}/${UBOOT_DTB_BINARY} ]; then install ${B}/${UBOOT_DTB_BINARY} ${DEPLOYDIR}/${UBOOT_DTB_IMAGE} rm -f ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SYMLINK} @@ -54,7 +60,7 @@ do_deploy_append_pn-u-boot () { fi } -do_install_prepend_pn-u-boot () { +do_concat_dtb () { # Concatenate U-Boot w/o DTB & DTB with public key # (cf. kernel-fitimage.bbclass for more details) cd ${DEPLOYDIR} @@ -69,7 +75,16 @@ do_install_prepend_pn-u-boot () { } python () { - if d.getVar('UBOOT_SIGN_ENABLE', True) == '1' and d.getVar('PN', True) == 'u-boot': + uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot' + if d.getVar('UBOOT_SIGN_ENABLE', True) == '1' and d.getVar('PN', True) == uboot_pn: kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel', True) - d.appendVarFlag('do_install', 'depends', ' %s:do_assemble_fitimage' % kernel_pn) + + # u-boot.dtb and u-boot-nodtb.bin are deployed _before_ do_deploy + # Thus, do_deploy_setscene will also populate them in DEPLOY_IMAGE_DIR + bb.build.addtask('do_deploy_dtb', 'do_deploy', 'do_compile', d) + + # do_concat_dtb is scheduled _before_ do_install as it overwrite the + # u-boot.bin in both DEPLOYDIR and DEPLOY_IMAGE_DIR. + bb.build.addtask('do_concat_dtb', 'do_install', None, d) + d.appendVarFlag('do_concat_dtb', 'depends', ' %s:do_assemble_fitimage' % kernel_pn) }