u-boot-dey: rework installation of firmware deploying scripts

Rework the "build_uboot_scripts" to prevent changing the templates in
the WORKDIR, as those are part of the SRC_URI. Instead, change the
deployed scripts by using "sed" and redirection.

Also, removed UBOOT_HAS_FASTBOOT altogether, as there is no platform
that does not support fastboot.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2022-12-21 15:48:06 +01:00
parent 9d40092ce5
commit eeb5ffd4d4
8 changed files with 23 additions and 27 deletions

View File

@ -29,7 +29,6 @@ UBOOT_CONFIG[ccmp13-dvk] = "ccmp13-dvk_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}"
UBOOT_DTB_NAME = "ccmp13-dvk.dtb" UBOOT_DTB_NAME = "ccmp13-dvk.dtb"
UBOOT_PREFIX = "u-boot" UBOOT_PREFIX = "u-boot"
UBOOT_SUFFIX = "bin" UBOOT_SUFFIX = "bin"
UBOOT_HAS_FASTBOOT = "true"
# Set U-Boot FIP settings # Set U-Boot FIP settings
FIP_UBOOT_DTB = "u-boot" FIP_UBOOT_DTB = "u-boot"

View File

@ -29,7 +29,6 @@ UBOOT_CONFIG[ccmp15-dvk] = "ccmp15-dvk_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}"
UBOOT_DTB_NAME = "ccmp15-dvk.dtb" UBOOT_DTB_NAME = "ccmp15-dvk.dtb"
UBOOT_PREFIX = "u-boot" UBOOT_PREFIX = "u-boot"
UBOOT_SUFFIX = "bin" UBOOT_SUFFIX = "bin"
UBOOT_HAS_FASTBOOT = "true"
# Set U-Boot FIP settings # Set U-Boot FIP settings
FIP_UBOOT_DTB = "u-boot" FIP_UBOOT_DTB = "u-boot"

View File

@ -11,7 +11,6 @@ include conf/machine/include/arm/armv7a/tune-cortexa9.inc
# Platform u-boot settings # Platform u-boot settings
UBOOT_PREFIX = "u-boot" UBOOT_PREFIX = "u-boot"
UBOOT_SUFFIX = "imx" UBOOT_SUFFIX = "imx"
UBOOT_HAS_FASTBOOT = "true"
# Linux kernel configuration # Linux kernel configuration
KERNEL_DEFCONFIG ?= "arch/arm/configs/ccimx6sbc_defconfig" KERNEL_DEFCONFIG ?= "arch/arm/configs/ccimx6sbc_defconfig"

View File

@ -11,7 +11,6 @@ include conf/machine/include/arm/armv7a/tune-cortexa7.inc
# Platform u-boot settings # Platform u-boot settings
UBOOT_PREFIX = "u-boot" UBOOT_PREFIX = "u-boot"
UBOOT_SUFFIX = "imx" UBOOT_SUFFIX = "imx"
UBOOT_HAS_FASTBOOT = "true"
STORAGE_MEDIA = "mtd" STORAGE_MEDIA = "mtd"

View File

@ -8,7 +8,6 @@ require conf/machine/include/arm/armv8a/tune-cortexa53.inc
# Platform u-boot settings # Platform u-boot settings
UBOOT_PREFIX = "imx-boot" UBOOT_PREFIX = "imx-boot"
UBOOT_SUFFIX = "bin" UBOOT_SUFFIX = "bin"
UBOOT_HAS_FASTBOOT = "true"
# The bootloader image that gets flashed consists of U-Boot and several fw binaries # The bootloader image that gets flashed consists of U-Boot and several fw binaries
EXTRA_IMAGEDEPENDS += "imx-boot" EXTRA_IMAGEDEPENDS += "imx-boot"

View File

