Skip to content

Conversation

@HeyMeco
Copy link
Collaborator

@HeyMeco HeyMeco commented Dec 7, 2025

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

  • Boot Radxa-Nio-12L
    • 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.

@HeyMeco HeyMeco requested a review from igorpecovnik as a code owner December 7, 2025 21:49
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 2025

Walkthrough

This PR introduces U-Boot bootscript infrastructure for Genio boards. It adds a boot-genio.cmd bootscript implementing kernel/DTB/overlay loading, environment variable handling, and PARTUUID detection. Boot environment configuration is added alongside updates to the Genio family variables. Radxa NIO-12L configuration is modified to remove GRUB DTB extension and add serial console settings.

Changes

Cohort / File(s) Summary
Radxa NIO-12L board config
config/boards/radxa-nio-12l.conf
Removed GRUB with DTB extension enablement; added serial console configuration (SERIALCON="ttyS0:921600").
Genio boot environment
config/bootenv/genio.txt
New file: boot environment configuration with verbosity=1, bootlogo=false, console=both.
Genio U-Boot bootscript
config/bootscripts/boot-genio.cmd
New file: U-Boot boot script handling PARTUUID detection, environment variable initialization and loading (armbianEnv.txt override), kernel/initramfs/DTB loading, device tree overlay application with error fallback, and final kernel boot assembly.
Genio family config
config/sources/families/genio.conf
Added BOOTSCRIPT="boot-genio.cmd:boot.cmd" and BOOTENV_FILE="genio.txt"; updated GRUB_CMDLINE_LINUX_DEFAULT to prepend console=tty1.

Sequence Diagram

sequenceDiagram
    participant U-Boot as U-Boot Bootloader
    participant Storage as Boot Storage
    participant Env as Environment
    participant Kernel as Kernel/Initramfs
    participant DevTree as Device Tree
    
    U-Boot->>Env: Initialize default boot vars<br/>(rootdev, verbosity, console, bootlogo)
    U-Boot->>Storage: Detect PARTUUID from<br/>mmc/scsi device
    alt PARTUUID found
        U-Boot->>Env: Set rootdev to PARTUUID
    else PARTUUID not found
        U-Boot->>Env: Use LABEL rootdev fallback
    end
    
    U-Boot->>Storage: Load armbianEnv.txt
    alt Load successful
        U-Boot->>Env: Import & override vars
    else Load failed
        U-Boot->>U-Boot: Retain defaults,<br/>emit fallback message
    end
    
    U-Boot->>Kernel: Load kernel image
    U-Boot->>Kernel: Load initramfs
    U-Boot->>DevTree: Load device tree (fdt)
    
    U-Boot->>DevTree: Apply kernel-provided<br/>DT overlays
    alt Overlay error
        U-Boot->>DevTree: Restore original DT
    end
    
    U-Boot->>DevTree: Apply user DT fixups
    U-Boot->>U-Boot: Aggregate bootargs<br/>(console, splash/verbose,<br/>earlycon, docker cgroups)
    U-Boot->>U-Boot: Execute kaslrseed
    U-Boot->>Kernel: Boot with kernel,<br/>initramfs, DTB
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • boot-genio.cmd: New 100+ line bootscript with conditional PARTUUID detection, environment loading fallback logic, overlay error handling, and boot sequence orchestration—requires careful review of control flow and error paths.
  • genio.conf: New exported variables (BOOTSCRIPT, BOOTENV_FILE) must be cross-verified with bootscript and environment file references.
  • Interrelated configuration: Changes across board, family, bootenv, and bootscript files require understanding of their dependency chain; serial console configuration on Radxa NIO-12L requires context for validation.

Possibly related PRs

Suggested labels

Framework

Suggested reviewers

  • igorpecovnik
  • rpardini
  • amazingfate

Poem

🐰 A hop through boot sequences divine,
With overlays and DTBs aligned,
Genio now runs with grace so fine,
PARTUUID paths and fallbacks align,
From GRUB to U-Boot, the transition's mine!

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 reflects the main change: transitioning Genio boards from EFI/GRUB to a U-Boot bootflow, which is the core objective across all modified files.
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.

❤️ Share

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

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines 02 Milestone: First quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Dec 7, 2025
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 (1)
config/bootscripts/boot-genio.cmd (1)

