【工程师分享】使用命令“petalinux-devtool modify”获取BSP相关的代码

作者: HankFu,文章来源:博客园

作者: 付汉杰 hankf@xilinx.com hankf@amd.com
测试环境: Vivado/PetaLinux 2021.2, Linux 5.10.0 VCK190

在PetaLinux 2020.1时分享了在PetaLinux里为模块创建补丁

现在使用PetaLinux 2021.2, 发现类似命令会报告错误。

hankf@XSZGS4:dapd-modify-peta$ petalinux-build -c kernel -x modify
[INFO] Sourcing buildtools
[INFO] Building kernel
[INFO] Sourcing build environment
[INFO] Generating workspace directory
INFO: bitbake virtual/kernel -c modify
NOTE: Started PRServer with DBfile: /proj/hankf/hankf/vck190/v212/dapd_prj_0211_maolin/dapd-modify-peta/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 38215, PID: 16832
Loading cache: 100% | | ETA: --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################| Time: 0:00:15
Parsing of 3476 .bb files complete (0 cached, 3476 parsed). 5133 targets, 242 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Task do_modify does not exist for target virtual/kernel (/proj/hankf/hankf/vck190/v212/dapd_prj_0211_maolin/dapd-modify-peta/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.2.bb:do_modify)
ERROR: Command execution failed: 1
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build kernel. Check the /proj/hankf/hankf/vck190/v212/dapd_prj_0211_maolin/dapd-modify-peta/build/build.log file for more details...

hankf@XSZGS4:dapd-modify-peta$ petalinux-build -c u-boot -x modify
[INFO] Sourcing buildtools
[INFO] Building u-boot
[INFO] Sourcing build environment
[INFO] Generating workspace directory
INFO: bitbake virtual/bootloader -c modify
NOTE: Started PRServer with DBfile: /proj/hankf/hankf/vck190/v212/dapd_prj_0211_maolin/dapd-modify-peta/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 38409, PID: 17895
Loading cache: 100% |#########################################################################################################################################################| Time: 0:00:01
Loaded 5122 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################| Time: 0:00:01
Parsing of 3476 .bb files complete (3465 cached, 11 parsed). 5133 targets, 242 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Task do_modify does not exist for target virtual/bootloader (/proj/hankf/hankf/vck190/v212/dapd_prj_0211_maolin/dapd-modify-peta/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx_2021.2.bb:do_modify)
ERROR: Command execution failed: 1
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build u-boot. Check the /proj/hankf/hankf/vck190/v212/dapd_prj_0211_maolin/dapd-modify-peta/build/build.log file for more details...

查询手册,得到命令“petalinux-devtool modify”,可以完成同样的工作。 对于VCK190单板,使用下列脚本,可以得到所有BSP相关的代码。之后可以修改代码。修改完成后,再使用命令“ petalinux-devtool finish ”可以创建补丁。

#
# Get the source code from git url specifi ed in meta-layers:
# petalinux-devtool modify
#
# Creates a patch for the committed changes in recipe sources directory.
# petalinux-devtool finish

# $./yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.2.bb
echo -e "\nTry to modify linux-xlnx"
petalinux-devtool modify linux-xlnx

# ./yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx_2021.2.bb
echo -e "\nTry to modify u-boot-xlnx"
petalinux-devtool modify u-boot-xlnx

echo -e "\nTry to modify plm-firmware"
petalinux-devtool modify plm-firmware

echo -e "\nTry to modify psmfw"
petalinux-devtool modify psmfw

echo -e "\nTry to modify arm-trusted-firmware"
petalinux-devtool modify arm-trusted-firmware

echo -e "\nShow components that can be modified"
ls -l components/yocto/workspace/sources/

如果是MPSoC, 可以得到 arm-trusted-firmware、fsbl-firmware、pmu-firmware、u-boot-xlnx、linux-xlnx等代码。

最新文章

最新文章