u-boot: updates for WORKDIR/UNPACKDIR cleanup

Builds no longer work if artifacts are placed in WORKDIR.

oe-core: b84eec5c4cbf ("base: Switch UNPACKDIR to a subdir of WORKDIR")
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
This commit is contained in:
Trevor Woerner 2024-05-25 20:57:04 -04:00
parent bf9ade59ab
commit 8df8a4017a

View File

@ -58,7 +58,7 @@ rk_generate_env() {
UBOOT_ENV_SIZE="$(cat ${B}/.config | grep "^CONFIG_ENV_SIZE=" | cut -d'=' -f2)"
# linux user-space U-Boot env config file
echo "/dev/disk/by-partlabel/uboot_env 0x0000 ${UBOOT_ENV_SIZE}" > ${WORKDIR}/fw_env.config
echo "/dev/disk/by-partlabel/uboot_env 0x0000 ${UBOOT_ENV_SIZE}" > ${UNPACKDIR}/fw_env.config
# convert text-based environment to binary suitable for image
if [ "${@bb.utils.to_boolean(d.getVar('RK_IMAGE_INCLUDES_UBOOT_ENV'), False)}" = "True" ]; then
@ -66,14 +66,14 @@ rk_generate_env() {
echo "initial, text-formatted U-Boot environment file \"${B}/u-boot-initial-env\" not found"
return 1
fi
mkenvimage -s ${UBOOT_ENV_SIZE} ${B}/u-boot-initial-env -o ${WORKDIR}/u-boot.env
mkenvimage -s ${UBOOT_ENV_SIZE} ${B}/u-boot-initial-env -o ${B}/u-boot.env
fi
}
do_compile[postfuncs] += "${@'rk_generate_env' if 'rk-u-boot-env' in d.getVar('MACHINEOVERRIDES').split(':') else 'rk_no_env'}"
do_deploy:append:rk-u-boot-env() {
if [ -f ${WORKDIR}/u-boot.env -a "${@bb.utils.to_boolean(d.getVar('RK_IMAGE_INCLUDES_UBOOT_ENV'),False)}" = "True" ]; then
if [ -f ${B}/u-boot.env -a "${@bb.utils.to_boolean(d.getVar('RK_IMAGE_INCLUDES_UBOOT_ENV'),False)}" = "True" ]; then
install -d ${DEPLOYDIR}
install -m 0644 ${WORKDIR}/u-boot.env ${DEPLOYDIR}
install -m 0644 ${B}/u-boot.env ${DEPLOYDIR}
fi
}