Fw_setenv during torizoncore-builder build

Hi,
is there any way to use fw_setenv when using the torizoncore-builder build command?
I want to change the graphics output e.g. fw_setenv tdxargs video=HDMI-A-2:1920x1080M@60

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Yes, you can modify U-Boot environment variables when using TorizonCore Builder, but not through fw_setenv directly. Instead, TorizonCore Builder provides the kernel command to handle custom kernel arguments(1).

Using TorizonCore Builder for Kernel Arguments

Command Line Approach

You can set custom kernel arguments using the kernel set_custom_args command(1):

$ torizoncore-builder kernel set_custom_args "video=HDMI-A-2:1920x1080M@60"

(1)

This will output:

Kernel custom arguments successfully configured with "video=HDMI-A-2:1920x1080M@60".

(1)

Configuration File Approach

When using the build command with a configuration file, you can specify kernel arguments in the customization section(2):

customization:
  kernel:
    arguments:
      - "video=HDMI-A-2:1920x1080M@60"

(2)

Important Implementation Details

How Arguments Are Applied

The method TorizonCore Builder uses to pass custom arguments varies depending on your image version(1):

  • Torizon OS 7.5.0 or later: Arguments are passed via environment variables stored in uEnv.txt loaded by U-Boot(1)
  • Older images (prior to 7.5.0): Custom arguments are stored in an overlay called custom-kargs_overlay(1)

Secure Boot Considerations

If your image has Kernel command-line protection enabled, custom arguments are prepended to the original arguments rather than appended(1). This may prevent you from overriding default kernel arguments, and you’ll need to re-sign the kernel using secboot sign-kernel after making changes(1).

Alternative: Direct fw_setenv Usage

If you need to use fw_setenv directly on a running device, you can do so after deployment(3). The commands must be executed as root(3):

# fw_setenv tdxargs "video=HDMI-A-2:1920x1080M@60"

(3)

However, using TorizonCore Builder’s kernel command is the recommended approach for image customization as it integrates properly with the build process.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.