@ -11,7 +11,6 @@ include conf/machine/include/arm/armv8a/tune-cortexa35.inc
# Platform u-boot settings # Platform u-boot settings
UBOOT_PREFIX = "imx-boot" UBOOT_PREFIX = "imx-boot"
UBOOT_SUFFIX = "bin" UBOOT_SUFFIX = "bin"
UBOOT_HAS_FASTBOOT = "true"
# The bootloader image that gets flashed consists of U-Boot and several fw binaries # The bootloader image that gets flashed consists of U-Boot and several fw binaries
EXTRA_IMAGEDEPENDS += "imx-boot" EXTRA_IMAGEDEPENDS += "imx-boot"

View File

@ -12,7 +12,6 @@ require conf/machine/include/arm/armv8-2a/tune-cortexa55.inc
# Platform u-boot settings # Platform u-boot settings
UBOOT_PREFIX = "u-boot" UBOOT_PREFIX = "u-boot"
UBOOT_SUFFIX = "bin" UBOOT_SUFFIX = "bin"
UBOOT_HAS_FASTBOOT = "true"
EXTRA_IMAGEDEPENDS += "imx-boot" EXTRA_IMAGEDEPENDS += "imx-boot"
BOOTLOADER_IMAGE_RECIPE = "imx-boot" BOOTLOADER_IMAGE_RECIPE = "imx-boot"

View File

