Skip to content

Add support for Arduino UNO Q (Qualcomm QRB2210)#9623

Open
SuperKali wants to merge 12 commits intoarmbian:mainfrom
OpenSource-YYT:arduino-uno-q-fixes
Open

Add support for Arduino UNO Q (Qualcomm QRB2210)#9623
SuperKali wants to merge 12 commits intoarmbian:mainfrom
OpenSource-YYT:arduino-uno-q-fixes

Conversation

@SuperKali
Copy link
Copy Markdown
Member

@SuperKali SuperKali commented Mar 31, 2026

Description

Add support for the Arduino UNO Q board, based on the Qualcomm QRB2210 SoC (quad-core ARM64, 2/4 GB RAM, 16/32 GB eMMC).

The initial board bring-up was done by @chainsx who provided the full foundation: board config, family config, U-Boot patches, kernel config, firmware blobs, and the QDL flash infrastructure. This PR integrates his work into current upstream with additional fixes and improvements found during testing.

What's included:

  • Board config (arduino-uno-q.csc) and family config (qrb2210.conf)
  • U-Boot patches for Qualcomm qcom_defconfig (sysboot support) and boot environment (boot.scr loading from eMMC GPT partition)
  • Boot script (boot-qcom.cmd) with explicit memory addresses to avoid ABL-reserved regions that cause memory overlap
  • Kernel 6.19.0 from Arduino's qcom-v6.19.0-unoq branch
  • Image output extension (image-output-arduino.sh) that produces a QDL-flashable archive with Qualcomm partition layout
  • Qualcomm firmware blobs (GPU, DSP, modem, WiFi ath10k, Bluetooth)
  • ADB daemon support via Debian adbd package for USB shell access over USB-C
  • First-boot rootfs resize to fill entire eMMC (expands from 10 GB to full disk)

Technical notes:

  • The Qualcomm boot chain (PBL → XBL → TZ/HYP → ABL → U-Boot → Linux) requires ~67 GPT partitions for firmware, this is standard for all QRB2210/QCM2290 platforms
  • ABL overwrites U-Boot environment variables (kernel_addr_r, etc.) at runtime, so the boot script must explicitly set memory addresses before loading kernel/initrd
  • Video output is available via USB-C DisplayPort Alt Mode (no dedicated HDMI port)
  • Serial console is available on the JCTL header at 1.8V logic level

How to flash

Requirements

  • qdl tool (build from source or install via package manager)
  • USB-C cable
  • On Linux: add udev rule SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", ATTR{idProduct}=="9008", MODE="0666" to /etc/udev/rules.d/51-arduino-uno-q.rules

Build

./compile.sh build BOARD=arduino-uno-q BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no COMPRESS_OUTPUTIMAGE=img KERNEL_CONFIGURE=no RELEASE=trixie

Flash

  1. Enter EDL mode: power off the board, connect a jumper on the JCTL pins, then connect USB-C to your PC
  2. Extract the image: cd output/images && tar xf *.tar
  3. Flash:
cd arduino-images/flash
qdl --allow-missing --storage emmc prog_firehose_ddr.elf rawprogram0.xml patch0.xml
  1. Remove the JCTL jumper and reconnect USB-C to boot

Access

  • ADB: adb shell (over USB-C, no network required)
  • Video: USB-C DisplayPort Alt Mode (use USB-C to HDMI/DP adapter)
  • Serial console: JCTL header UART at 115200 baud on ttyMSM0 (1.8V logic level — do not use 3.3V/5V adapters)

On first boot the rootfs is automatically expanded to fill the entire eMMC.

How Has This Been Tested?

  • Full build completes successfully
  • Flash via QDL in EDL mode
  • Board boots automatically without manual U-Boot intervention
  • ADB shell accessible over USB-C
  • Kernel 6.19.0-edge-qrb2210 running
  • WiFi firmware loaded (ath10k WCN3990, no errors in dmesg)
  • Rootfs auto-resized to 28 GB on first boot (32 GB eMMC model)
  • Boot partition at 40% usage (201 MB / 511 MB)
  • Serial console on ttyMSM0 at 115200 baud

Checklist:

  • 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

Summary by CodeRabbit

  • New Features
    • Added support for Arduino UNO Q board with complete hardware and kernel configuration
    • Automatic root filesystem resizing on first boot to utilize available storage
    • Enhanced bootloader with extlinux boot support for improved boot flexibility

chainsx and others added 7 commits March 31, 2026 18:09
ABL overwrites kernel_addr_r/fdt_addr_r/ramdisk_addr_r at runtime,
causing memory overlap that corrupts the kernel Image header.

Switch from extlinux to boot.scr which sets correct addresses in the
0xC0000000 RAM bank before loading kernel, initrd and dtb.
U-Boot env loads boot.scr from partition 0x43 (GPT 67 "efi") with
sysboot as fallback.
- Use boot.scr instead of extlinux (BOOTSCRIPT/BOOTENV_FILE in family)
- Add SERIALCON=ttyMSM0 for serial console
- BOOTSIZE=512 to fit kernel + initrd
- Remove BOARD_FIRMWARE_INSTALL="-full", copy only needed firmware
- Add WiFi ath10k firmware copy
- Add ADB daemon with Armbian branding
- Add first-boot rootfs resize service
- Update kernel to 6.19.0 from qcom-v6.19.0-unoq branch
Use dd with sector offsets instead of loop device partitions to extract
boot and rootfs images. The previous approach failed because the build
framework releases the loop device before the extension runs.
Add systemd service that expands the rootfs partition to fill the entire
eMMC on first boot using sgdisk. Removes the empty userdata partition
and recreates rootfs with all remaining space.
Update board-2.bin from linux-firmware (ath-20260204) with support for
additional board IDs.
@SuperKali SuperKali requested review from a team and igorpecovnik as code owners March 31, 2026 16:35
@SuperKali SuperKali requested review from hzyitc and removed request for a team March 31, 2026 16:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

This pull request adds comprehensive support for the Arduino UNO Q board, a Qualcomm QRB2210-based platform. It introduces board configuration, kernel configuration, U-Boot bootloader patches, boot scripts, family configuration, image output extension, and BSP packages for automatic filesystem resizing and service initialization.

Changes

