NXP MCU 技术论坛
直播中

李丹

7年用户 1413经验值
私信 关注
[问答]

如何在yocto环境中修改u-boot-imx [imx6ullevk]?

按照 i.MX Yocto 项目用户指南 [IMXLXYOCTOUG] 的步骤 3 到 5,
我能够构建 u-boot-imx 。
现在我正在尝试在 u-boot-imx 之上创建一个示例补丁。
以下是我创建补丁所采取的步骤。
1. 创建本地仓库

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. 编辑并保存u-boot源文件(common/board_f.c)
     并创建差异文件。

$ git diff > my_mx6ul_changes.diff
     my_mx6ul_changes.diff 显示

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. 在 recipe 目录下创建名为files的目录,并将 my_mx6ul_changes.diff 复制到files目录。

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. 编辑 u-boot-imx_%.bbappend

FILESEXTRAPATHS:prepend := \"${THISDIR}/${PN}:\"
SRC_URI:append = \"file://my_mx6ul_changes.diff\"
  配方 u-boot 如下所示

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
现在我回到构建目录(fsl_image_machine_test,这里)并运行“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
最后我收到以下错误,提示获取失败。

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\'

更多回帖

发帖
×
20
完善资料,
赚取积分