I am trying to setup mender for xilinx zynq device. Officially XIlinx provides meta-xilinx and meta-xilinx-tools these layers are intend for creation HW specific artifacts. One of these - device tree blob. It means that xilinx meta layers are generating dts files in build time and these are not included in kernel source tree. Therefore I am not defining KERNEL_DEVICETREE in my machine config file.
Problem:
mender meta layer checks KERNEL_DEVICETREE variable and triggers the error:
ERROR: u-boot-xlnx-v2018.01-xilinx-v2018.3+gitAUTOINC+d8fc4b3b70-r0 do_provide_mender_defines: Did not find a dtb specified in KERNEL_DEVICETREE
What could be the solution in this case ? How to setup mender to use dts files which are not in kernel source tree ?
you it does not really matter what KERNEL_DEVICETREE is set to as it will not be used later. Meaning you can set it to
KERNEL_DEVICETREE = "whatever"
This will silence u-boot-mender-common.inc error, but could potentially trigger an error elsewhere.
But the proper solution is to provide a patch that implements
" To provide a MENDER_DTB_NAME which takes precedence of KERNEL_DEVICETREE if already defined."
Something like,
if [ -n "${MENDER_MENDER_DTB_NAME_FORCE}" ]; then
MENDER_DTB_NAME="${MENDER_MENDER_DTB_NAME_FORCE}"
else
MENDER_DTB_NAME=$(mender_get_clean_kernel_devicetree)
fi
In my case i dont use separate DTB, but it included into FIT image within kernel. But seems mender always require that DTB should be set.
I will try to patch the code for my needs…
But seems mender always require that DTB should be set.
Yes, and actually this should not be the case when MENDER_UBOOT_AUTO_CONFIGURE = "0" is used because in this case one could just write a dummy value to it to not bother users.
Feel free to create a PR if you figure out something.
Did you make further progress on this? I have managed to get u-boot and u-boot-fw-utils building however Yocto can not build the rootfs. I get the following error:
Error:
Problem: conflicting requests
nothing provides kernel-devicetree needed by packagegroup-core-boot=1.0-r17.plnx_zynq7
unset KERNEL_DEVICETREE to my recipes-kernel/linux/linux-xlnx_%.bbappend to stop the kernel trying to build my dtb file.
PROVIDES_${PN} = "kernel-devicetree" to my recipes-bsp/device-tree/device-tree.bbappend to tell Mender that the external device tree can come from the external device-tree recipe.
Adding device-tree to IMAGE_INSTALL
This would be much easier (and a bit more elegant) if Mender supported a way of adding a dtb file that isn’t generated from the kernel (the suggestion of MENDER_MENDER_DTB_NAME_FORCE seems good to me!).
Thanks for the reply Sam. Unfortunately those steps didn’t quite work for me. I admit I am pretty new at using Yocto though and may not have made the changes in the right location. Here are the files I modified (Note that I am using the Petalinux 2018.3 tools provided by Xilinx):
I have already made (I believe) the suggested patch from mirzak to MENDER_MENDER_DTB_NAME_FORCE.
What did work for me was patching meta-mender-core/classes/mender-setup-image.inc to remove the dependency on kernel-image and kernel-devicetree. I realize this isn’t a solution moving forward but I am trying to evaluate whether mender will work for my application or not.