Cohort / File(s) Summary
Board Configuration
config/boards/arduino-uno-q.csc
Defines Arduino UNO Q board variables (vendor, kernel target, boot device tree, serial console). Adds three post-family hooks: main installation hook for system packages (QRTR, BlueZ, adbd, partitioning tools) with USB gadget rebranding; BSP hook for filesystem resize script and service; BSP hook for initramfs firmware integration.
Kernel & Family Configuration
config/kernel/linux-qrb2210-edge.config, config/sources/families/qrb2210.conf
Kernel defconfig enabling core subsystems (IPC, networking, cgroups, KVM, AppArmor, hardware monitoring) and broad SoC support. Family config defines architecture, bootloader source, boot script names, disables Wi-Fi/BTF, declares host dependency for xxd, and defines uboot_custom_postprocess() for U-Boot image generation (gzip, DTB concatenation, mkbootimg boot.img creation).
U-Boot Patches
patch/u-boot/u-boot-qrb2210/0001-qcom-add-extlinux.patch, patch/u-boot/u-boot-qrb2210/0002-u-boot-use-extlinux.patch
Enables sysboot command in qcom_defconfig. Replaces boot flow from EFI bootmgr to extlinux-based boot: load/source boot.scr then sysboot extlinux.conf from MMC partition 43.
Boot Environment & Scripts
config/bootenv/qrb2210.txt, config/bootscripts/boot-qrb2210.cmd
Boot environment sets verbosity, disables logo, routes console to serial. Comprehensive U-Boot boot script setting kernel addresses, loading kernel/initrd/device-tree from MMC, applying device-tree overlays with error handling, and booting via booti command.
BSP Packages & Services
packages/bsp/arduino/armbian-resize-filesystem-qcom, packages/bsp/arduino/armbian-resize-filesystem-qcom.service
Executable script for one-time GPT partition 68 expansion via sgdisk and resize2fs to fill eMMC space. Systemd service unit with dependency ordering to run before firstrun service at multi-user.target.
Image Output & Extension
extensions/image-output-arduino.sh, extensions/qcombin.sh
Image conversion function extracts bootfs/rootfs partitions, copies Arduino-specific binaries from qcombin directory, mounts and copies boot.img, then packages into Arduino-format tar archive. Extension function fetches qcombin sources from repository branch.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hop, hop, the Arduino hops along,
With Qualcomm's spark and a boot script song,
Partitions dance and extlinux glows,
The rootfs stretches where eMMC flows, 🚀
A wee rabbit's patch makes boards bloom!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding support for a new hardware board (Arduino UNO Q based on Qualcomm QRB2210), which is the primary objective of this changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added 05 Milestone: Second quarter release size/large PR with 250 lines or more Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Framework Framework components Patches Patches related to kernel, U-Boot, ... BSP Board Support Packages labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Missing required board assets

This PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
They are required by Armbian Imager to ensure all boards are displayed with proper images.

  • Board images: board-images/<board>.png (1920x1080 px transparent)
  • Vendor logos: board-vendor-logos/<vendor>-logo.png (512x512 px transparent)

Missing items

  • Board image missing for arduino-uno-q

    • Expected: board-images/arduino-uno-q.png
    • Fix: add the file to armbian/armbian.github.io (folder board-images/)
  • BOARD_VENDOR not found in config/boards/arduino-uno-q.csc

    • Fix: add e.g. BOARD_VENDOR="radxa" (lowercase recommended)

Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check.

@SuperKali
Copy link
Copy Markdown
Member Author

Armbianmonitor: https://paste.armbian.com/nejiwigeku

Copy link
Copy Markdown
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: 5

🧹 Nitpick comments (2)
extensions/image-output-arduino.sh (1)

28-30: Derive the U-Boot package path from ${BRANCH}.

lib/functions/compilation/uboot.sh names the package linux-u-boot-${BRANCH}-${BOARD}. Hardcoding linux-u-boot-edge-arduino-uno-q makes this hook branch-specific for no real benefit.

