Skip to content

Commit e7e546e

Browse files
mingzhangqunigorpecovnik
authored andcommitted
uboot: invoke spi_image_postprocess hook after both rkspi_loader.img paths
The board_uboot_spi_image_postprocess hook was only invoked on the BOOT_SPI_RKSPI_LOADER=yes (GPT/parted) branch, so boards/extensions that rely on the hook to preserve the finished SPI image silently missed it when the mkimage fallback path produced rkspi_loader.img. Move the declare -F check past the inner if/else so it fires regardless of which build path ran, keeping the hook contract consistent with board_uboot_spl_blobs_postprocess.
1 parent 944f2f9 commit e7e546e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

config/sources/families/include/rockchip64_common.inc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,19 @@ uboot_custom_postprocess() {
313313
run_host_command_logged /sbin/parted -s rkspi_loader.img unit s mkpart uboot 16384 32734
314314
run_host_command_logged dd if=idbloader.img of=rkspi_loader.img seek=64 conv=notrunc
315315
run_host_command_logged dd if=u-boot.itb of=rkspi_loader.img seek=16384 conv=notrunc
316-
# Hook: allow board/extension to copy out the SPI image (e.g. for Maskrom recovery)
317-
declare -F board_uboot_spi_image_postprocess >/dev/null && \
318-
board_uboot_spi_image_postprocess
319316
else
320317
display_alert "uboot_custom_postprocess (mkimage) for BOOT_SUPPORT_SPI:${BOOT_SUPPORT_SPI:-"no"} and BOOT_SPI_RKSPI_LOADER=${BOOT_SPI_RKSPI_LOADER:-"no"}" "SPI rkspi_loader.img" "info"
321318
run_host_command_logged tools/mkimage -n "${BOOT_SOC_MKIMAGE}" -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin rkspi_tpl_spl.img
322319
run_host_command_logged dd if=/dev/zero of=rkspi_loader.img count=8128 status=none
323320
run_host_command_logged dd if=rkspi_tpl_spl.img of=rkspi_loader.img conv=notrunc status=none
324321
run_host_command_logged dd if=u-boot.itb of=rkspi_loader.img seek=768 conv=notrunc status=none
325322
fi
323+
# Hook: allow board/extension to copy out the finished SPI image
324+
# (e.g. for Maskrom recovery). Invoked after both rkspi_loader.img
325+
# build paths so the hook contract is consistent regardless of
326+
# BOOT_SPI_RKSPI_LOADER.
327+
declare -F board_uboot_spi_image_postprocess >/dev/null && \
328+
board_uboot_spi_image_postprocess
326329
fi
327330
}
328331

0 commit comments

Comments
 (0)