Skip to content

Commit be4dab5

Browse files
committed
kernel-dtb: fatal if BOOT_FDT_FILE is unset (fixes #8083)
kernel-dtb ships a preprocessed .dts for the board's active device tree, and it needs BOOT_FDT_FILE to know which .dtb to process. When the board config (or a post_family_config_* hook) leaves BOOT_FDT_FILE unset, the old code emitted a warn alert and returned, silently producing an empty package — easy to miss in a long build log. Turn this into a fatal error inside kernel_dtb_only_build(). The function is only reached from kernel_prepare_build_and_package() when KERNEL_DTB_ONLY=yes, so regular 'kernel' builds (which do ship DTBs, just without the preprocessed .dts convenience) are unaffected. Assisted-by: Claude:claude-opus-4-7
1 parent 3814034 commit be4dab5

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

lib/functions/compilation/kernel.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ function kernel_prepare_build_and_package() {
174174

175175
function kernel_dtb_only_build() {
176176
display_alert "Kernel DTB-only for development" "KERNEL_DTB_ONLY: ${KERNEL_DTB_ONLY}" "info"
177+
178+
if [[ -z "${BOOT_FDT_FILE}" ]]; then
179+
exit_with_error "Board '${BOARD}' branch '${BRANCH}' has no BOOT_FDT_FILE set; kernel-dtb cannot produce a preprocessed DTS. Check the board config and any post_family_config_* hook that may unset it."
180+
fi
181+
177182
# Do it in two separate steps, first build the dtbs then install them.
178183
build_targets_build=("dtbs")
179184
build_targets_install=("dtbs_install")
@@ -183,12 +188,6 @@ function kernel_dtb_only_build() {
183188

184189
display_alert "Considering further .dts convenience processing" "for board '${BOARD}' branch '${BRANCH}'" "info"
185190

186-
# If BOOT_FDT_FILE is not set, bail.
187-
if [[ -z "${BOOT_FDT_FILE}" ]]; then
188-
display_alert "Board '${BOARD}' branch '${BRANCH}'" "No BOOT_FDT_FILE set for board, skipping further processing" "warn"
189-
return 0
190-
fi
191-
192191
display_alert "Kernel DTB-only for development" "Copying preprocessed versions of ${BOOT_FDT_FILE}" "info"
193192

194193
declare fdt_dir fdt_file # we need to parse these out of BOOT_FDT_FILE

0 commit comments

Comments
 (0)