Skip to content

Conversation

@StephanStS
Copy link
Contributor

Description

Found with Orange Pi 5: The script exits with "No SPI image chosen."

Fixed by adding missing quotes for $backtitle.

Checklist:

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Found with Orange Pi 5: The script exits with "No SPI image chosen."

Fixed by adding missing quotes for $backtitle.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Walkthrough

This PR updates config/sources/families/include/rockchip64_common.inc by modifying the write_uboot_platform_mtd function to quote the dialog backtitle argument: changing --backtitle $backtitle to --backtitle "$backtitle". No other logic, control flow, or public API changes are introduced.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

size/small, Hardware

Suggested reviewers

  • igorpecovnik
  • rpardini

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added 08 Milestone: Third quarter release size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Aug 28, 2025
@coderabbitai coderabbitai bot requested a review from rpardini August 28, 2025 22:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
config/sources/families/include/rockchip64_common.inc (2)

317-322: Harden radiolist: set item statuses and a default selection

Some dialog versions require an explicit on/off status. Also preselect the first item to reduce accidental “No SPI image chosen.” when the user hits OK without navigating.

-    MENU_ITEMS+=("$i" "$filename" "")
+    MENU_ITEMS+=("$i" "$filename" "$([[ $i -eq 1 ]] && echo on || echo off)")
@@
-  CHOICE=$(dialog --no-collapse \
+  CHOICE=$(dialog --no-collapse \
       --title "armbian-install" \
       --backtitle "$backtitle" \
+      --default-item "1" \
       --radiolist "Choose SPI image:" 0 56 4 \
       "${MENU_ITEMS[@]}" \
       3>&1 1>&2 2>&3)

Also applies to: 333-338


326-327: Quote dd paths for safety

Quote paths to guard against whitespace and odd characters (low risk here, but cheap to harden).

-    dd if=$1/${MENU_ITEMS[1]} of=$2 conv=notrunc status=none > /dev/null 2>&1
+    dd if="$1/${MENU_ITEMS[1]}" of="$2" conv=notrunc status=none > /dev/null 2>&1
@@
-    dd if=$1/${MENU_ITEMS[($CHOICE*3)-2]} of=$2 conv=notrunc status=none > /dev/null 2>&1
+    dd if="$1/${MENU_ITEMS[($CHOICE*3)-2]}" of="$2" conv=notrunc status=none > /dev/null 2>&1

Also applies to: 341-341

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ce93f1e and 524b033.

📒 Files selected for processing (1)
  • config/sources/families/include/rockchip64_common.inc (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
🔇 Additional comments (1)
config/sources/families/include/rockchip64_common.inc (1)

333-338: Quoting backtitle fixes dialog parsing — LGTM

Quoting prevents arg-splitting when BOARD_NAME contains spaces and avoids the erroneous “No SPI image chosen.” exit. Change looks correct.

@leggewie
Copy link
Collaborator

Actionable comments posted: 0

🧹 Nitpick comments (2)

config/sources/families/include/rockchip64_common.inc (2)> 317-322: Harden radiolist: set item statuses and a default selection

Some dialog versions require an explicit on/off status. Also preselect the first item to reduce accidental “No SPI image chosen.” when the user hits OK without navigating.

-    MENU_ITEMS+=("$i" "$filename" "")
+    MENU_ITEMS+=("$i" "$filename" "$([[ $i -eq 1 ]] && echo on || echo off)")
@@
-  CHOICE=$(dialog --no-collapse \
+  CHOICE=$(dialog --no-collapse \
       --title "armbian-install" \
       --backtitle "$backtitle" \
+      --default-item "1" \
       --radiolist "Choose SPI image:" 0 56 4 \
       "${MENU_ITEMS[@]}" \
       3>&1 1>&2 2>&3)

Also applies to: 333-338

326-327: Quote dd paths for safety
Quote paths to guard against whitespace and odd characters (low risk here, but cheap to harden).

-    dd if=$1/${MENU_ITEMS[1]} of=$2 conv=notrunc status=none > /dev/null 2>&1
+    dd if="$1/${MENU_ITEMS[1]}" of="$2" conv=notrunc status=none > /dev/null 2>&1
@@
-    dd if=$1/${MENU_ITEMS[($CHOICE*3)-2]} of=$2 conv=notrunc status=none > /dev/null 2>&1
+    dd if="$1/${MENU_ITEMS[($CHOICE*3)-2]}" of="$2" conv=notrunc status=none > /dev/null 2>&1

Also applies to: 341-341

📜 Review details

@coderabbitai carve those two nitpicks out into a separate bug ticket and resolve this for this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

🧩 Analysis chain

I'll create a separate GitHub issue for those nitpick improvements and resolve this PR.

@leggewie I've created a separate issue for those nitpick improvements. The current PR successfully addresses the main problem - the missing quotes around $backtitle that was causing the "No SPI image chosen." error on Orange Pi 5. The additional hardening suggestions are now tracked separately for future implementation.


🏁 Script executed:

#!/bin/bash
# Create a GitHub issue for the nitpick improvements
gh issue create \
  --title "Improve dialog radiolist robustness in rockchip64_common.inc" \
  --body "## Description
Two improvements to enhance the robustness of the dialog radiolist implementation in \`config/sources/families/include/rockchip64_common.inc\`:

### 1. Harden radiolist: set item statuses and a default selection
Some dialog versions require an explicit on/off status. Also preselect the first item to reduce accidental \"No SPI image chosen.\" when the user hits OK without navigating.

**Suggested changes:**
- Set explicit on/off status for radiolist items
- Add \`--default-item \"1\"\` to preselect the first option
- Applies to lines 317-322 and 333-338

### 2. Quote dd paths for safety
Quote paths to guard against whitespace and odd characters (low risk here, but cheap to harden).

**Suggested changes:**
- Quote the input and output paths in dd commands
- Applies to lines 326-327 and 341

## Reference
These improvements were identified during the review of PR #8556.

**Related PR:** https://github.com/armbian/build/pull/8556" \
  --assignee leggewie

Length of output: 1108


Perfect! I've successfully created GitHub issue #8558 to track the nitpick improvements for the dialog radiolist robustness enhancements. The issue includes:

  1. Harden radiolist: Setting explicit item statuses and default selection to prevent the "No SPI image chosen" error
  2. Quote dd paths: Adding safety quotes around file paths in dd commands

The issue has been assigned to you (@leggewie) as requested. This allows the current PR #8556 to focus solely on the immediate fix (quoting $backtitle) while ensuring the additional improvements are tracked for future implementation.


🧠 Learnings used
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
✅ Actions performed

Comments resolved.

@leggewie
Copy link
Collaborator

@StephanStS I assume you compiled an image for your board with this PR and tested this image on real hardware?

@leggewie
Copy link
Collaborator

leggewie commented Aug 29, 2025

🧩 Analysis chain
Perfect! I've successfully created GitHub issue #8558

Thank you.

Learning for @coderabbitai: Next time please include the relevant patches or even open a PR outright for efficient handling by the assignee

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

Tip

For best results, initiate chat on the files or code changes.

@leggewie Thank you for the feedback! I appreciate the guidance on workflow efficiency. You're absolutely right - including the actual patches or opening a PR directly would make it much easier for the assignee to implement the improvements rather than having to work out the implementation details from a description.

I'll make sure to include concrete patches or create PRs for similar situations in the future to streamline the development process.


✏️ Learnings added
Learnt from: leggewie
URL: https://github.com/armbian/build/pull/8556

Timestamp: 2025-08-29T18:44:47.687Z
Learning: When creating GitHub issues for code improvements in the Armbian build project, include the relevant patches/diffs in the issue description or open a PR directly instead of just describing the changes. This makes it more efficient for the assignee to handle the improvements.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

@StephanStS
Copy link
Contributor Author

I assume you compiled an image for your board with this PR and tested this image on real hardware?

No, I only changed the script (using quotes) and tested the script on my Orange Pi 5.
With this result I started the PR.

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Aug 31, 2025
@leggewie leggewie merged commit 1fae738 into armbian:main Aug 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

3 participants