imx-boot: install mkimage logs into imx-boot-tools directory

mkimage logs are required for signature on CC8X and CC8M platforms. Create a
copy in the 'imx-boot-tools' deploy directory so a prebuilt imx-boot file can
be later signed using the standalone signature procedure.

Build the 'print_fit_hab' target unconditionally so the log is available for
future standalone signature processes.

Also, use 'CONFIG_MKIMAGE_LOG_PATH' and 'CONFIG_FIT_HAB_LOG_PATH' variables to
point to the logs before calling the sign scripts. We no longer require
creating a symbolic link of the log files.

Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
This commit is contained in:
Gonzalo Ruiz 2021-11-19 17:38:44 +01:00
parent ed03674968
commit 446ecdd2e0
1 changed files with 16 additions and 11 deletions

View File

@ -99,7 +99,7 @@ do_compile () {
for target in ${IMXBOOT_TARGETS}; do for target in ${IMXBOOT_TARGETS}; do
for rev in ${SOC_REVISIONS}; do for rev in ${SOC_REVISIONS}; do
bbnote "building ${SOC_TARGET} - ${ramc} - REV=${rev} ${target}" bbnote "building ${SOC_TARGET} - ${ramc} - REV=${rev} ${target}"
make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} REV=${rev} ${target} > mkimage-${target}.log 2>&1 make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} REV=${rev} ${target} > ${S}/mkimage-${target}.log 2>&1
if [ -e "${BOOT_STAGING}/flash.bin" ]; then if [ -e "${BOOT_STAGING}/flash.bin" ]; then
cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target}
fi fi
@ -117,17 +117,15 @@ do_compile () {
# mkimage for i.MX8M # mkimage for i.MX8M
for target in ${IMXBOOT_TARGETS}; do for target in ${IMXBOOT_TARGETS}; do
bbnote "building ${SOC_TARGET} - ${REV_OPTION} ${target}" bbnote "building ${SOC_TARGET} - ${REV_OPTION} ${target}"
make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${REV_OPTION} ${target} > mkimage-${target}.log 2>&1 make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${REV_OPTION} ${target} > ${S}/mkimage-${target}.log 2>&1
if [ -e "${BOOT_STAGING}/flash.bin" ]; then if [ -e "${BOOT_STAGING}/flash.bin" ]; then
cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target}
fi fi
done done
if [ "${TRUSTFENCE_SIGN}" = "1" ]; then # Log HAB FIT information
# Log HAB FIT information bbnote "building ${SOC_TARGET} - print_fit_hab"
bbnote "building ${SOC_TARGET} - print_fit_hab" make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} print_fit_hab > ${S}/mkimage-print_fit_hab.log 2>&1
make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} print_fit_hab > mkimage-print_fit_hab.log 2>&1
fi
fi fi
done done
@ -181,7 +179,11 @@ do_deploy () {
echo "Set boot target as $IMAGE_IMXBOOT_TARGET" echo "Set boot target as $IMAGE_IMXBOOT_TARGET"
fi fi
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} ${DEPLOYDIR} install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} ${DEPLOYDIR}
# copy make log for reference
install -m 0644 ${S}/mkimage-${target}.log ${DEPLOYDIR}/${BOOT_TOOLS}
done done
# copy fit_hab log for reference
install -m 0644 ${S}/mkimage-print_fit_hab.log ${DEPLOYDIR}/${BOOT_TOOLS}
cd ${DEPLOYDIR} cd ${DEPLOYDIR}
ln -sf ${UBOOT_PREFIX}-${MACHINE}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}.bin ln -sf ${UBOOT_PREFIX}-${MACHINE}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}.bin
# Link to default bootable U-Boot filename. # Link to default bootable U-Boot filename.
@ -198,6 +200,8 @@ do_deploy () {
echo "Set boot target as $IMAGE_IMXBOOT_TARGET" echo "Set boot target as $IMAGE_IMXBOOT_TARGET"
fi fi
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} ${DEPLOYDIR} install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} ${DEPLOYDIR}
# copy make log for reference
install -m 0644 ${S}/mkimage-${target}.log ${DEPLOYDIR}/${BOOT_TOOLS}
done done
cd ${DEPLOYDIR} cd ${DEPLOYDIR}
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin ln -sf ${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin
@ -223,8 +227,9 @@ do_deploy_append () {
# Sign U-boot image # Sign U-boot image
if [ "${UBOOT_RAM_COMBINATIONS}" = "" ]; then if [ "${UBOOT_RAM_COMBINATIONS}" = "" ]; then
for target in ${IMXBOOT_TARGETS}; do for target in ${IMXBOOT_TARGETS}; do
# Link to current "target" mkimage log # Point to make logs
ln -sf mkimage-${target}.log mkimage.log export CONFIG_MKIMAGE_LOG_PATH="${DEPLOYDIR}/${BOOT_TOOLS}/mkimage-${target}.log"
export CONFIG_FIT_HAB_LOG_PATH="${DEPLOYDIR}/${BOOT_TOOLS}/mkimage-print_fit_hab.log"
trustfence-sign-uboot.sh ${DEPLOYDIR}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} ${DEPLOYDIR}/${UBOOT_PREFIX}-signed-${MACHINE}.bin-${target} trustfence-sign-uboot.sh ${DEPLOYDIR}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} ${DEPLOYDIR}/${UBOOT_PREFIX}-signed-${MACHINE}.bin-${target}
if [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then if [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then
@ -237,8 +242,8 @@ do_deploy_append () {
for ramc in ${UBOOT_RAM_COMBINATIONS}; do for ramc in ${UBOOT_RAM_COMBINATIONS}; do
for rev in ${SOC_REVISIONS}; do for rev in ${SOC_REVISIONS}; do
for target in ${IMXBOOT_TARGETS}; do for target in ${IMXBOOT_TARGETS}; do
# Link to current "target" mkimage log # Point to make log
ln -sf mkimage-${target}.log mkimage.log export CONFIG_MKIMAGE_LOG_PATH="${DEPLOYDIR}/${BOOT_TOOLS}/mkimage-${target}.log"
trustfence-sign-uboot.sh ${DEPLOYDIR}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} ${DEPLOYDIR}/${UBOOT_PREFIX}-signed-${MACHINE}-${rev}-${ramc}.bin-${target} trustfence-sign-uboot.sh ${DEPLOYDIR}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} ${DEPLOYDIR}/${UBOOT_PREFIX}-signed-${MACHINE}-${rev}-${ramc}.bin-${target}
if [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then if [ "${TRUSTFENCE_DEK_PATH}" != "0" ]; then