@ -19,13 +19,17 @@ UBOOT_URI_STASH = "${DIGI_MTK_GIT}/uboot/u-boot-denx.git;protocol=ssh"
UBOOT_URI_GITHUB = "${DIGI_GITHUB_GIT}/u-boot.git;protocol=https" UBOOT_URI_GITHUB = "${DIGI_GITHUB_GIT}/u-boot.git;protocol=https"
UBOOT_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${UBOOT_URI_STASH}', '${UBOOT_URI_GITHUB}', d)}" UBOOT_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${UBOOT_URI_STASH}', '${UBOOT_URI_GITHUB}', d)}"
INSTALL_FW_UBOOT_SCRIPTS = " \
file://install_linux_fw_sd.txt \
file://install_linux_fw_usb.txt \
file://install_linux_fw_uuu.sh \
"
SRC_URI = " \ SRC_URI = " \
${UBOOT_GIT_URI};branch=${SRCBRANCH} \ ${UBOOT_GIT_URI};branch=${SRCBRANCH} \
file://altboot.txt \ file://altboot.txt \
file://boot.txt \ file://boot.txt \
file://install_linux_fw_sd.txt \ ${INSTALL_FW_UBOOT_SCRIPTS} \
file://install_linux_fw_usb.txt \
${@oe.utils.conditional('UBOOT_HAS_FASTBOOT', 'true', 'file://install_linux_fw_uuu.sh', '', d)} \
" "
BUILD_UBOOT_SCRIPTS ?= "true" BUILD_UBOOT_SCRIPTS ?= "true"
@ -56,27 +60,27 @@ def tf_bootscript_sedfilter(d):
return "s,\(^[[:blank:]]*\)true.*,\\1setenv boot_initrd true\\n\\1setenv initrd_file %s-${MACHINE}.cpio.gz.u-boot.tf,g" % tf_initramfs if tf_initramfs else "" return "s,\(^[[:blank:]]*\)true.*,\\1setenv boot_initrd true\\n\\1setenv initrd_file %s-${MACHINE}.cpio.gz.u-boot.tf,g" % tf_initramfs if tf_initramfs else ""
build_uboot_scripts() { build_uboot_scripts() {
# DEY firmware install scripts for f in $(echo ${INSTALL_FW_UBOOT_SCRIPTS} | sed -e 's,file\:\/\/,,g'); do
sed -i -e 's,##GRAPHICAL_BACKEND##,${GRAPHICAL_BACKEND},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt f_ext="${f##*.}"
sed -i -e 's,##MACHINE##,${MACHINE},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt TMP_INSTALL_SCR="$(mktemp ${WORKDIR}/${f}.XXXXXX)"
sed -i -e 's,##GRAPHICAL_IMAGES##,${GRAPHICAL_IMAGES},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt sed -e 's,##GRAPHICAL_BACKEND##,${GRAPHICAL_BACKEND},g' \
sed -i -e 's,##DEFAULT_IMAGE_NAME##,${DEFAULT_IMAGE_NAME},g' ${WORKDIR}/install_linux_fw_sd.txt ${WORKDIR}/install_linux_fw_usb.txt -e 's,##MACHINE##,${MACHINE},g' \
mkimage -T script -n "DEY firmware install script" -C none -d ${WORKDIR}/install_linux_fw_sd.txt ${DEPLOYDIR}/install_linux_fw_sd.scr -e 's,##GRAPHICAL_IMAGES##,${GRAPHICAL_IMAGES},g' \
mkimage -T script -n "DEY firmware install script" -C none -d ${WORKDIR}/install_linux_fw_usb.txt ${DEPLOYDIR}/install_linux_fw_usb.scr -e 's,##DEFAULT_IMAGE_NAME##,${DEFAULT_IMAGE_NAME},g' \
${WORKDIR}/${f} > ${TMP_INSTALL_SCR}
if [ "${@oe.utils.conditional('UBOOT_HAS_FASTBOOT', 'true', 'true', '', d)}" = "true" ]; then if [ "${f_ext}" = "txt" ]; then
# DEY firmware install uuu script mkimage -T script -n "DEY firmware install script" -C none -d ${TMP_INSTALL_SCR} ${DEPLOYDIR}/${f%.*}.scr
sed -i -e 's,##GRAPHICAL_BACKEND##,${GRAPHICAL_BACKEND},g' ${WORKDIR}/install_linux_fw_uuu.sh else
sed -i -e 's,##MACHINE##,${MACHINE},g' ${WORKDIR}/install_linux_fw_uuu.sh install -m 775 ${TMP_INSTALL_SCR} ${DEPLOYDIR}/${f}
sed -i -e 's,##GRAPHICAL_IMAGES##,${GRAPHICAL_IMAGES},g' ${WORKDIR}/install_linux_fw_uuu.sh fi
sed -i -e 's,##DEFAULT_IMAGE_NAME##,${DEFAULT_IMAGE_NAME},g' ${WORKDIR}/install_linux_fw_uuu.sh rm -f ${TMP_INSTALL_SCR}
install -m 775 ${WORKDIR}/install_linux_fw_uuu.sh ${DEPLOYDIR}/ done
fi
# Boot script for DEY images (reconfigure on-the-fly if TRUSTFENCE is enabled) # Boot script for DEY images (reconfigure on-the-fly if TRUSTFENCE is enabled)
TMP_BOOTSCR="$(mktemp ${WORKDIR}/bootscr.XXXXXX)" TMP_BOOTSCR="$(mktemp ${WORKDIR}/bootscr.XXXXXX)"
sed -e "${TF_BOOTSCRIPT_SEDFILTER}" ${WORKDIR}/boot.txt > ${TMP_BOOTSCR} sed -e "${TF_BOOTSCRIPT_SEDFILTER}" ${WORKDIR}/boot.txt > ${TMP_BOOTSCR}
mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr
rm -f ${TMP_BOOTSCR}
# Alternate boot script for dualboot # Alternate boot script for dualboot
mkimage -T script -n "Alternate bootscript" -C none -d ${WORKDIR}/altboot.txt ${DEPLOYDIR}/altboot.scr mkimage -T script -n "Alternate bootscript" -C none -d ${WORKDIR}/altboot.txt ${DEPLOYDIR}/altboot.scr
@ -97,7 +101,6 @@ build_uboot_scripts() {
trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}" trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}"
mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/altboot.scr" mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/altboot.scr"
fi fi
rm -f ${TMP_BOOTSCR}
} }
do_deploy:append() { do_deploy:append() {