110-111: TODO comment about kaslrseed failures.

The script documents that kaslrseed fails on many devices where CONFIG_CMD_KASLRSEED is not enabled. While the current approach (try it anyway with a warning) is pragmatic, consider these options for future improvement:

  1. Add a U-Boot environment variable to conditionally skip kaslrseed
  2. Work with U-Boot maintainers to enable CONFIG_CMD_KASLRSEED in the default U-Boot configuration for Genio boards
  3. Remove the command if KASLR is not actually needed/used on these boards

Would you like me to open an issue to track improving the kaslrseed handling?

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira 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 f9cf9ae and 3769e73.

📒 Files selected for processing (4)
  • config/boards/radxa-nio-12l.conf (1 hunks)
  • config/bootenv/genio.txt (1 hunks)
  • config/bootscripts/boot-genio.cmd (1 hunks)
  • config/sources/families/genio.conf (1 hunks)
🧰 Additional context used
🧠 Learnings (34)
📓 Common learnings
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:222-230
Timestamp: 2025-09-14T06:32:29.806Z
Learning: In the Armbian build system, the write_uboot_platform() function implementations follow different patterns across Rockchip family files. The newer standard (used in rockchip64_common.inc and rk3506) includes 'status=none' parameter in dd commands, while older implementations (rk3288, rk322x) use an older pattern without this parameter. The rk3506 implementation correctly follows the current Rockchip family standard.
Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: rpardini
Repo: armbian/build PR: 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.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the `${cpu}` environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.
📚 Learning: 2025-07-13T14:00:39.402Z
Learnt from: djurny
Repo: armbian/build PR: 8315
File: config/bootscripts/boot-generic.cmd.template:62-62
Timestamp: 2025-07-13T14:00:39.402Z
Learning: In U-Boot bootscripts, the verbosity check pattern `test "${verbosity}" = "" || itest ${verbosity} -gt 0 && echo "${l_message}"` correctly implements quiet behavior when verbosity is unset or "0", and verbose behavior when verbosity > 0, due to proper operator precedence where || has lower precedence than &&.

Applied to files:

  • config/bootenv/genio.txt
