How to patch the configuration of U-Boot in Yocto

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to patch the configuration of U-Boot in Yocto

跳至解决方案
1,786 次查看
Tom2023
Contributor II

It is quite easy to patch the source code of U-Boot with the help of devtool.

But how can I patch the configuration of U-Boot?

Is it possible with devtool?

If not, how can it be done?

0 项奖励
1 解答
1,772 次查看
Hamza
Contributor II

Hi @Tom2023 ,

you should be able to modify the configuration of uboot using the devtool by modifying the your specific board defconfig file under the configs folder.

exemple:

your board config file is uboot/configs/imx8qxp_mek_defconfig

you add what ever config to the this file and use devtool to create the patches like any other yocto patch

 

在原帖中查看解决方案

4 回复数
1,736 次查看
Tom2023
Contributor II

Hi Hamza and brian14! Thank you so much. I could follow your description and successfully patch the U-Boot configuration as you described. For someone struggeling with the same problem, I I wanna describe two pitfalls I encountered:
First, I think I patched the wrong configuration (imx8qm_mek_defconfig). The command
bitbake -e u-boot-imx | grep UBOOT_MACHINE=
however pointed me to the correct U-Boot configuration to patch.
Second, I created and added a new layer with bitbake-layers create-layer and bitbake-layers add-layer. However, calling
./devtool update-recipe -a <layerpath> u-boot-imx
did not apply my patches. The problem was the wrong priority of my new layer.

Anyway, now it's working. But I still have a few things which I would like to find out. In case anyone knows the answers, I would greatly appreciate any help here

What I still don't understand is how exactly .config is being built. How can I find out which functions in yocto are called or are responsible for creating .config?

Moreover, how is the recommended workflow if I wanna patch my own patch? I saw devtool starts over when giving numbers to the patch files. But still patching my patch seems to work.

How do this patch files work? Are these patches sort of smart, I mean what happens if the file that is to be patched is slightly different compared to when the patch was created - do I get an error from Yocto then or what happens?

What is the right way to add these patches in a CI/CD process? Is it just adding the layer with "bitbake-layers add-layer" and then copying the layer directory with the patches before the yocto build starts?

0 项奖励
1,723 次查看
brian14
NXP TechSupport
NXP TechSupport

Hi @Tom2023

Thank for share the proper solution to the problem.

On the other hand, your new questions are related with The Yocto Project tool processes and usage. I think you could try to review The Yocto Project official documentation.

Here are some links that could be useful for your queries:

6 Tasks — The Yocto Project ® 4.3.999 documentation

4 Yocto Project Concepts — The Yocto Project ® 4.3.999 documentation

5 Writing a New Recipe — The Yocto Project ® 4.3.999 documentation

2 Using the Extensible SDK — The Yocto Project ® 4.3.999 documentation

I hope this information will be helpful.

Have a great day!

1,750 次查看
brian14
NXP TechSupport
NXP TechSupport

Hi @Tom2023

Thank you for your reply @Hamza

Adding information to the reply from Hamza you can use devtool to create the patch as mentioned on the following reference:

"In fact, you could use devtool to create patches and append files as well.

In short, devtool uses local source code to build from instead of
fetching from mirror every time.
To use it:

1. Following command will extract and patch git repo in specified path:

devtool modify -x u-boot ~/projects/poky/build/u-boot-devtool

2. Make some changes in source code.

3. Rebuild given recipe:

devtool build u-boot

4. You can add some commits inside `u-boot-devtool` directory and update recipe with:

devtool update-recipe u-boot

It will create patch from each commit and automatically add them to appropriate
directory and recipe file. For example:

NOTE: Adding new patch 0001-test.patch
NOTE: Updating recipe u-boot_2016.03.bb

5. When work with temporary source directory is done, run:

devtool reset u-boot"

[yocto] Antwort: How to make changes and build u-boot source code in yocto (yoctoproject.org)

I hope this information will be helpful.

Have a great day!

1,773 次查看
Hamza
Contributor II

Hi @Tom2023 ,

you should be able to modify the configuration of uboot using the devtool by modifying the your specific board defconfig file under the configs folder.

exemple:

your board config file is uboot/configs/imx8qxp_mek_defconfig

you add what ever config to the this file and use devtool to create the patches like any other yocto patch