WKS_FILE:k3 in verdin-am62.conf is overriden with hard assignment

Board: Verdin AM62 on Mallow Carrier
BSP: meta-toradex-ti, Scarthgap
Yocto release: Scarthgap

TDX-info

## Software summary
## Bootloader:               U-Boot
Kernel version:           6.6.119-7.2.0-devel #1 SMP PREEMPT Mon Feb  2 10:44:22 UTC 2026
Kernel command line:      root=PARTUUID=076c4a2a-02 ro rootwait console=tty1 console=ttyS2,115200
Distro name:              NAME=“TDX Wayland with XWayland”
Distro version:           VERSION_ID=7.2.0-devel-20251204100250-build.0
Distro variant:           -
Hostname:                 verdin-am62-15599560

## Hardware info
## HW model:                 Toradex Verdin AM62 WB on Verdin Development Board
Toradex version:          0072 V1.2A
Serial number:            15599560
Processor arch:           aarch64

For context:
I am working on a custom build and for that specific purpose I want to edit the way the .wic is generated, specifically I need multiple partitions for setting up RAUC with A/B partitions.

While trying to do this, I read I could add a wic directory under my layer like so:

developer@sparkDev:~/System/SparkSystem/layers/meta-spark/wic$ ls -alh
total 12K
drwxr-xr-x  2 developer developer 4.0K Feb 19 11:56 .
drwxr-xr-x 13 developer developer 4.0K Feb 19 11:55 ..
-rw-r--r--  1 developer developer 1.1K Feb 19 11:56 platform.wks
developer@sparkDev:~/System/SparkSystem/layers/meta-spark/wic$ readlink -f ./
/home/developer/System/SparkSystem/layers/meta-spark/wic
developer@sparkDev:~/System/SparkSystem/layers/meta-spark/wic$

added the following to my local.conf after MACHINE include:

WKS_FILE:k3 = "platform.wks"

I can make it work by setting it to

WKS_FILE:forcevariable = "platform.wks"

I have done some digging and I am not sure if this is intended or A bug, and as far as I tried to find i don’t see any info on your manual pages.

But I have done some digging and see this in /home/developer/System/SparkSystem/layers/meta-toradex-ti/conf/machine/verdin-am62.conf:
WKS_FILE:k3 = “sdimage-2part.wks”

This is a hard assign ‘=’ wouldn’t a ‘?=’ be a better option that would allow for downstream assignment in custom setups.

the layer meta-toradex-ti that I am using is at dbf615d3235f5d83ce7262b57a4f38e133a9b7c8

I found this commit that talks about removing “hacky” implementation, maybe something has not gone wholly right.

commit 46431b28772c22a669ce204ea62c135c4e396221
Author: Max Krummenacher <max.krummenacher@toradex.com>
Date:   Wed May 17 13:52:40 2023 +0200

    verdin-am62: remove hackish adaption of meta-ti
    
    Now that we build our own machine verdin-am62 we don't need the
    hackish and hidden overrides of certain variables.
    Move these settings into the machine configuration.
    
    Related-to: ELB-5190
    Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>

diff --git a/conf/layer.conf b/conf/layer.conf
index aa9afd4..e148b52 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -1,6 +1,3 @@
-# Hack to change stuff in meta-ti
-require machine/am62xx-tdx.inc
-
 # We have a conf and classes directory, append to BBPATH
 BBPATH .= ":${LAYERDIR}"
 
diff --git a/conf/machine/am62xx-tdx.inc b/conf/machine/am62xx-tdx.inc
deleted file mode 100644
index 6bc3741..0000000
--- a/conf/machine/am62xx-tdx.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-# Hack to override stuff in meta-ti
-# This file is included in our conf/layer.conf , i.e. HACK²
-
-# meta-ti-bsp/conf/machine/include/k3.inc
-# With "sdimage-2part-efi.wks" my builds do not boot, no serial output at
-# all
-WKS_FILE:k3 = "sdimage-2part.wks"
-
-MACHINE_EXTRA_RRECOMMENDS:append:am62xx = " kernel-modules"
-
-PREFERRED_PROVIDER_virtual/dtb:am62xx = "device-tree-overlays-ti"
diff --git a/conf/machine/verdin-am62.conf b/conf/machine/verdin-am62.conf
index 1fd15e0..4fccd14 100644
--- a/conf/machine/verdin-am62.conf
+++ b/conf/machine/verdin-am62.conf
@@ -18,8 +18,11 @@ IMAGE_BOOT_FILES:remove = "tiboot3-am62x-hs-evm.bin"
 
 # Don't include kernels in standard images
 RRECOMMENDS:${KERNEL_PACKAGE_NAME}-base = ""
