Hello,
I'm trying to have the yocto build system copy the fw_env.config and u-boot-initial-env files to the SD card image. I can build the entire uboot and rootfs and create the SD card. I can copy the 2 files manually to the /etc directory after the system is running. They work correctly, so I know the files are good. However, I need the files in the SD card image so they're used the first time the system boots.
I'm using an 8MPLUS EVK. The two files are being created as part of the u-boot-imx build. I've tried many web searches but can't find update the build to put them in the SD card image. I have found many places that show how to copy the files manually, but nothing that updates the yocto build itself. (Searches often use the filenames as separate words. For example, "fw_env.config" finds "fw", "env", and "config")
Thanks,
Scott
Hello,
Yes, I've looked at u-boot-boundary_2022.04.bb, u-boot-kontron_2020.01.bb, and u-boot-toradex_2020.07.bb.
All 3 recipes mention fw_env.config. The last one also mentions u-boot-initial-env.
After "bitbake u-boot-imx" both files are created / updated in build/tmp/deploy/images/evk-example
However, after "bitbake evk-example", neither file is included in the tar file or the wic disk image.
I'm need a way to copy the u-boot-initial-env file created by u-boot-imx and include it in the disk image.
Thanks,
Scott
Do you have Yocto source code?
fw_env.config
https://github.com/nxp-imx-support/meta-swupdate-imx/blob/mickledore_6.1.36_2.1.0/recipes-bsp/u-boot/u-boot-imx_%25.bbappend
do_install:append:mx8qxp-nxp-bsp () {
echo "/dev/mmcblk1 0x700000 0x2000" > ${D}/${sysconfdir}/fw_env.config
echo "/dev/mmcblk1 0x702000 0x2000" >> ${D}/${sysconfdir}/fw_env.config
echo "${MACHINE} ${SWU_HW_REV}" > ${D}/${sysconfdir}/hwrevision
install -D -m 644 ${D}/${sysconfdir}/fw_env.config ${DEPLOYDIR}
install -D -m 644 ${D}/${sysconfdir}/hwrevision ${DEPLOYDIR}
}
Yocto already has code to copy u-boot-initial-env to sysconfig dir, should be /etc
u-boot-initial-env
https://github.com/yoctoproject/poky/blob/mickledore-4.2/meta/recipes-bsp/u-boot/u-boot.inc
install -D -m 644 ${B}/${config}/${UBOOT_BINARYNAME}-${type}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
ln -sf ${UBOOT_BINARYNAME}-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
# Install the uboot-initial-env
if [ -n "${UBOOT_INITIAL_ENV}" ]; then
install -D -m 644 ${B}/${config}/u-boot-initial-env-${type} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR}
ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${type}
ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${type}
ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${type}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
fi
fi
done
unset j
done
unset i
else
install -D -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
# Install the uboot-initial-env
if [ -n "${UBOOT_INITIAL_ENV}" ]; then
install -D -m 644 ${B}/u-boot-initial-env ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR}
ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}-${MACHINE}
ln -sf ${UBOOT_INITIAL_ENV}-${MACHINE}-${PV}-${PR} ${D}/${sysconfdir}/${UBOOT_INITIAL_ENV}
fi
fi
Seems not a way yocto do install for rootfs after checking its recipes and configuration files.
Have you tried to run post processing commands ROOTFS_POSTPROCESS_COMMAND += "<shell_command>; ... " or do_install task?
Best regards
Harvey