Dear NXP experts,
Following the steps 3 through 5 of i.MX Yocto Project User's Guide [IMXLXYOCTOUG],
I was able to build u-boot-imx .
Now I am trying to create a sample patch on top of u-boot-imx.
The followings are the steps that I took to create a patch.
1. create local_repos
ysp@ud2204:~/work/imx-yocto-bsp$ mkdir -p local_repos/uboot-imx
ysp@ud2204:~/work/imx-yocto-bsp$ cp -a fsl-image-machine-test/tmp/work/imx6ullevk-poky-linux-gnueabi/u-boot-imx/2022.04-r0/git/. local_repos/uboot-imx/
ysp@ud2204:~/work/imx-yocto-bsp$ cd local_repos/uboot-imx/
ysp@ud2204:~/work/imx-yocto-bsp/local_repos/uboot-imx$ git reset --hard
Updating files: 100% (19141/19141), done.
HEAD is now at 7376547b9e Merge remote-tracking branch 'origin/imx_v2022.04' into lf_v2022.04
ysp@ud2204:~/work/imx-yocto-bsp/local_repos/uboot-imx$ git clean -fdx
Removing .scmversion
2. edit and save u-boot source file(common/board_f.c)
and create diff file.
$ git diff > my_mx6ul_changes.diff
my_mx6ul_changes.diff shows
diff --git a/common/board_f.c b/common/board_f.c
index 1a08b4676f..8d25089c1b 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -209,7 +209,7 @@ static int print_cpuinfo(void)
static int announce_dram_init(void)
{
- puts("DRAM: ");
+ puts("PYS_DRAM: ");
return 0;
}
3. create directory named files in recipe directory and copy my_mx6ul_changes.diff to files directory.
ysp@ud2204:~/work/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/u-boot$ mkdir files
ysp@ud2204:~/work/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/u-boot$ cp ~/work/imx-yocto-bsp/local_repos/uboot-imx/my_mx6ul_changes.diff files
4. Edit u-boot-imx_%.bbappend
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = "file://my_mx6ul_changes.diff"
recipe u-boot looks like following
ysp@ud2204:~/work/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp$ tree u-boot/
u-boot/
├── files
│ └── my_mx6ul_changes.diff
├── u-boot-imx_2022.04.bb
├── u-boot-imx_%.bbappend
├── u-boot-imx-mfgtool_2022.04.bb
└── u-boot-imx-tools_2022.04.bb
Now I returned to build directory (fsl_image_machine_test, here) and ran "bitbake u-boot-imx"
ysp@ud2204:~/work/imx-yocto-bsp/fsl-image-machine-test$ bitbake u-boot-imx
Loading cache: 100% |#########################################################################################################################################################################| Time: 0:00:05
Loaded 4976 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################################| Time: 0:00:03
Parsing of 3355 .bb files complete (3352 cached, 3 parsed). 4977 targets, 719 skipped, 3 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Finally I got the following error which says fetch failed.
NOTE: Executing Tasks
WARNING: u-boot-imx-2022.04-r0 do_fetch: Failed to fetch URL git://github.com/nxp-imx/uboot-imx.git;protocol=https;branch=lf_v2022.04file://my_mx6ul_changes.diff, attempting MIRRORS if available
ERROR: u-boot-imx-2022.04-r0 do_fetch: Fetcher failure: Unable to find revision 7376547b9e424b2d0f42dfe96394168c781ca297 in branch lf_v2022.04file://my_mx6ul_changes.diff even from upstream
ERROR: u-boot-imx-2022.04-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'git://github.com/nxp-imx/uboot-imx.git;protocol=https;branch=lf_v2022.04file://my_mx6ul_changes.diff')
ERROR: Logfile of failure stored in: /home/ysp/work/imx-yocto-bsp/fsl-image-machine-test/tmp/work/imx6ullevk-poky-linux-gnueabi/u-boot-imx/2022.04-r0/temp/log.do_fetch.2715974
ERROR: Task (/home/ysp/work/imx-yocto-bsp/sources/meta-imx/meta-bsp/recipes-bsp/u-boot/u-boot-imx_2022.04.bb:do_fetch) failed with exit code '1'
I am a newer in yocto.
Please be kind enough to tell me what is wrong and how to fix it
and get my patch applied to u-boot-imx.
Many thanks in advance
Have a nice day.....
已解决! 转到解答。
Hi @dooggy,
I hope you are doing well.
In your case, the patch file is located under the files directory but FILESEXTRAPATHS: prepend contains the package name.
Please make the below change in u-boot-imx_%.bbappend
- FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+ FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
- SRC_URI:append = "file://my_mx6ul_changes.diff"
+ SRC_URI += "file://my_mx6ul_changes.diff "
Thanks & Regards,
Dhruvit Vasavada
Hi @dooggy,
I hope you are doing well.
In your case, the patch file is located under the files directory but FILESEXTRAPATHS: prepend contains the package name.
Please make the below change in u-boot-imx_%.bbappend
- FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+ FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
- SRC_URI:append = "file://my_mx6ul_changes.diff"
+ SRC_URI += "file://my_mx6ul_changes.diff "
Thanks & Regards,
Dhruvit Vasavada
Thank you for your help...
I did make standalone build and got my modified u-boot .
What I want to do is put my working directory in the yocto environment.
Now I got a yocto solution due to the help of NXP expert.
Many thanks,
Have a nice day