Genio: Deprecate EFI/Grub in favor of proper uboot flow
Description
This PR allows boards like the radxa-nio-12l to utilise a faster and more compact boot flow.
Since Grub cannot apply device tree overlays this also allows for that too. For example to make use of MIPI displays or set the ram configuration for the board (overlays for ram configuration will follow in a PR soon) as on the mediatek platform that is done in the device tree and the upstream device tree is set for 4gb on Nio-12L (while there are 8 / 16 GB variants as well).
Tests
- [x] Boot Radxa-Nio-12L
- [x] Enable Overlay in /boot/armbianEnv.txt and check that it works
Summary by CodeRabbit
Release Notes
- Chores
- Updated board-specific boot configurations and serial console settings for Radxa Nio 12L
- Added new boot environment configuration with improved initialization parameters
- Implemented enhanced boot process with improved device tree handling and boot parameter management
✏️ Tip: You can customize this high-level summary in your review settings.
Walkthrough
Adds U-Boot bootscript and bootenv for Genio family, shifts family config from GRUB/UEFI to bootscript-based variables, and updates Radxa NIO‑12L board config to set a serial console and declare a global firmware install flag while removing GRUB-with-DTB enablement and two post-config functions.
Changes
| Cohort / File(s) | Summary |
|---|---|
Radxa NIO‑12L board config config/boards/radxa-nio-12l.conf |
Removed enable_extension "grub-with-dtb"; declared global SERIALCON="ttyS0:921600" and BOARD_FIRMWARE_INSTALL="-full"; removed post_family_config__nio12l_vendor_setup and post_family_config__nio12l_collabora_setup. |
Genio boot environment config/bootenv/genio.txt |
New boot environment template with verbosity=1, bootlogo=false, and console=both. |
Genio U‑Boot bootscript config/bootscripts/boot-genio.cmd |
New U-Boot bootscript that initializes boot vars, detects PARTUUID (fallback to LABEL), imports armbianEnv.txt if present, constructs bootargs, loads kernel/initramfs/DTB, applies kernel and user DT overlays with error handling and DT restore/fixups, then boots. |
Genio family config config/sources/families/genio.conf |
Removed GRUB/UEFI-related options; added BOOTSCRIPT referencing boot-genio.cmd and BOOTENV_FILE="genio.txt"; overall shift from GRUB to bootscript-driven configuration. |
Sequence Diagram(s)
sequenceDiagram
actor UBoot as U-Boot
participant Storage as Boot Storage (MMC/USB)
participant Env as armbianEnv.txt / Env
participant Kernel as Kernel & Initramfs
participant FDT as Device Tree / Overlays
UBoot->>Env: set defaults (rootdev, verbosity, console, bootlogo, earlycon)
UBoot->>Storage: probe boot device, read PARTUUID
alt PARTUUID found
UBoot->>Env: set rootdev=PARTUUID=...
else
UBoot->>Env: use LABEL rootdev
end
UBoot->>Storage: attempt load armbianEnv.txt
alt env present
UBoot->>Env: import overrides
else
UBoot->>Env: keep defaults
end
UBoot->>Kernel: load kernel image
UBoot->>Kernel: load initramfs (if present)
UBoot->>FDT: load base DTB
UBoot->>FDT: apply kernel-provided overlays
alt overlay application fails
UBoot->>FDT: restore original DTB
end
UBoot->>FDT: apply user DT fixups (if any)
UBoot->>UBoot: assemble bootargs (console, verbosity, earlycon, docker opts, quirks)
UBoot->>Kernel: boot kernel with initramfs and final DTB
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
- Attention points:
config/bootscripts/boot-genio.cmd: control flow for PARTUUID detection, env import fallback, overlay error handling, DT restore/fixups.- Cross-check
config/sources/families/genio.confvariable names (BOOTSCRIPT,BOOTENV_FILE) match bootscript and bootenv file. config/boards/radxa-nio-12l.conf: globalizingBOARD_FIRMWARE_INSTALLandSERIALCONchanges expected behavior across build paths; verify no unintended side effects from removed post-config functions.
Possibly related PRs
- armbian/build#8272 — Overlaps on U-Boot bootscript and env handling (boot-genio.cmd-style logic and overlay application).
- armbian/build#8006 — Changes to Genio family and Radxa NIO‑12L configurations (bootenv/bootscript and related variables).
- armbian/build#8668 — Modifies board/family variables like
BOARD_FIRMWARE_INSTALLandSERIALCONand GRUB enablement patterns.
Suggested labels
Framework
Suggested reviewers
- rpardini
- igorpecovnik
Poem
🐰 I hopped through scripts and DTBs bright,
PARTUUIDs found by moonlit night,
Envvars set, overlays applied,
From GRUB to U‑Boot I proudly glide,
Genio boots now — what a sight! 🥕✨
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately summarizes the primary change: migrating from EFI/GRUB boot flow to U-Boot for Genio boards, matching the file changes and PR objectives. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
@djurny Can we make use of boot script templating here?
@djurny Can we make use of boot script templating here?
Hi @igorpecovnik @HeyMeco ,
The current generic bootscript does not have the rootdev determination, which is a cool thing to have!
I'm currently trying to have Helios4 use the generic bootscript and found some adjustments are already needed. I'll add this detection to the generic bootscript as well.
The remainder of the bootscript seems to be something that the generic bootscript can handle.
In short, we cannot make use of the generic bootscript in this case yet.
Groetjes,
While we're at it. I think we should add more logging / comments to the generic boot script. It took me quite a while to figure everything out as someone who hadn't looked into this aspect of u-boot prior.
Please have a look at the inline comments.
Thanks for the extensive feedback. Will update this PR
@djurny Would appreciate your feedback on the comment addressed variant now :)
✅ Functionality is validated on hardware therefore squash mergeable from my perspective
@igorpecovnik this is ready to be approved for merge now