Skip to content

Commit 7d4a332

Browse files
committed
rk35xx/rockchip-rk3588: add check for 0-byte-dtb u-boot.itb for Radxa u-boot (vendor)
- uses the new hook `check_uboot_produced_binary_file` - runs dumpimage and greps for magic string `Data Size: 0 Bytes` - if found, exits with error - this is to clearly catch build-host related issue in #8227
1 parent c795a2b commit 7d4a332

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

config/sources/families/rk35xx.conf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ esac
4545

4646
prepare_boot_configuration
4747

48-
pre_config_uboot_target__warn_modern_hosts() {
48+
function pre_config_uboot_target__warn_modern_hosts() {
4949
# Check if building Radxa U-Boot on a host other than Ubuntu Jammy
5050
if [[ "${BOOTSOURCE}" == "https://github.com/radxa/u-boot.git" ]]; then
5151
if [[ "${HOSTRELEASE}" != "jammy" ]]; then
@@ -54,6 +54,23 @@ pre_config_uboot_target__warn_modern_hosts() {
5454
fi
5555
}
5656

57+
function check_uboot_produced_binary_file__check_vendor_uboot_for_0_byte_dtb() {
58+
# this hook is called with those two variables
59+
: "${base_binfile:?base_binfile is not set}"
60+
: "${binfile:?binfile is not set}"
61+
62+
[[ "${BOOTSOURCE}" != "https://github.com/radxa/u-boot.git" ]] && return 0 # Check if building Radxa U-Boot
63+
[[ "${base_binfile}" != "u-boot.itb" ]] && return 0 # Only check 'u-boot.itb' file
64+
display_alert "u-boot for ${BOARD}::${BRANCH} built on ${HOSTRELEASE}" "Checking for 0-byte DTB: ${base_binfile}" "info"
65+
66+
# Run dumpimage -l, grep it for string 'Data Size: 0 Bytes', if found, exit_with_error
67+
if dumpimage -l "${binfile}" | grep -q "Data Size: 0 Bytes"; then
68+
exit_with_error "u-boot for ${BOARD}::${BRANCH}::${base_binfile}: Error: The produced u-boot.itb file contains a 0-byte DTB; built on ${HOSTRELEASE}"
69+
fi
70+
71+
return 0
72+
}
73+
5774
family_tweaks_bsp() {
5875
:
5976
}

config/sources/families/rockchip-rk3588.conf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ esac
4343

4444
prepare_boot_configuration
4545

46-
pre_config_uboot_target__warn_modern_hosts() {
46+
function pre_config_uboot_target__warn_modern_hosts() {
4747
# Check if building Radxa U-Boot on a host other than Ubuntu Jammy
4848
if [[ "${BOOTSOURCE}" == "https://github.com/radxa/u-boot.git" ]]; then
4949
if [[ "${HOSTRELEASE}" != "jammy" ]]; then
@@ -52,6 +52,23 @@ pre_config_uboot_target__warn_modern_hosts() {
5252
fi
5353
}
5454

55+
function check_uboot_produced_binary_file__check_vendor_uboot_for_0_byte_dtb() {
56+
# this hook is called with those two variables
57+
: "${base_binfile:?base_binfile is not set}"
58+
: "${binfile:?binfile is not set}"
59+
60+
[[ "${BOOTSOURCE}" != "https://github.com/radxa/u-boot.git" ]] && return 0 # Check if building Radxa U-Boot
61+
[[ "${base_binfile}" != "u-boot.itb" ]] && return 0 # Only check 'u-boot.itb' file
62+
display_alert "u-boot for ${BOARD}::${BRANCH} built on ${HOSTRELEASE}" "Checking for 0-byte DTB: ${base_binfile}" "info"
63+
64+
# Run dumpimage -l, grep it for string 'Data Size: 0 Bytes', if found, exit_with_error
65+
if dumpimage -l "${binfile}" | grep -q "Data Size: 0 Bytes"; then
66+
exit_with_error "u-boot for ${BOARD}::${BRANCH}::${base_binfile}: Error: The produced u-boot.itb file contains a 0-byte DTB; built on ${HOSTRELEASE}"
67+
fi
68+
69+
return 0
70+
}
71+
5572
family_tweaks_bsp() {
5673
:
5774
}

0 commit comments

Comments
 (0)