我刚刚开始 Yocto 的陡峭学习曲线。我正在按照这个示例 Hacking RaspberryPi 4 With Yocto 为树莓派 4 构建一个 Linux 发行版。该示例来自旧版本的 Yocto,所以我必须在这里和那里填补一些空白,但到目前为止它已经工作得很好。在第 7 部分中,我被指示创建一个 .bbappend 文件来复制覆盖文件夹,但该文件似乎没有运行。我尝试通过在附加文件中添加 bbwarn 标志来检查这一点,但尚未看到该标志打印或看到目录被复制。我在原始 .bb 文件中添加了一个类似的标志,但我确实看到了该标志打印。我还将附加文件中的 cp 语句直接添加到 .bb 文件中,并发现该语句是正确的,并且会复制覆盖导向器,因此问题似乎与附加文件有关。我使用了命令“bitbake-layers show-appends”,它报告了我的 .bbappend 文件,因此不确定我还需要检查什么。有人可以查看下面的这个文件并帮助我找出它不起作用的原因吗?谢谢。
默认.bb文件:
DESCRIPTION = "Closed source binary files to help boot all raspberry pi devices."
LICENSE = "Broadcom-RPi"
LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=c403841ff2837657b2ed8e5bb474ac8d"
inherit deploy nopackages
include recipes-bsp/common/raspberrypi-firmware.inc
INHIBIT_DEFAULT_DEPS = "1"
DEPENDS = "rpi-config rpi-cmdline"
COMPATIBLE_MACHINE = "^rpi$"
S = "${RPIFW_S}/boot"
PR = "r3"
do_deploy() {
install -d ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
for i in ${S}/*.elf ; do
cp $i ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
done
for i in ${S}/*.dat ; do
cp $i ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
done
for i in ${S}/*.bin ; do
cp $i ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
done
# Add stamp in deploy directory
touch ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/${PN}-${PV}.stamp
# cp -r ${RPIFW_S}/boot/overlays ${DEPLOY_DIR_IMAGE}/bootfiles/overlays
# rm -r ${DEPLOY_DIR_IMAGE}/bootfiles/overlays
bbwarn "TESTORIG"
}
do_deploy[depends] += "rpi-config:do_deploy rpi-cmdline:do_deploy"
addtask deploy before do_build after do_install
do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"
PACKAGE_ARCH = "${MACHINE_ARCH}"
我的.bbappend:
DESCRIPTION = "Recipe to copy overlays directory into bootfiles"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
do_after_deploy() {
# cp -r ${RPIFW_S}/boot/overlays ${DEPLOY_DIR_IMAGE}/bootfiles/overlays
touch ${DEPLOY_DIR_IMAGE}/bootfiles/config.txt
echo 'kernel=kernel_rpilinux.img' >> ${DEPLOY_DIR_IMAGE}/bootfiles/config.txt
echo 'arm_64bit=1' >> ${DEPLOY_DIR_IMAGE}/bootfiles/config.txt
echo 'enable_uart=1' >> ${DEPLOY_DIR_IMAGE}/bootfiles/config.txt
touch ${DEPLOY_DIR_IMAGE}/bootfiles/cmdline.txt
echo 'dwc_otg.lpm_enable=0 console=serial0,115200 console=ttyS0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait' >> ${DEPLOY_DIR_IMAGE}/bootfiles/cmdline.txt
bbwarn "TEST APPEND"
}
addtask after_deploy after do_deploy before do_build
谢谢@skandigraun。使用上面的
.task_order
文件帮助我弄清楚了。我将 .bbappend
更改为 addtask after_deploy after do_deploy before do_populate_lic
并让它工作!