From 82871139974077ba7ccfbf00803be636ed71be59 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 9 Feb 2026 02:36:55 +0100 Subject: [PATCH] uboot: move env variables into env for structuredAttrs --- pkgs/misc/uboot/default.nix | 146 +++++++++++++++++++++++------------- 1 file changed, 93 insertions(+), 53 deletions(-) diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index 1c4fab7c75ab..78abd41049ac 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -261,8 +261,10 @@ in ubootBananaPim64 = buildUBoot { defconfig = "bananapi_m64_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; @@ -276,8 +278,10 @@ in ubootCM3588NAS = buildUBoot { defconfig = "cm3588-nas-rk3588_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3588; + env = { + BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -377,7 +381,7 @@ in platforms = [ "aarch64-linux" ]; license = lib.licenses.unfreeRedistributableFirmware; }; - BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -391,8 +395,10 @@ in ubootNanoPCT6 = buildUBoot { defconfig = "nanopc-t6-rk3588_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3588; + env = { + BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -404,8 +410,10 @@ in ubootNanoPiR5S = buildUBoot { defconfig = "nanopi-r5s-rk3568_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = rkbin.BL31_RK3568; - ROCKCHIP_TPL = rkbin.TPL_RK3568; + env = { + BL31 = rkbin.BL31_RK3568; + ROCKCHIP_TPL = rkbin.TPL_RK3568; + }; filesToInstall = [ "idbloader.img" "u-boot.itb" @@ -490,25 +498,31 @@ in ubootOlimexA64Olinuxino = buildUBoot { defconfig = "a64-olinuxino-emmc_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootOlimexA64Teres1 = buildUBoot { defconfig = "teres_i_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - # Using /dev/null here is upstream-specified way that disables the inclusion of crust-firmware as it's not yet packaged and without which the build will fail -- https://docs.u-boot.org/en/latest/board/allwinner/sunxi.html#building-the-crust-management-processor-firmware - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + # Using /dev/null here is upstream-specified way that disables the inclusion of crust-firmware as it's not yet packaged and without which the build will fail -- https://docs.u-boot.org/en/latest/board/allwinner/sunxi.html#building-the-crust-management-processor-firmware + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootOrangePi5 = buildUBoot { defconfig = "orangepi-5-rk3588s_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3588; + env = { + BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -520,8 +534,10 @@ in ubootOrangePi5Max = buildUBoot { defconfig = "orangepi-5-max-rk3588_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3588; + env = { + BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -533,8 +549,10 @@ in ubootOrangePi5Plus = buildUBoot { defconfig = "orangepi-5-plus-rk3588_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3588; + env = { + BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -552,8 +570,10 @@ in ubootOrangePiZeroPlus2H5 = buildUBoot { defconfig = "orangepi_zero_plus2_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; @@ -566,7 +586,7 @@ in ubootOrangePiZero2 = buildUBoot { defconfig = "orangepi_zero2_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinnerH616}/bl31.bin"; + env.BL31 = "${armTrustedFirmwareAllwinnerH616}/bl31.bin"; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; @@ -576,23 +596,27 @@ in # According to https://linux-sunxi.org/H616 the H618 "is a minor update with a larger (1MB) L2 cache" (compared to the H616) # but "does require extra support in U-Boot, TF-A and sunxi-fel. Support for that has been merged in mainline releases." # But no extra support seems to be in TF-A. - BL31 = "${armTrustedFirmwareAllwinnerH616}/bl31.bin"; + env.BL31 = "${armTrustedFirmwareAllwinnerH616}/bl31.bin"; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootOrangePi3 = buildUBoot { defconfig = "orangepi_3_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinnerH6}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinnerH6}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootOrangePi3B = buildUBoot { defconfig = "orangepi-3b-rk3566_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - ROCKCHIP_TPL = rkbin.TPL_RK3568; - BL31 = rkbin.BL31_RK3568; + env = { + ROCKCHIP_TPL = rkbin.TPL_RK3568; + BL31 = rkbin.BL31_RK3568; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -610,31 +634,37 @@ in ubootPine64 = buildUBoot { defconfig = "pine64_plus_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootPine64LTS = buildUBoot { defconfig = "pine64-lts_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootPinebook = buildUBoot { defconfig = "pinebook_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootPinebookPro = buildUBoot { defconfig = "pinebook-pro-rk3399_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -689,8 +719,10 @@ in ubootQuartz64B = buildUBoot { defconfig = "quartz64-b-rk3566_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3568}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3566; + env = { + BL31 = "${armTrustedFirmwareRK3568}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3566; + }; filesToInstall = [ "idbloader.img" "idbloader-spi.img" @@ -703,8 +735,10 @@ in ubootRadxaZero3W = buildUBoot { defconfig = "radxa-zero-3-rk3566_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3568}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3566; + env = { + BL31 = "${armTrustedFirmwareRK3568}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3566; + }; filesToInstall = [ "idbloader.img" "u-boot.itb" @@ -757,7 +791,7 @@ in ubootRock4CPlus = buildUBoot { defconfig = "rock-4c-plus-rk3399_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -767,8 +801,10 @@ in ubootRock5ModelB = buildUBoot { defconfig = "rock5b-rk3588_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3588; + env = { + BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -780,7 +816,7 @@ in ubootRock64 = buildUBoot { defconfig = "rock64-rk3328_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3328}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3328}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -805,7 +841,7 @@ in ''; defconfig = "rock64-rk3328_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3328}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3328}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -816,7 +852,7 @@ in ubootRockPiE = buildUBoot { defconfig = "rock-pi-e-rk3328_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3328}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3328}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -827,7 +863,7 @@ in ubootRockPro64 = buildUBoot { defconfig = "rockpro64-rk3399_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -842,7 +878,7 @@ in "u-boot.itb" "idbloader.img" ]; - BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; }; ubootSheevaplug = buildUBoot { @@ -857,16 +893,20 @@ in ubootSopine = buildUBoot { defconfig = "sopine_baseboard_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; - SCP = "/dev/null"; + env = { + BL31 = "${armTrustedFirmwareAllwinner}/bl31.bin"; + SCP = "/dev/null"; + }; filesToInstall = [ "u-boot-sunxi-with-spl.bin" ]; }; ubootTuringRK1 = buildUBoot { defconfig = "turing-rk1-rk3588_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; - ROCKCHIP_TPL = rkbin.TPL_RK3588; + env = { + BL31 = "${armTrustedFirmwareRK3588}/bl31.elf"; + ROCKCHIP_TPL = rkbin.TPL_RK3588; + }; filesToInstall = [ "u-boot.itb" "idbloader.img" @@ -896,7 +936,7 @@ in ubootVisionFive2 = buildUBoot { defconfig = "starfive_visionfive2_defconfig"; extraMeta.platforms = [ "riscv64-linux" ]; - OPENSBI = "${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin"; + env.OPENSBI = "${opensbi}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin"; filesToInstall = [ "spl/u-boot-spl.bin.normal.out" "u-boot.itb" @@ -915,7 +955,7 @@ in ubootRockPi4 = buildUBoot { defconfig = "rock-pi-4-rk3399_defconfig"; extraMeta.platforms = [ "aarch64-linux" ]; - BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; + env.BL31 = "${armTrustedFirmwareRK3399}/bl31.elf"; filesToInstall = [ "u-boot.itb" "idbloader.img"