💡 Suggested refactor
+ local uboot_pkg="linux-u-boot-${BRANCH}-${BOARD}"
- cp rootfs_mount/usr/lib/linux-u-boot-edge-arduino-uno-q/boot.img arduino-images/flash
+ cp "rootfs_mount/usr/lib/${uboot_pkg}/boot.img" arduino-images/flash
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@extensions/image-output-arduino.sh` around lines 28 - 30, The script
hardcodes the U-Boot package directory; change it to derive the package name
from BRANCH and BOARD (same convention as lib/functions/compilation/uboot.sh).
After creating rootfs_loop from ROOTFS_IMAGE_FILE, build a variable like
uboot_pkg="linux-u-boot-${BRANCH}-${BOARD}" and use quoted paths
rootfs_mount/usr/lib/"${uboot_pkg}"/boot.img when copying to
arduino-images/flash; update any references to the old hardcoded dirname (e.g.,
linux-u-boot-edge-arduino-uno-q) and ensure variables like rootfs_loop and
ROOTFS_IMAGE_FILE remain quoted where used.
config/boards/arduino-uno-q.csc (1)

36-38: Hardcoded path for ADB gadget binary may be fragile.

The sed commands assume the adbd package installs the gadget binary at /usr/lib/android-sdk/platform-tools/adbd-usb-gadget. If the Debian adbd package changes this path in future versions, these commands will silently fail without error.

Consider adding a guard to verify the file exists before modifying.

Suggested improvement
 	# ADB branding
+	if [[ -f "$SDCARD/usr/lib/android-sdk/platform-tools/adbd-usb-gadget" ]]; then
 		chroot_sdcard sed -i 's/"Debian"/"Armbian"/' /usr/lib/android-sdk/platform-tools/adbd-usb-gadget
 		chroot_sdcard sed -i 's/"ADB device"/"Arduino UNO Q"/' /usr/lib/android-sdk/platform-tools/adbd-usb-gadget
+	else
+		display_alert "adbd-usb-gadget not found" "skipping ADB branding" "warn"
+	fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/boards/arduino-uno-q.csc` around lines 36 - 38, The sed commands that
run via "chroot_sdcard sed -i 's/.../' ..." assume
/usr/lib/android-sdk/platform-tools/adbd-usb-gadget exists; add a guard to check
for the file's existence before attempting in-place edits (e.g., test -f or if [
-e ]) and only run the sed replacements when the file is present, otherwise log
a warning or fail gracefully so the commands don't silently no-op; update the
two occurrences that target adbd-usb-gadget to use this guarded check.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/boards/arduino-uno-q.csc`:
- Around line 40-43: The enable for armbian-resize-filesystem-qcom.service is
happening in post_family_tweaks__* before the service file is installed in
post_family_tweaks_bsp__*; move the enable step so the service file exists when
enabling — either (A) install the service file earlier by adding its
installation into post_family_tweaks__* before the systemctl enable call, or (B)
append the systemctl enable command into the BSP postinst hook created by
post_family_tweaks_bsp__* (so the enable runs during package postinst),
targeting the armbian-resize-filesystem-qcom.service name to ensure enable
succeeds.

In `@config/bootscripts/boot-qcom.cmd`:
- Around line 19-20: The fallback rootdev currently uses "/dev/mmcblk0p1" which
doesn't match the layout where partition 67 is efi and partition 68 is the
rootfs; update the default setenv rootdev value in boot-qcom.cmd to the actual
rootfs partition (e.g., "/dev/mmcblk0p68") so the no-armbianEnv.txt boot path
remains functional and consistent with the resize helper and partition
numbering.

In `@config/sources/families/qrb2210.conf`:
- Around line 35-56: In uboot_custom_postprocess, remove the hardcoded directory
change (the run_host_command_logged cd ...) since the function already runs in
the u-boot build directory, and instead download mkbootimg to a local file,
verify its integrity against a configured checksum variable (e.g.,
MKBOOTIMG_SHA256) using sha256sum (or openssl dgst -sha256), aborting with a
logged error if the checksum does not match, then chmod +x and proceed to run
mkbootimg; reference the function name uboot_custom_postprocess and the
mkbootimg binary and use BOOT_FDT_FILE only for the u-boot artifact path.

In `@extensions/image-output-arduino.sh`:
- Around line 27-32: The current sequence that sets up a loop device and mounts
rootfs (creating rootfs_mount, setting rootfs_loop via losetup, then mount and
cp) can leave the mountpoint and loop device attached if a subsequent command
fails under set -e; add a cleanup handler using the repository's
add_cleanup_handler pattern: declare rootfs_loop and rootfs_mounted flags before
running losetup/mount, register a cleanup function (e.g., cleanup_rootfs) that
checks if rootfs_mount is mounted and runs umount rootfs_mount and checks if
rootfs_loop is non-empty and runs losetup -d "$rootfs_loop", then call
add_cleanup_handler cleanup_rootfs immediately after acquiring the loop device
(after setting rootfs_loop) so the handler runs on exit/failure; update the
cp/umount/losetup -d logic to rely on the cleanup handler (or remove duplicate
teardown) and ensure variables referenced are the same names (rootfs_loop,
rootfs_mount) used in the diff.

In `@packages/bsp/arduino/armbian-resize-filesystem-qcom`:
- Line 1: The script currently writes the completion flag `.rootfs-expanded`
before verifying success of critical commands and never validates the extracted
STARTLBA; change the flow to fail fast: enable safe error handling (e.g., set
-euo pipefail or check exit codes) and validate STARTLBA is non-empty and
numeric before using it in sgdisk/parted/resize operations, run
sgdisk/partprobe/resize2fs and check each command's exit status, and only
create/write `.rootfs-expanded` after all operations have completed
successfully; reference the extracted variable STARTLBA and the commands sgdisk,
partprobe, and resize2fs when adding checks and moving the flag-write to the
script’s successful end.

---

Nitpick comments:
In `@config/boards/arduino-uno-q.csc`:
- Around line 36-38: The sed commands that run via "chroot_sdcard sed -i
's/.../' ..." assume /usr/lib/android-sdk/platform-tools/adbd-usb-gadget exists;
add a guard to check for the file's existence before attempting in-place edits
(e.g., test -f or if [ -e ]) and only run the sed replacements when the file is
present, otherwise log a warning or fail gracefully so the commands don't
silently no-op; update the two occurrences that target adbd-usb-gadget to use
this guarded check.

In `@extensions/image-output-arduino.sh`:
- Around line 28-30: The script hardcodes the U-Boot package directory; change
it to derive the package name from BRANCH and BOARD (same convention as
lib/functions/compilation/uboot.sh). After creating rootfs_loop from
ROOTFS_IMAGE_FILE, build a variable like
uboot_pkg="linux-u-boot-${BRANCH}-${BOARD}" and use quoted paths
rootfs_mount/usr/lib/"${uboot_pkg}"/boot.img when copying to
arduino-images/flash; update any references to the old hardcoded dirname (e.g.,
linux-u-boot-edge-arduino-uno-q) and ensure variables like rootfs_loop and
ROOTFS_IMAGE_FILE remain quoted where used.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b6589b63-064d-48ec-a053-77dd04c40f56

📥 Commits

Reviewing files that changed from the base of the PR and between 9d0073e and 4aa475d.

⛔ Files ignored due to path filters (16)
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/board-2.bin is excluded by !**/*.bin
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/firmware-5.bin is excluded by !**/*.bin
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/qcm2290/firmware-5.bin is excluded by !**/*.bin
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/qrb4210/firmware-5.bin is excluded by !**/*.bin
  • packages/blobs/arduino/firmware/qca/apnv11.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/cdt.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_backup0.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_backup1.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_backup2.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_both0.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_empty0.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_main0.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_main1.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/gpt_main2.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/zeros_1sector.bin is excluded by !**/*.bin
  • packages/blobs/arduino/flash/zeros_33sectors.bin is excluded by !**/*.bin
📒 Files selected for processing (43)
  • config/boards/arduino-uno-q.csc
  • config/bootenv/qcom.txt
  • config/bootscripts/boot-qcom.cmd
  • config/kernel/linux-qrb2210-edge.config
  • config/sources/families/qrb2210.conf
  • extensions/image-output-arduino.sh
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/qcm2290/wlanmdsp.mbn
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/qrb4210/wlanmdsp.mbn
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/wlanmdsp.mbn
  • packages/blobs/arduino/firmware/qca/apbtfw11.tlv
  • packages/blobs/arduino/firmware/qcom/a702_sqe.fw
  • packages/blobs/arduino/firmware/qcom/qcm2290/a702_zap.mbn
  • packages/blobs/arduino/firmware/qcom/qcm2290/adsp.mbn
  • packages/blobs/arduino/firmware/qcom/qcm2290/adspr.jsn
  • packages/blobs/arduino/firmware/qcom/qcm2290/adsps.jsn
  • packages/blobs/arduino/firmware/qcom/qcm2290/adspua.jsn
  • packages/blobs/arduino/firmware/qcom/qcm2290/modem.mbn
  • packages/blobs/arduino/firmware/qcom/qcm2290/modemr.jsn
  • packages/blobs/arduino/firmware/qcom/qcm2290/modemuw.jsn
  • packages/blobs/arduino/firmware/qcom/qcm2290/wlanmdsp.mbn
  • packages/blobs/arduino/firmware/qcom/venus-6.0/venus.mbn
  • packages/blobs/arduino/flash/abl.elf
  • packages/blobs/arduino/flash/devcfg.mbn
  • packages/blobs/arduino/flash/featenabler.mbn
  • packages/blobs/arduino/flash/hyp.mbn
  • packages/blobs/arduino/flash/imagefv.elf
  • packages/blobs/arduino/flash/km4.mbn
  • packages/blobs/arduino/flash/multi_image.mbn
  • packages/blobs/arduino/flash/patch0.xml
  • packages/blobs/arduino/flash/prog_firehose_ddr.elf
  • packages/blobs/arduino/flash/qupv3fw.elf
  • packages/blobs/arduino/flash/rawprogram0.nouser.xml
  • packages/blobs/arduino/flash/rawprogram0.xml
  • packages/blobs/arduino/flash/rpm.mbn
  • packages/blobs/arduino/flash/storsec.mbn
  • packages/blobs/arduino/flash/tz.mbn
  • packages/blobs/arduino/flash/uefi_sec.mbn
  • packages/blobs/arduino/flash/xbl.elf
  • packages/blobs/arduino/flash/xbl_feature_config.elf
  • packages/bsp/arduino/armbian-resize-filesystem-qcom
  • packages/bsp/arduino/armbian-resize-filesystem-qcom.service
  • patch/u-boot/u-boot-qrb2210/0001-qcom-add-extlinux.patch
  • patch/u-boot/u-boot-qrb2210/0002-u-boot-use-extlinux.patch

@HeyMeco
Copy link
Copy Markdown
Collaborator

HeyMeco commented Mar 31, 2026

Great work you two.
But I have a few gripes that make me against merging this in the current state.

  1. We should not have firmware in /build. I would propose a qcombin like rkbin where we can have folders per SoC for things like the prog_firehose_ddr (equivalent to the rk loader binary).
  2. Let’s see if there is more ways we can reduce qcom intrinsics to a more standard approach for stuff like the rootfs resize. This will just become unmaintainable over time otherwise
    • Maybe we can do things more like on QCS6490?

@HeyMeco
Copy link
Copy Markdown
Collaborator

HeyMeco commented Mar 31, 2026

Also the board does have video output just via usb-c dp instead of hdmi

@SuperKali
Copy link
Copy Markdown
Member Author

SuperKali commented Mar 31, 2026

  1. We should not have firmware in /build. I would propose a qcombin like rkbin where we can have folders per SoC for things like the prog_firehose_ddr (equivalent to the rk loader binary).

Do you have any useful suggestions? Or a plan for how to do what you're proposing? Having another repository definitely doesn't make sense.

2. Let’s see if there is more ways we can reduce qcom intrinsics to a more standard approach for stuff like the rootfs resize. This will just become unmaintainable over time otherwise

There's no other option; the GPT-style partitions are pre-configured, and I don't think the source code for them—which specifies the partition tables—is available online. Currently, the userdata partition is simply resized to make space for root partitions that are adjacent and don't cause any issues.

Also the board does have video output just via usb-c dp instead of hdmi

It's a minor issue; I'll fix it by editing it

@SuperKali
Copy link
Copy Markdown
Member Author

SuperKali commented Mar 31, 2026

To add some more context with public references:

The QCS6490 and QRB2210 have fundamentally different boot architectures. The QCS6490 uses UFS storage with a full UEFI/EDK2 firmware that can directly load GRUB from an EFI System Partition, which is why grub-with-dtb works there. The QRB2210 instead uses eMMC and as documented by Linaro, "the RB1 cannot boot directly from UEFI firmware stored in flash and requires U-Boot packaged in Android boot image format" (https://www.linaro.org/blog/initial-u-boot-release-for-qualcomm-platforms/). This is also confirmed in the unified boot article (https://www.linaro.org/blog/unified-boot-on-qualcomm-rbx-development-boards/) and the Qualcomm Debian build scripts (https://deepwiki.com/qualcomm-linux/qcom-deb-images/2.5-u-boot-building) which both use U-Boot chainloaded by ABL for RB1/RB2 eMMC boards. The RB1 also has restrictions that prevent replacing the hypervisor, further limiting alternatives.

About the rootfs resize, the custom script is needed because the Qualcomm GPT includes an empty userdata partition (partition 69, size 0) that causes parted to fail with "Can't have the end before the start!", which breaks Armbian's standard armbian-resize-filesystem. The script simply removes that empty partition with sgdisk before expanding rootfs, it's a workaround for the GPT layout not a SoC-level intrinsic.

If maybe you have a solution under the hood that I don’t know just say it, maybe giving more info about it

@chainsx
Copy link
Copy Markdown
Member

chainsx commented Apr 1, 2026

lgtm

@HeyMeco
Copy link
Copy Markdown
Collaborator

HeyMeco commented Apr 1, 2026

I have started: https://github.com/armbian/qcombin
Feel free to move the binaries to the Agatti folder

Restore the ath10k board-2.bin firmware to the version provided in the
original board bring-up, as the upstream version has not been validated
on this hardware.
Move EDL flash binaries (ABL, XBL, TrustZone, GPT tables, etc.) from
packages/blobs/arduino/flash/ to the external armbian/qcombin repository
under the Agatti folder, following the same pattern as rkbin for
Rockchip and mtkbin for MediaTek.

Add qcombin.sh extension to fetch binaries during build. Update
image-output-arduino.sh to source flash files from qcombin cache and
derive U-Boot package path from BRANCH/BOARD variables.
Copy link
Copy Markdown
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.

♻️ Duplicate comments (3)
config/sources/families/qrb2210.conf (2)

47-50: ⚠️ Potential issue | 🟠 Major

Add checksum verification for downloaded mkbootimg binary.

Downloading an executable from the internet without integrity verification creates a supply chain risk. If the Launchpad CDN or URL is compromised, a malicious binary could be executed during the build.

The previous review correctly identified this security concern. Add SHA256 verification:

🔒 Proposed fix with checksum
+    # SHA256 of mkbootimg from launchpadlibrarian.net/810765814
+    declare -g MKBOOTIMG_SHA256="<INSERT_ACTUAL_SHA256_HERE>"
+    
     # https://bugs.launchpad.net/ubuntu/+source/android-platform-tools/+bug/2058228
     # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050300
     run_host_command_logged wget https://launchpadlibrarian.net/810765814/mkbootimg
+    echo "${MKBOOTIMG_SHA256}  mkbootimg" | sha256sum -c - || exit_with_error "mkbootimg checksum verification failed"
     run_host_command_logged chmod +x mkbootimg
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/sources/families/qrb2210.conf` around lines 47 - 50, Add SHA256
integrity checking for the downloaded mkbootimg: after run_host_command_logged
wget ... mkbootimg, compute and verify its SHA256 against the expected hash (use
run_host_command_logged to run sha256sum -c or echo "<expected-sha256> 
mkbootimg" | sha256sum -c -) before running run_host_command_logged chmod +x
mkbootimg; if verification fails, log the error and exit non‑zero so the build
stops. Ensure the verification step references the same mkbootimg filename and
that chmod +x only runs upon successful verification.

38-38: ⚠️ Potential issue | 🟡 Minor

Hardcoded U-Boot worktree path may break with different branch names.

The path u-boot-worktree/u-boot/qcom-mainline assumes the branch name will always be qcom-mainline. If BOOTBRANCH is overridden (allowed by line 22's default syntax), this path will be incorrect.

#!/bin/bash
# Check how other family configs handle uboot_custom_postprocess working directory
rg -n "function uboot_custom_postprocess" config/sources/families/ -A 5 | head -40
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/sources/families/qrb2210.conf` at line 38, The hardcoded path in the
run_host_command_logged call inside uboot_custom_postprocess uses
"u-boot-worktree/u-boot/qcom-mainline" which breaks if BOOTBRANCH is overridden;
update that call to build the path dynamically using the BOOTBRANCH variable (or
the same variable used earlier where BOOTBRANCH is set/defaulted) so the working
directory becomes "$SRC/cache/sources/u-boot-worktree/u-boot/${BOOTBRANCH}" (or
equivalent expansion), ensuring run_host_command_logged and any dependent
commands use the variable-driven path rather than the literal "qcom-mainline".
extensions/image-output-arduino.sh (1)

27-32: ⚠️ Potential issue | 🟠 Major

Add cleanup handler to prevent resource leaks on failure.

This segment acquires a loop device and mounts the rootfs without registering a cleanup handler. Under set -e, if mount or cp fails, the loop device remains attached.

The previous review correctly identified this issue. Consider using a local trap or add_cleanup_handler pattern as shown in extensions/gxlimg.sh:

♻️ Suggested approach using trap
+	local rootfs_loop=""
+	cleanup_arduino_rootfs() {
+		[[ -n "$rootfs_loop" ]] && { umount rootfs_mount 2>/dev/null || true; losetup -d "$rootfs_loop" 2>/dev/null || true; }
+		rm -rf rootfs_mount 2>/dev/null || true
+	}
+	trap cleanup_arduino_rootfs EXIT
+
 	mkdir -p rootfs_mount
-	local rootfs_loop=$(losetup -f --show "${ROOTFS_IMAGE_FILE}")
+	rootfs_loop=$(losetup -f --show "${ROOTFS_IMAGE_FILE}")
 	mount ${rootfs_loop} rootfs_mount
 	cp rootfs_mount/usr/lib/linux-u-boot-${BRANCH}-${BOARD}/boot.img arduino-images/flash/
 	umount rootfs_mount
 	losetup -d ${rootfs_loop}
+	trap - EXIT
+	rm -rf rootfs_mount
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@extensions/image-output-arduino.sh` around lines 27 - 32, The code attaches a
loop device to ROOTFS_IMAGE_FILE and mounts it without a cleanup handler, so
failures (e.g., in mount or cp) leak the loop device; add a cleanup function
(e.g., cleanup_rootfs) that checks and unmounts rootfs_mount if mounted and
detaches the loop device stored in rootfs_loop, then register it with trap
'cleanup_rootfs EXIT' (or use the existing add_cleanup_handler pattern)
immediately after creating rootfs_loop so any early exit runs the handler;
ensure the handler safely no-ops if rootfs_loop is empty or rootfs_mount is not
mounted and remove the trap/handler after normal successful cleanup if needed.
🧹 Nitpick comments (4)
config/sources/families/qrb2210.conf (2)

35-58: Inconsistent indentation in uboot_custom_postprocess.

The function mixes tabs (lines 38-43, 52-57) and spaces (lines 45-50). This inconsistency can cause issues with some editors and reduces readability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/sources/families/qrb2210.conf` around lines 35 - 58, The function
uboot_custom_postprocess has mixed tabs and spaces causing inconsistent
indentation; normalize the file by replacing tabs with spaces (or vice-versa per
project style) inside uboot_custom_postprocess so all run_host_command_logged
lines, the heredoc/cat continuation, the touch/wget/chmod/mkbootimg calls, and
the continuation backslashes use the same indentation style; ensure lines
referencing "${BOOT_FDT_FILE}", mkbootimg, and other symbols keep their current
spacing semantics while aligning indentation consistently across the whole
function.

73-75: Intentional no-op for write_uboot_platform is appropriate.

Per the PR objectives, the QRB2210 uses U-Boot packaged for ABL chainloading rather than direct platform writing. The no-op implementation with a display alert correctly skips the standard U-Boot write process.

Consider adding a brief comment explaining why this is intentionally empty for future maintainers:

📝 Suggested documentation
+# QRB2210 uses U-Boot as an Android boot.img chainloaded by ABL;
+# no direct platform write is needed during image build.
 write_uboot_platform() {
 	display_alert "Skip."
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/sources/families/qrb2210.conf` around lines 73 - 75, The no-op
write_uboot_platform() implementation is correct but lacks explanatory
documentation; add a short inline comment above or inside the
write_uboot_platform function (referencing write_uboot_platform) stating that
QRB2210 uses U-Boot packaged for ABL chainloading and therefore standard U-Boot
platform write is intentionally skipped, so future maintainers understand this
is deliberate and not an omission.
extensions/image-output-arduino.sh (2)

12-15: Consolidate fdisk calls and add robustness checks.

Running fdisk -l four times on the same image is inefficient. Additionally, the awk parsing assumes specific column positions which may vary across fdisk versions or partition table types.

♻️ Proposed consolidation
-	local p1_start=$(fdisk -l "${img}" | grep "${img}1" | awk '{print $2}')
-	local p1_sectors=$(fdisk -l "${img}" | grep "${img}1" | awk '{print $4}')
-	local p2_start=$(fdisk -l "${img}" | grep "${img}2" | awk '{print $2}')
-	local p2_sectors=$(fdisk -l "${img}" | grep "${img}2" | awk '{print $4}')
+	local fdisk_output
+	fdisk_output=$(fdisk -l "${img}")
+	local p1_start=$(echo "$fdisk_output" | grep "${img}1" | awk '{print $2}')
+	local p1_sectors=$(echo "$fdisk_output" | grep "${img}1" | awk '{print $4}')
+	local p2_start=$(echo "$fdisk_output" | grep "${img}2" | awk '{print $2}')
+	local p2_sectors=$(echo "$fdisk_output" | grep "${img}2" | awk '{print $4}')
+
+	# Validate extracted values
+	[[ -z "$p1_start" || -z "$p1_sectors" ]] && exit_with_error "Failed to parse partition 1 from fdisk output"
+	[[ -z "$p2_start" || -z "$p2_sectors" ]] && exit_with_error "Failed to parse partition 2 from fdisk output"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@extensions/image-output-arduino.sh` around lines 12 - 15, The current script
calls fdisk -l on ${img} four times and relies on hardcoded column positions for
p1_start, p1_sectors, p2_start and p2_sectors; replace this by running fdisk -l
"${img}" once into a variable (e.g. fdout) and parse that output to extract the
partition lines for "${img}1" and "${img}2" with more robust patterns (use grep
-E for the exact device name and awk or cut that matches fields by whitespace or
use sed to capture start/size columns), add checks that the partition lines
exist and that extracted values are non-empty and numeric, and fail with a clear
error if parsing fails. Ensure you update references to p1_start, p1_sectors,
p2_start and p2_sectors accordingly.

23-40: Use absolute paths for staging directory to avoid working directory issues.

The arduino-images directory is created and used with a relative path. If the working directory changes unexpectedly (e.g., due to future code modifications or extension ordering), this could cause failures.

♻️ Proposed fix using absolute paths
-	rm -rf arduino-images
-	mkdir -p arduino-images/flash
-	cp -r "${QCOMBIN_DIR}/Agatti/"* arduino-images/flash/
+	local staging_dir="${DESTIMG}/arduino-images"
+	rm -rf "${staging_dir}"
+	mkdir -p "${staging_dir}/flash"
+	cp -r "${QCOMBIN_DIR}/Agatti/"* "${staging_dir}/flash/"
 	...
-	cp rootfs_mount/usr/lib/linux-u-boot-${BRANCH}-${BOARD}/boot.img arduino-images/flash/
+	cp rootfs_mount/usr/lib/linux-u-boot-${BRANCH}-${BOARD}/boot.img "${staging_dir}/flash/"
 	...
-	mv ${BOOTFS_IMAGE_FILE} arduino-images/disk-sdcard.img.esp
-	mv ${ROOTFS_IMAGE_FILE} arduino-images/disk-sdcard.img.root
+	mv "${BOOTFS_IMAGE_FILE}" "${staging_dir}/disk-sdcard.img.esp"
+	mv "${ROOTFS_IMAGE_FILE}" "${staging_dir}/disk-sdcard.img.root"

-	tar -cvf ${DESTIMG}/${version}.tar arduino-images
-	rm -rf arduino-images
+	tar -cvf "${DESTIMG}/${version}.tar" -C "${DESTIMG}" arduino-images
+	rm -rf "${staging_dir}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@extensions/image-output-arduino.sh` around lines 23 - 40, The script uses a
relative staging folder "arduino-images" and "rootfs_mount" which can break if
the working directory changes; change to an absolute staging path by introducing
a single absolute STAGING_DIR (e.g., created with mktemp -d or derived from
${DESTIMG}) and replace all hardcoded "arduino-images" and "rootfs_mount"
references with "${STAGING_DIR}/arduino-images" and
"${STAGING_DIR}/rootfs_mount"; ensure subsequent operations (mkdir, cp from
"${QCOMBIN_DIR}", mount/umount of ${ROOTFS_IMAGE_FILE}, moves of
${BOOTFS_IMAGE_FILE} and ${ROOTFS_IMAGE_FILE}, tar into
${DESTIMG}/${version}.tar and the final rm -rf cleanup) all use those absolute
paths, and keep using the same ${rootfs_loop}, ${ROOTFS_IMAGE_FILE},
${BOOTFS_IMAGE_FILE}, ${DESTIMG}, ${version} variables as identifiers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@config/sources/families/qrb2210.conf`:
- Around line 47-50: Add SHA256 integrity checking for the downloaded mkbootimg:
after run_host_command_logged wget ... mkbootimg, compute and verify its SHA256
against the expected hash (use run_host_command_logged to run sha256sum -c or
echo "<expected-sha256>  mkbootimg" | sha256sum -c -) before running
run_host_command_logged chmod +x mkbootimg; if verification fails, log the error
and exit non‑zero so the build stops. Ensure the verification step references
the same mkbootimg filename and that chmod +x only runs upon successful
verification.
- Line 38: The hardcoded path in the run_host_command_logged call inside
uboot_custom_postprocess uses "u-boot-worktree/u-boot/qcom-mainline" which
breaks if BOOTBRANCH is overridden; update that call to build the path
dynamically using the BOOTBRANCH variable (or the same variable used earlier
where BOOTBRANCH is set/defaulted) so the working directory becomes
"$SRC/cache/sources/u-boot-worktree/u-boot/${BOOTBRANCH}" (or equivalent
expansion), ensuring run_host_command_logged and any dependent commands use the
variable-driven path rather than the literal "qcom-mainline".

In `@extensions/image-output-arduino.sh`:
- Around line 27-32: The code attaches a loop device to ROOTFS_IMAGE_FILE and
mounts it without a cleanup handler, so failures (e.g., in mount or cp) leak the
loop device; add a cleanup function (e.g., cleanup_rootfs) that checks and
unmounts rootfs_mount if mounted and detaches the loop device stored in
rootfs_loop, then register it with trap 'cleanup_rootfs EXIT' (or use the
existing add_cleanup_handler pattern) immediately after creating rootfs_loop so
any early exit runs the handler; ensure the handler safely no-ops if rootfs_loop
is empty or rootfs_mount is not mounted and remove the trap/handler after normal
successful cleanup if needed.

---

Nitpick comments:
In `@config/sources/families/qrb2210.conf`:
- Around line 35-58: The function uboot_custom_postprocess has mixed tabs and
spaces causing inconsistent indentation; normalize the file by replacing tabs
with spaces (or vice-versa per project style) inside uboot_custom_postprocess so
all run_host_command_logged lines, the heredoc/cat continuation, the
touch/wget/chmod/mkbootimg calls, and the continuation backslashes use the same
indentation style; ensure lines referencing "${BOOT_FDT_FILE}", mkbootimg, and
other symbols keep their current spacing semantics while aligning indentation
consistently across the whole function.
- Around line 73-75: The no-op write_uboot_platform() implementation is correct
but lacks explanatory documentation; add a short inline comment above or inside
the write_uboot_platform function (referencing write_uboot_platform) stating
that QRB2210 uses U-Boot packaged for ABL chainloading and therefore standard
U-Boot platform write is intentionally skipped, so future maintainers understand
this is deliberate and not an omission.

In `@extensions/image-output-arduino.sh`:
- Around line 12-15: The current script calls fdisk -l on ${img} four times and
relies on hardcoded column positions for p1_start, p1_sectors, p2_start and
p2_sectors; replace this by running fdisk -l "${img}" once into a variable (e.g.
fdout) and parse that output to extract the partition lines for "${img}1" and
"${img}2" with more robust patterns (use grep -E for the exact device name and
awk or cut that matches fields by whitespace or use sed to capture start/size
columns), add checks that the partition lines exist and that extracted values
are non-empty and numeric, and fail with a clear error if parsing fails. Ensure
you update references to p1_start, p1_sectors, p2_start and p2_sectors
accordingly.
- Around line 23-40: The script uses a relative staging folder "arduino-images"
and "rootfs_mount" which can break if the working directory changes; change to
an absolute staging path by introducing a single absolute STAGING_DIR (e.g.,
created with mktemp -d or derived from ${DESTIMG}) and replace all hardcoded
"arduino-images" and "rootfs_mount" references with
"${STAGING_DIR}/arduino-images" and "${STAGING_DIR}/rootfs_mount"; ensure
subsequent operations (mkdir, cp from "${QCOMBIN_DIR}", mount/umount of
${ROOTFS_IMAGE_FILE}, moves of ${BOOTFS_IMAGE_FILE} and ${ROOTFS_IMAGE_FILE},
tar into ${DESTIMG}/${version}.tar and the final rm -rf cleanup) all use those
absolute paths, and keep using the same ${rootfs_loop}, ${ROOTFS_IMAGE_FILE},
${BOOTFS_IMAGE_FILE}, ${DESTIMG}, ${version} variables as identifiers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c0a69718-4358-431d-814c-d358920f8c6b

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa475d and e62945d.

⛔ Files ignored due to path filters (1)
  • packages/blobs/arduino/firmware/ath10k/WCN3990/hw1.0/board-2.bin is excluded by !**/*.bin
📒 Files selected for processing (4)
  • config/boards/arduino-uno-q.csc
  • config/sources/families/qrb2210.conf
  • extensions/image-output-arduino.sh
  • extensions/qcombin.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/boards/arduino-uno-q.csc

@armbian armbian deleted a comment from github-actions bot Apr 2, 2026
@armbian armbian deleted a comment from github-actions bot Apr 2, 2026
@rpardini
Copy link
Copy Markdown
Member

rpardini commented Apr 2, 2026

I see no problem with the boot stack complexity here (we all wish the stack was simpler, but hey, sometimes you gotta do what you gotta do).

I do agree that firmware blobs should be kept elsewhere. Maybe we should formalize this better: "Armbian should move all binary blobs out of armbian/build over time, starting by not adding any new ones, and later moving existing ones".

@SuperKali
Copy link
Copy Markdown
Member Author

I do agree that firmware blobs should be kept elsewhere. Maybe we should formalize this better: "Armbian should move all binary blobs out of armbian/build over time, starting by not adding any new ones, and later moving existing ones".

I don't see any problem with this. To avoid delaying the merge of this PR, I'd prefer not to dwell on it too much; perhaps we could handle it via a new PR.

@HeyMeco
Copy link
Copy Markdown
Collaborator

HeyMeco commented Apr 2, 2026

qcombin side is done. Note prog_firehose_ddr.elf is not board specific therefore can be found in /Agatti/prog_firehose_ddr.elf

@armbian armbian deleted a comment from github-actions bot Apr 2, 2026
@HeyMeco
Copy link
Copy Markdown
Collaborator

HeyMeco commented Apr 2, 2026

I do agree that firmware blobs should be kept elsewhere. Maybe we should formalize this better: "Armbian should move all binary blobs out of armbian/build over time, starting by not adding any new ones, and later moving existing ones".

Then for firmware only thing left is to move packages/blobs/arduino/firmware/* to armbian/firmware.


When that is done and the boot-qcom.cmd is renamed to boot-qrb2210.cmd or boot-agatti.cmd I dont see any blocker from my side anymore.

Move firmware blobs to armbian/firmware repository (armbian/firmware#123)
and remove manual firmware copies from post_family_tweaks. Firmware is
now installed via the armbian-firmware package.

Rename boot-qcom to boot-qrb2210 to be family-specific.
@SuperKali
Copy link
Copy Markdown
Member Author

Done. Firmware moved to armbian/firmware#123, flash binaries moved to armbian/qcombin#1, and boot-qcom.cmd renamed to boot-qrb2210.cmd. Anything else or can we finally press the green button? :)

Copy link
Copy Markdown
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.

♻️ Duplicate comments (2)
config/bootscripts/boot-qrb2210.cmd (1)

20-20: ⚠️ Potential issue | 🟠 Major

Fix fallback rootdev to the actual rootfs partition.

Line 20 defaults to /dev/mmcblk0p1, but this layout uses partition 67 for EFI and partition 68 for rootfs. The no-armbianEnv.txt path can boot with the wrong root device.

Suggested fix
-setenv rootdev "/dev/mmcblk0p1"
+setenv rootdev "/dev/mmcblk0p68"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/bootscripts/boot-qrb2210.cmd` at line 20, The fallback root device
currently set by the setenv rootdev assignment uses /dev/mmcblk0p1 which is
incorrect for this layout; update the setenv rootdev value in boot-qrb2210.cmd
(the setenv rootdev line) to point to the actual rootfs partition
(/dev/mmcblk0p68) so the no-armbianEnv.txt boot path uses the correct root
device.
config/sources/families/qrb2210.conf (1)

38-50: ⚠️ Potential issue | 🟠 Major

Remove hardcoded branch path and verify mkbootimg before execution.

Line 38 hardcodes qcom-mainline despite configurable BOOTBRANCH, and Lines 49-50 execute a downloaded binary without checksum/signature verification.

Suggested hardening/refactor
 function uboot_custom_postprocess() {
-	run_host_command_logged cd "$SRC"/cache/sources/u-boot-worktree/u-boot/qcom-mainline
 	run_host_command_logged rm -f u-boot-nodtb.bin.gz u-boot-nodtb.bin.gz-dtb empty-ramdisk boot.img mkbootimg
 	run_host_command_logged gzip u-boot-nodtb.bin
@@
-    run_host_command_logged wget https://launchpadlibrarian.net/810765814/mkbootimg
+    local mkbootimg_url="https://launchpadlibrarian.net/810765814/mkbootimg"
+    local mkbootimg_sha256="<pin-known-sha256-here>"
+    run_host_command_logged wget "${mkbootimg_url}" -O mkbootimg
+    run_host_command_logged bash -c "echo '${mkbootimg_sha256}  mkbootimg' | sha256sum -c -"
     run_host_command_logged chmod +x mkbootimg
#!/bin/bash
# Verify the two concerns in current tree:
# 1) hardcoded qcom-mainline path
# 2) missing checksum verification for mkbootimg
rg -n 'qcom-mainline|mkbootimg|sha256sum|sha256' config/sources/families/qrb2210.conf -C 2
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/sources/families/qrb2210.conf` around lines 38 - 50, The script
hardcodes the branch directory and runs an unverified binary: replace the
literal "qcom-mainline" in the run_host_command_logged cd command with the
configurable BOOTBRANCH variable (so the cd uses
"$SRC/.../u-boot/${BOOTBRANCH}") and keep BOOT_FDT_FILE usage as-is; for
mkbootimg, download and verify its integrity before making it executable by
adding a verification step (e.g., fetch an expected sha256 or signature
alongside mkbootimg, validate the downloaded file with sha256sum --check or
signature verification, and only then run_host_command_logged chmod +x mkbootimg
and subsequent execution), updating the run_host_command_logged wget/chmod
sequence accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@config/bootscripts/boot-qrb2210.cmd`:
- Line 20: The fallback root device currently set by the setenv rootdev
assignment uses /dev/mmcblk0p1 which is incorrect for this layout; update the
setenv rootdev value in boot-qrb2210.cmd (the setenv rootdev line) to point to
the actual rootfs partition (/dev/mmcblk0p68) so the no-armbianEnv.txt boot path
uses the correct root device.

In `@config/sources/families/qrb2210.conf`:
- Around line 38-50: The script hardcodes the branch directory and runs an
unverified binary: replace the literal "qcom-mainline" in the
run_host_command_logged cd command with the configurable BOOTBRANCH variable (so
the cd uses "$SRC/.../u-boot/${BOOTBRANCH}") and keep BOOT_FDT_FILE usage as-is;
for mkbootimg, download and verify its integrity before making it executable by
adding a verification step (e.g., fetch an expected sha256 or signature
alongside mkbootimg, validate the downloaded file with sha256sum --check or
signature verification, and only then run_host_command_logged chmod +x mkbootimg
and subsequent execution), updating the run_host_command_logged wget/chmod
sequence accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b8cb3bf-fa07-44e1-a149-a1aa22f21d56

📥 Commits

Reviewing files that changed from the base of the PR and between e51a066 and e075d19.

📒 Files selected for processing (4)
  • config/boards/arduino-uno-q.csc
  • config/bootenv/qrb2210.txt
  • config/bootscripts/boot-qrb2210.cmd
  • config/sources/families/qrb2210.conf
✅ Files skipped from review due to trivial changes (1)
  • config/bootenv/qrb2210.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/boards/arduino-uno-q.csc

@EvilOlaf
Copy link
Copy Markdown
Member

EvilOlaf commented Apr 2, 2026

Just curios. Why was btf disabled?

@SuperKali
Copy link
Copy Markdown
Member Author

Honestly not sure, it was already there in the original bring-up from chainsx. Probably to avoid build failures on hosts with limited RAM since BTF compilation is memory-hungry. I can remove it if you think it should be enabled.

@EvilOlaf
Copy link
Copy Markdown
Member

EvilOlaf commented Apr 2, 2026

Perhaps for the sake of consistency I'd enable it but literally no other reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release BSP Board Support Packages Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

5 participants