+# Install kernel modules by default
+MACHINE_EXTRA_RRECOMMENDS:append:am62xx = " kernel-modules"
 
 PREFERRED_PROVIDER_virtual/kernel = "linux-toradex-ti"
+PREFERRED_PROVIDER_virtual/dtb = "device-tree-overlays-ti"
 PREFERRED_PROVIDER_virtual/bootloader = "u-boot-toradex-ti-staging"
 PREFERRED_PROVIDER_u-boot = "u-boot-toradex-ti-staging"
 
@@ -49,6 +52,10 @@ IMAGE_BOOT_FILES = " \
     ${@make_dtb_boot_files(d)} \
 "
 
+# meta-ti-bsp/conf/machine/include/k3.inc
+# With "sdimage-2part-efi.wks" my builds do not boot, no serial output at
+# all
+WKS_FILE:k3 = "sdimage-2part.wks"
 WKS_FILE_DEPENDS:append = " u-boot-distro-boot"
 WIC_CREATE_EXTRA_ARGS:append = " --no-fstab-update"

Questions that I have:

  • is using forcevariable the intended mechanism for downstream layers to override WKS_FILE, or am i missing some supported pattern ?
  • would the assignment in verdin-am62.conf be better as WKS_FILE:k3 ?= "sdimage-2part.wks" it would allow downstream layers win with a plain ‘=’

Hi, I’m the Toradex AI Assistant.

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


I understand you’re working on customizing the WIC file generation for RAUC A/B partitions on your Verdin AM62. Your observation about the WKS_FILE:k3 assignment in the machine configuration is valid and raises an important question about the intended override mechanism.

Current Implementation Analysis

Based on your investigation, the current assignment in verdin-am62.conf uses:

WKS_FILE:k3 = "sdimage-2part.wks"

This hard assignment (=) indeed makes it difficult for downstream layers to override the value cleanly, which is why you need to use forcevariable to make it work.

Recommended Approach

For custom WIC file integration in Yocto layers, the standard pattern is to create a custom meta layer with your WIC files, as you’ve done (1). The documentation shows how to create custom layers and recipes, though it doesn’t specifically address WIC file overrides.

Your suggestion about using ?= instead of = for the WKS_FILE:k3 assignment is technically sound from a Yocto perspective. The ?= operator would allow downstream layers to override the value with a simple = assignment, which is more in line with Yocto’s layered configuration philosophy.

Alternative Solutions

While forcevariable works, consider these approaches:

  1. Machine Configuration Override: Create a custom machine configuration that inherits from verdin-am62 and overrides the WKS_FILE there
  2. Layer Priority: Ensure your custom layer has higher priority than meta-toradex-ti in your bblayers.conf
  3. Local Configuration: Set the variable in your local.conf with higher precedence

RAUC Integration Context

Since you’re implementing RAUC for A/B partitions, note that while Toradex doesn’t officially support RAUC for the AM62 platform, the community has explored this integration (2). The approach typically requires custom partition layouts, which aligns with your WIC customization needs.

Recommendation

For your immediate needs, using forcevariable is a valid workaround. However, your suggestion about changing the assignment to WKS_FILE:k3 ?= "sdimage-2part.wks" would indeed provide a cleaner override mechanism for downstream customizations and would be more consistent with Yocto best practices.

You might consider submitting this as feedback to Toradex for potential improvement in future BSP releases, as it would benefit other developers doing similar customizations.

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.