📚 Learning: 2025-11-02T20:49:56.719Z
Learnt from: igorpecovnik
Repo: armbian/build PR: 8849
File: config/boards/radxa-e54c.csc:14-28
Timestamp: 2025-11-02T20:49:56.719Z
Learning: In Armbian board configuration files (config/boards/*.conf, *.csc, etc.), do not use kernel_config_set, kernel_config_set_m, kernel_config_set_y, or custom_kernel_config__* functions to modify kernel configuration. Kernel configuration is associated with LINUXFAMILY/BOARDFAMILY, not individual BOARD. Board-specific kernel modifications cause inconsistency in kernel packages published to the apt repository because boards within a family share the same kernel packages. Kernel configuration changes must be made in the appropriate kernel config file (e.g., config/kernel/linux-*-*.config) or in family configuration files (config/sources/families/*.conf, *.inc) instead.

Applied to files:

  • config/boards/radxa-nio-12l.conf
  • config/sources/families/genio.conf
📚 Learning: 2025-11-15T14:33:30.654Z
Learnt from: SuperKali
Repo: armbian/build PR: 8936
File: patch/kernel/archive/rockchip64-6.18/dt/rk3576-nanopi-r76s.dts:800-802
Timestamp: 2025-11-15T14:33:30.654Z
Learning: In RK3576 device tree files (like rk3576-nanopi-r76s.dts), the serial0 alias is already defined in the upstream kernel's rk3576.dtsi base file, so board-specific DTS files do not need to redeclare it when enabling &uart0 for serial console.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-09-18T03:36:17.862Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.862Z
Learning: In Armbian board configuration files (regardless of file extension), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features. The file extensions indicate board support status: .conf (standard support), .csc (community supported), .eos (end of support), .tvb (tvbox), .wip (work in progress).

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-07-17T04:12:33.125Z
Learnt from: pyavitz
Repo: armbian/build PR: 8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.125Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.

Applied to files:

  • config/boards/radxa-nio-12l.conf
  • config/sources/families/genio.conf
  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-08-30T04:13:16.457Z
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-30T04:13:16.457Z
Learning: Armbian kernel configuration files like linux-filogic-current.config are autogenerated overlays on top of arch defconfig. Comments added manually will be lost during future updates by maintainers, and explicit "CONFIG_OPTION is not set" statements aren't needed for mutually exclusive options since these are overlay configs that only specify changes from the base configuration.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-10-05T19:31:16.930Z
Learnt from: rpardini
Repo: armbian/build PR: 8718
File: config/boards/thinkpad-x13s.conf:185-185
Timestamp: 2025-10-05T19:31:16.930Z
Learning: In config/boards/thinkpad-x13s.conf, the x13s_obtain_firmware() function is reference-only utility code that never runs. It is kept for documentation purposes. Updates to firmware must be done at the armbian/firmware repository. TODO comments in this function are intentional reminders and should not be flagged.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-09-18T03:36:17.862Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8537
File: config/boards/qcom-robotics-rb5.conf:1-1
Timestamp: 2025-09-18T03:36:17.862Z
Learning: In Armbian board configuration files, .wip and .conf extensions require BOARD_MAINTAINER to be present and contain at least one maintainer. If no maintainer is present, the board support rules state it does not qualify for standard support and must be moved to community support (.csc extension). This is documented at https://docs.armbian.com/User-Guide_Board-Support-Rules/

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-09-14T06:29:18.958Z
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:64-70
Timestamp: 2025-09-14T06:29:18.958Z
Learning: In the Armbian build system, vendor branch configurations in family files are designed to be shared across multiple SoCs within the same family that use the same vendor kernel tree. For example, rk35xx and rockchip-rk3588 families both use identical vendor branch settings (same KERNELSOURCE, KERNELBRANCH, and KERNELPATCHDIR), demonstrating that vendor branches are intentionally generic rather than SoC-specific.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-10-26T10:41:35.118Z
Learnt from: HackingGate
Repo: armbian/build PR: 8665
File: config/boards/photonicat2.csc:4-4
Timestamp: 2025-10-26T10:41:35.118Z
Learning: In the Armbian build system, rk3576 boards consistently use BOARDFAMILY="rk35xx" for both vendor and edge kernel targets. The rk35xx family configuration sources rockchip64_common.inc, which provides edge and current kernel branch definitions, making these branches available even though they're not defined directly in rk35xx.conf.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-11-10T22:05:40.490Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8913
File: config/sources/families/k3-beagle.conf:16-16
Timestamp: 2025-11-10T22:05:40.490Z
Learning: In the Armbian build system, kernel branches using non-mainline/vendor forks (like BeagleBoard's linux repository) should be named "vendor" or "vendor-rt" rather than "current" or "edge". The "current" and "edge" naming is reserved for mainline kernel branches. This affects both the case statement in family config files (e.g., `vendor | vendor-rt)` instead of `current | current-rt)`) and the corresponding KERNEL_TARGET declarations in board config files.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-10-14T05:08:11.785Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8754
File: config/boards/bestv-r3300-l.csc:14-16
Timestamp: 2025-10-14T05:08:11.785Z
Learning: In the Armbian build system, BOOTBRANCH_BOARD is a valid framework variable used as a fallback when BOOTBRANCH is unset. The framework checks BOOTBRANCH_BOARD before applying the default bootloader branch value (see config/sources/common.conf). Board configuration files can use BOOTBRANCH_BOARD to specify the bootloader branch.

Applied to files:

  • config/boards/radxa-nio-12l.conf
  • config/sources/families/genio.conf
📚 Learning: 2025-10-26T12:56:29.185Z
Learnt from: rpardini
Repo: armbian/build PR: 8820
File: config/sources/families/include/meson64_common.inc:51-53
Timestamp: 2025-10-26T12:56:29.185Z
Learning: In the Armbian build framework, scripts/config correctly handles kernel configuration option names both with and without the CONFIG_ prefix, so opts_m+=("CONFIG_RTL8822CS") and opts_m+=("RTL8822CS") are both valid and will work correctly.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-08-02T05:46:10.664Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-02T05:46:10.664Z
Learning: In the Armbian build system, the modern recommended approach for kernel configuration is to use the kernel-config command via "./compile.sh BOARD=boardname BRANCH=branchname kernel-config" instead of the deprecated KERNEL_CONFIGURE=yes flag. This provides a two-step workflow: configure using menuconfig, then build, with better transparency and control over configuration changes.

Applied to files:

  • config/boards/radxa-nio-12l.conf
  • config/sources/families/genio.conf
📚 Learning: 2025-06-25T03:42:09.086Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-06-04T23:45:38.860Z
Learnt from: djurny
Repo: armbian/build PR: 8272
File: config/bootscripts/boot-mvebu.cmd:182-186
Timestamp: 2025-06-04T23:45:38.860Z
Learning: In config/bootscripts/boot-mvebu.cmd, the `fdtfile` variable is mandatory for booting and is pre-set by U-Boot, but can be overridden via armbianEnv.txt. If `fdtfile` is empty, the subsequent device tree file search logic will eventually fail and trigger the critical error "Cannot find DT!" with proper error handling.

Applied to files:

  • config/boards/radxa-nio-12l.conf
  • config/sources/families/genio.conf
  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-11-08T06:39:24.527Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8886
File: patch/kernel/rk35xx-vendor-6.1/dt/rk3528-nanopi-rev01.dts:9-9
Timestamp: 2025-11-08T06:39:24.527Z
Learning: In Armbian's Rockchip vendor kernel branches (rk35xx-vendor), device tree files may not require the same headers as mainline Linux. For example, input key definitions like KEY_BACK and KEY_VOLUMEUP may be handled differently in BSP kernels and don't necessarily need explicit includes like <dt-bindings/input/input.h> that would be required in mainline kernel device trees.

Applied to files:

  • config/boards/radxa-nio-12l.conf
📚 Learning: 2025-09-12T19:28:38.491Z
Learnt from: Grippy98
Repo: armbian/build PR: 8622
File: config/sources/families/k3.conf:66-66
Timestamp: 2025-09-12T19:28:38.491Z
Learning: In the Armbian k3 family build system (config/sources/families/k3.conf), builds do not fail when TIBOOT3_BOOTCONFIG is unset, even though tiboot3.bin is still listed in UBOOT_TARGET_MAP. The gating mechanism in pre_config_uboot_target__build_first_stage function works as intended to conditionally build/copy tiboot3.bin only when TIBOOT3_BOOTCONFIG is defined.

Applied to files:

  • config/sources/families/genio.conf
  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-05-05T12:35:07.143Z
Learnt from: Grippy98
Repo: armbian/build PR: 8152
File: lib/functions/configuration/interactive.sh:209-266
Timestamp: 2025-05-05T12:35:07.143Z
Learning: For the interactive kernel selection in Armbian, KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION are parsed from family.conf but deliberately not set as environment variables to avoid potential interference with other parts of the build system.

Applied to files:

  • config/sources/families/genio.conf
📚 Learning: 2025-05-16T15:34:34.672Z
Learnt from: Grippy98
Repo: armbian/build PR: 8202
File: config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh:2-3
Timestamp: 2025-05-16T15:34:34.672Z
Learning: The shell scripts in the Armbian build system's desktop configuration files, such as config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh, rely on environment variables like $SRC and $destination that are expected to be set externally before the script is executed.

Applied to files:

  • config/sources/families/genio.conf
📚 Learning: 2025-09-07T17:39:32.272Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8586
File: config/boards/nanopi-r76s.conf:15-21
Timestamp: 2025-09-07T17:39:32.272Z
Learning: In the Armbian build system, the variables $BOARD and $SDCARD are always set by the build framework, so guard checks for these variables are unnecessary in board configuration files and hook functions.

Applied to files:

  • config/sources/families/genio.conf
📚 Learning: 2025-07-27T15:53:30.629Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:805-825
Timestamp: 2025-07-27T15:53:30.629Z
Learning: In the Armbian build system, kernel configurations prioritize broad hardware compatibility over optimization concerns. Even when including numerous legacy/obsolete drivers causes technical issues like increased initramfs size and slower enumeration, the project philosophy is to "appease the masses" by ensuring maximum device compatibility rather than optimizing for specific use cases.

Applied to files:

  • config/sources/families/genio.conf
📚 Learning: 2025-06-12T21:03:39.686Z
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the `${cpu}` environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.

Applied to files:

  • config/sources/families/genio.conf
  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-06-12T21:14:36.024Z
Learnt from: djurny
Repo: armbian/build PR: 8287
File: config/bootscripts/boot-sunxi.cmd:38-44
Timestamp: 2025-06-12T21:14:36.024Z
Learning: In config/bootscripts/boot-sunxi.cmd the unconditional "+1" increment in func_align_addr_next (when align_overlap_oboe_avoidance="on") is intentional. It compensates for a known off-by-one error in U-Boot where the end address is calculated as start+size instead of start+size-1, so the extra page prevents overlap. This behavior should not be “optimized away”.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-01T06:11:43.476Z
Learnt from: wei633
Repo: armbian/build PR: 8557
File: config/bootscripts/boot-xpressreal-t3.cmd:0-0
Timestamp: 2025-09-01T06:11:43.476Z
Learning: In Armbian boot scripts without initramfs support, UUID= and LABEL= style device paths cannot be used for rootdev as they require initramfs to resolve during boot. Only direct device paths (/dev/mmcblkXpY) or PARTUUID= references (which U-Boot can resolve) will work.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-27T21:50:04.845Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8678
File: config/kernel/linux-sm8250-edge.config:80-82
Timestamp: 2025-09-27T21:50:04.845Z
Learning: In the Armbian build system, kernel configuration files are generated through this automated process: taking previous config → applying scripted changes from armbian-kernel.sh → running kernel's `make oldconfig` → processing by Armbian machinery back into config files. This automated process properly handles kernel configuration dependencies and reduces the likelihood of manual configuration errors.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-27T21:49:55.796Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8678
File: config/kernel/linux-sm8250-current.config:78-80
Timestamp: 2025-09-27T21:49:55.796Z
Learning: In the Armbian build system, kernel configuration files are generated through an automated process: taking previous config → applying scripted changes from armbian-kernel.sh → running kernel's `make oldconfig` → processing by Armbian machinery back into config files. This automated process properly handles kernel configuration dependencies and reduces the likelihood of manual configuration errors.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-27T21:47:58.020Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8678
File: config/kernel/linux-bcm2711-edge.config:859-861
Timestamp: 2025-09-27T21:47:58.020Z
Learning: In the Armbian build system, kernel configuration files in config/kernel/ are generated through an automated process: taking previous config → applying scripted changes from armbian-kernel.sh → running kernel's `make oldconfig` → processing by Armbian machinery back into config files. This automated process properly handles kernel configuration dependencies and reduces the likelihood of manual configuration errors.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-14T06:32:29.806Z
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/sources/families/rockchip.conf:222-230
Timestamp: 2025-09-14T06:32:29.806Z
Learning: In the Armbian build system, the write_uboot_platform() function implementations follow different patterns across Rockchip family files. The newer standard (used in rockchip64_common.inc and rk3506) includes 'status=none' parameter in dd commands, while older implementations (rk3288, rk322x) use an older pattern without this parameter. The rk3506 implementation correctly follows the current Rockchip family standard.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-12T15:46:16.772Z
Learnt from: amazingfate
Repo: armbian/build PR: 8619
File: config/bootscripts/boot-rk3506.cmd:46-47
Timestamp: 2025-09-12T15:46:16.772Z
Learning: In Armbian boot scripts, uInitrd is always packaged by the build system, so unconditional loading of uInitrd without existence checks is acceptable and won't cause boot failures.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-12T21:44:09.061Z
Learnt from: Grippy98
Repo: armbian/build PR: 8624
File: config/boards/sk-am62p.conf:8-8
Timestamp: 2025-09-12T21:44:09.061Z
Learning: For TI K3 family boards in Armbian, BOOT_FDT_FILE uses .dts extension (not .dtb) as the standard convention. The build system handles this correctly by automatically compiling .dts to .dtb during kernel build and using the BOOT_FDT_FILE value directly in bootloader configurations.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-07-23T07:30:52.265Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8417
File: config/boards/orangepi5pro.csc:57-58
Timestamp: 2025-07-23T07:30:52.265Z
Learning: In the Armbian build system, BOOTPATCHDIR can contain board-specific subdirectories (e.g., board_orangepi5pro) for applying patches to specific boards only. The framework automatically checks if such board-specific subdirectories exist for the board being built and applies those patches accordingly.

Applied to files:

  • config/bootscripts/boot-genio.cmd
📚 Learning: 2025-09-01T06:12:19.251Z
Learnt from: wei633
Repo: armbian/build PR: 8557
File: config/bootscripts/boot-xpressreal-t3.cmd:49-53
Timestamp: 2025-09-01T06:12:19.251Z
Learning: For XpressReal T3 (Realtek RTD1619B platform), initramfs support is intentionally not implemented in the boot script due to known problems when booting with initramfs. This needs to be fixed in a future update.

Applied to files:

  • config/bootscripts/boot-genio.cmd
🔇 Additional comments (11)
config/boards/radxa-nio-12l.conf (1)

8-8: LGTM! Serial console configuration aligns with U-Boot bootscript.

The serial console setting matches the console configuration used in the new boot-genio.cmd bootscript (ttyS0,921600), ensuring consistent serial console behavior across the boot flow.

config/bootenv/genio.txt (1)

1-5: LGTM! Sensible boot environment defaults.

The default values are appropriate:

  • verbosity=1 enables boot messages for troubleshooting
  • bootlogo=false keeps boot output visible
  • console=both enables both serial and display output

These can be overridden via /boot/armbianEnv.txt as documented in the bootscript.

config/sources/families/genio.conf (2)

7-10: LGTM! U-Boot bootscript configuration is correct.

The configuration properly sets up the custom boot flow:

  • BOOTCONFIG="none" correctly skips U-Boot compilation (appropriate for boards with firmware-provided U-Boot)
  • BOOTSCRIPT and BOOTENV_FILE correctly reference the new boot infrastructure
  • Comment explains the compatibility constraint (no itest/setexpr/bootz)

12-19: Clarify the retention strategy for legacy GRUB configuration.

The GRUB/UEFI configuration is marked as "legacy, may be removed" but is still present. Since the PR objectives state this change "deprecates EFI/Grub in favor of proper uboot flow," please clarify:

  1. Is this kept for backward compatibility during a transition period?
  2. Should it be removed in this PR or a future one?
  3. Could having both configurations cause conflicts or confusion for users?

Consider either removing it now (if not needed) or updating the comment to explicitly state the retention reason and timeline (e.g., "kept for backward compatibility until version X.X").

config/bootscripts/boot-genio.cmd (7)

1-18: LGTM! Environment initialization is well-structured.

The bootscript header clearly directs users to edit armbianEnv.txt instead of the script itself. Default environment variables are sensible, and the load address (0x43000000) is properly documented to avoid memory conflicts with kernel, initramfs, and DTB.


24-36: LGTM! PARTUUID detection with proper fallback.

The detection logic correctly handles both mmc and scsi device types, preferring PARTUUID (more reliable) over LABEL fallback. Echo statements provide good boot-time diagnostics.


38-50: LGTM! ArmbianEnv.txt loading with robust error handling.

The script correctly loads and imports armbianEnv.txt using a compatibility-focused approach (direct load instead of test -e). The ordering after PARTUUID detection allows users to override rootdev, and fallback messaging provides clear feedback when the file is absent.


54-69: LGTM! Console configuration and bootargs construction are correct.

The console configuration logic properly handles all modes (serial, display, both). When console=both, the resulting order makes tty1 the primary console with ttyS0 as secondary, which is appropriate for a board with display output. Bootargs construction includes all necessary parameters (root device, console, Docker optimizations, etc.).


71-78: LGTM! Kernel, initramfs, and DTB loading is correct.

The script loads the kernel, initramfs, and device tree without existence checks, which is appropriate since these files are guaranteed to be present in a properly built image. The fdt resize 65536 correctly allocates space for overlay application.


79-108: LGTM! Overlay loading with excellent error handling.

The overlay application logic is well-designed:

  • Attempts kernel-provided overlays (with and without prefix) before user overlays
  • Sets overlay_error flag on failure and restores the original DTB as a safe fallback
  • Only applies fixup scripts when overlays succeed
  • Provides clear feedback via echo statements

This robust error handling prevents boot failures from malformed overlays.


113-117: LGTM! Boot command and recompile instructions are correct.

The booti command properly boots the kernel with the assembled addresses for kernel, initramfs, and DTB. The recompile instructions are helpful for users who need to modify the bootscript.

@igorpecovnik
Copy link
Member

@djurny Can we make use of boot script templating here?

@djurny
Copy link
Contributor

djurny commented Dec 8, 2025

@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,

@HeyMeco
Copy link
Collaborator Author

HeyMeco commented Dec 8, 2025

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.

@HeyMeco HeyMeco requested review from djurny and rpardini December 8, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

3 participants