kernel-dtb: fatal if BOOT_FDT_FILE is unset (fixes #8083)#9700
kernel-dtb: fatal if BOOT_FDT_FILE is unset (fixes #8083)#9700iav wants to merge 1 commit intoarmbian:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/functions/compilation/kernel.sh (1)
175-190:⚠️ Potential issue | 🟡 MinorMove the
BOOT_FDT_FILEguard before the DTB build.Line 180 still runs
kernel_buildbefore the new fatal validation, so an unsetBOOT_FDT_FILEcan spend time building/installing DTBs—or fail earlier for an unrelated build reason—before showing the intended diagnostic. Moving the guard to the top makes this path truly fail-fast.Suggested change
function kernel_dtb_only_build() { display_alert "Kernel DTB-only for development" "KERNEL_DTB_ONLY: ${KERNEL_DTB_ONLY}" "info" + + # kernel-dtb needs BOOT_FDT_FILE to know which .dtb to preprocess into a .dts. + # If it is unset (board config, or a post_family_config_* hook that unset it), + # we cannot continue — bail out loudly instead of silently producing an empty package. + if [[ -z "${BOOT_FDT_FILE}" ]]; then + 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." + fi + # Do it in two separate steps, first build the dtbs then install them. build_targets_build=("dtbs") build_targets_install=("dtbs_install") LOG_SECTION="kernel_build" do_with_logging do_with_hooks kernel_build display_alert "Kernel DTB-only .deb, for development/convenience" "kernel dtb build done" "info" display_alert "Considering further .dts convenience processing" "for board '${BOARD}' branch '${BRANCH}'" "info" - - # kernel-dtb needs BOOT_FDT_FILE to know which .dtb to preprocess into a .dts. - # If it is unset (board config, or a post_family_config_* hook that unset it), - # we cannot continue — bail out loudly instead of silently producing an empty package. - if [[ -z "${BOOT_FDT_FILE}" ]]; then - 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." - fi display_alert "Kernel DTB-only for development" "Copying preprocessed versions of ${BOOT_FDT_FILE}" "info"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/functions/compilation/kernel.sh` around lines 175 - 190, The BOOT_FDT_FILE existence check should run before any build starts to fail-fast; inside kernel_dtb_only_build, move the current BOOT_FDT_FILE guard so it executes before setting build_targets_build/build_targets_install and before invoking kernel_build (LOG_SECTION and do_with_logging/do_with_hooks). Ensure the guard still logs the same clear fatal message and uses exit_with_error when BOOT_FDT_FILE is empty, preventing unnecessary dtb build/install work by kernel_build.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@lib/functions/compilation/kernel.sh`:
- Around line 175-190: The BOOT_FDT_FILE existence check should run before any
build starts to fail-fast; inside kernel_dtb_only_build, move the current
BOOT_FDT_FILE guard so it executes before setting
build_targets_build/build_targets_install and before invoking kernel_build
(LOG_SECTION and do_with_logging/do_with_hooks). Ensure the guard still logs the
same clear fatal message and uses exit_with_error when BOOT_FDT_FILE is empty,
preventing unnecessary dtb build/install work by kernel_build.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f1795001-5d0a-49e1-916b-081cb77d0f67
📒 Files selected for processing (1)
lib/functions/compilation/kernel.sh
9eb62bc to
be4dab5
Compare
|
Moved the guard to the top of |
|
I'm probably missing something, but I guess |
…mbian#8083) When BOOT_FDT_FILE is unset, kernel_dtb_only_build() still produces the linux-dtb .deb (from `make dtbs` + dtbs_install) but the convenience preprocessed-DTS copy into output/ is skipped. The previous warn-level message was easy to miss, which is what led to the original report of "no output of the preprocessed dts files". Change the skip message to err-level and spell out that the package itself is fine and point at both likely config sources.
be4dab5 to
be4858d
Compare
|
You're right — The original complaint in #8083 was about silent behaviour: a warn-level message is easy to miss, and the reporter saw an empty |
Summary
kernel-dtbdoes not output whenunset BOOT_FDT_FILEis present #8083:kernel-dtbsilently produced an empty package whenBOOT_FDT_FILEwas unset (typical case: board config relies on apost_family_config_branch_*hook that unsets it for some kernel branches — e.g.orangepi5-maxonedge).kernel_dtb_only_build()now fails fast with a diagnostic pointing at both likely sources (board config, post-family hook).kernelartifact is unaffected — it does not go throughkernel_dtb_only_build().Test plan
./compile.sh kernel-dtb BOARD=orangepi5-max BRANCH=edge— fatal, rc=43, message referencespost_family_config_*hook (this board unsetsBOOT_FDT_FILEin an edge-specific hook)../compile.sh kernel-dtb BOARD=orangepi5-max BRANCH=current— non-fatal path,.debproduced with preprocessed DTS (stays set oncurrent).bash -n lib/functions/compilation/kernel.sh— OK.shellcheck --severity=error lib/functions/compilation/kernel.sh— OK.Summary by CodeRabbit