Комбинация пользовательского пространства и дерева устройств в yocto build
Я пытаюсь создать рецепт, состоящий из пользовательского приложения, зависящего от определенного периферийного интерфейса spi
Я создал рецепт того же самого, но только приложение становится частью созданного образа.
Как я могу и что изменить, чтобы включить дерево устройств?
MKI-33Axx.dts - это дерево устройств моей платформы, и мои модификации находятся в этом файле только для spi, и я хочу, чтобы этот файл был выбран, а не исходным.
Я прочитал, что для KERNEL_DEVICETREE_append необходимо предоставить измененный файл «dtb», а не файл dts. Нужно ли мне компилировать дерево устройств отдельно, а затем добавлять его в образ после создания образа? Но я все еще не понимаю этого. Подскажите, пожалуйста, как и где это активировать? так что я могу добавить это изменение дерева устройств в свой рецепт.
1 ответ
KERNEL_DEVICETREE variable is used to specify the device tree files that need to be generated and added to the boot partition, but the bootloader will only charge one of them in the RAM while booting.
Example, for U-boot, the file specified in DEFAULT_FDT_FILE in the board's defconfig file will be used. But you can change the DTB by pausing U-boot and specifying the DTB file with:
setenv fdt_file new_file.dtb (make sure of "fdt_file" var with "printenv")
You can use recipetool to automatically add your new device tree file to your linux recipe, check my answer here.
You don't have to compile the DTS separatly, because adding it to KERNEL_DEVICETREE variable will cause it to be shipped in the boot partition.
Any modifications on the Linux kernel can be added into :
meta-custom/recipes-kernel/linux/linux-(PROVIDER)_%.append
the (PROVIDER) could be found in the machine configuration file, and it is a provider for virtual/kernel recipe.
You create patches for your Linux, go to:
tmp/work/.../linux-(PROVIDER)/../git
do your edits and:
git add modified_file
git commit -m "updates"
git format-patch -1
This will generate a "updates.patch" file, that you can add it to linux-(PROVIDER)_%.append file:
SRC_URI += "file://updates.patch"
Make sure you copy the patch file to:
meta-custom/recipes-kernel/linux/files
Now, the Linux build will triggered and apply the patch.