从 rocko 更新到 thud 后,.dtb 文件丢失

.dtb files missing after update from rocko to thud

我将一个功能完备的电路板固件从 rocko 更新为 thud。我刚刚更新了 poky 和所有官方回购协议。内核和引导加载程序仍处于同一版本。 启动时,引导加载程序(小内核)将停止并打印找不到 dtb 文件的错误消息。

DTB offset is incorrect, kernel image does not have appended DTB

我觉得是内核自己编译的问题。由于某些原因,dtb 文件不会附加到内核。 当我检查构建内核的大小时,"thud" 版本有点小。

我找到了这个有用的工具:https://github.com/PabloCastellano/extract-dtb

如果我检查 rocko 内核映像,该工具发现 12 个 dtb。但是,如果我检查 thud 内核映像,该工具会发现 0.

For some reasons the dtb files will not append to the kernel.
...
But if I check the thud kernel image the tool found 0.

显然缺少将 dtb 文件附加到 zImage 文件的构建脚本。
根据 Device Tree for Dummies,第 8 页:

There is no built-in Makefile rule to produce such kernel, so one must manually do:

$ cat arch/arm/boot/zImage arch/arm/boot/dts/myboard.dtb > my-zImage  
$ mkimage ... -d my-zImage my-uImageI

如果我用 do_compile_append 手动添加超过 1 个 dtb。

 cat arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup arch/${ARCH}/boot/dts/MYDEVICETREEFILE.dtb > arch/${ARCH}/boot/${KERNEL_IMAGETYPE}

我用提取工具发现只有 1 个附加的 dtb。

并且系统无法正常工作。

如果我只添加 1 个 dtb,例如:

KERNEL_DEVICETREE := "MYDEVICETREEFILE.dtb"

这个dtb 将被添加并且系统工作没有问题。

我发现了我的问题:

我使用小内核作为引导加载程序。他想要特定格式的内核。为此,我使用 mkbootimg。在我的 bb 食谱中,该工具将执行。 但对于某些参数将无法到达 mkbootimg 工具。
因为这个内核不是这个小内核的特定格式,他找不到 dtb 文件。