[PATCH 0/2] Import environment variables from FIT configuration

lukas.funke-oss at weidmueller.com lukas.funke-oss at weidmueller.com
Tue Jul 2 08:48:32 CEST 2024


From: Lukas Funke <lukas.funke at weidmueller.com>


This series enables U-Boot to import environment variables from the
selectd FIT configuration. One use-case is that the overall build process
enriches the FIT configuration node with dm-verity information which
should be injected into the kernel commandline. U-Boot will then read
these (possibly signed) environment variables and put them into the
actual Kernel commandline using variable replacement
(see CONFIG_BOOTARGS_SUBST).

Example:

Config:
CONFIG_BOOTARGS_SUBST=y
CONFIG_ENV_IMPORT_FIT_CONF=y

FIT:
    configurations {
        default = "conf-1";
            conf-1 {
                kernel = "kernel-1";
                fdt = "fdt-1";
                env,dm-verity-args = "dm-mod.create=...";
                env,bar = "someothervalue";
            };
    };

U-Boot cmdline:
=> env set bootargs="rootfstype=squashfs root=/dev/xyz ${dm-verity-args} ro"
=> boot

Kernel cmdline:
Kernel command line: rootfstype=squashfs ... dm-mod.create= ...



Lukas Funke (2):
  env: Add function to import environment variables from FIT conf node
  test: fit: Add test to check environment extraction from FIT conf node

 boot/image-fit.c          |  4 ++++
 configs/sandbox_defconfig |  1 +
 env/Kconfig               | 10 +++++++++
 env/common.c              | 28 ++++++++++++++++++++++++
 include/env.h             | 11 ++++++++++
 test/py/tests/test_fit.py | 45 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 99 insertions(+)

-- 
2.30.2



More information about the U-Boot mailing list