meta-digi-arm: add u-boot environment partition to WIC images

Switch ccimx8/ccimx9 wic images to a layout with a u-boot-env
partition. Use a fixed PARTUUID for SD rootfs.

https://onedigi.atlassian.net/browse/DUB-1119

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2026-04-07 17:59:37 +02:00
parent 25dfe3d20a
commit 322f90d0a4
10 changed files with 53 additions and 35 deletions

View File

@ -390,8 +390,8 @@ WKS_FILE_DEPENDS:append:mx8-nxp-bsp = " imx-boot"
WKS_FILE_DEPENDS:append:mx9-nxp-bsp = " imx-boot"
SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE:mx8-generic-bsp ?= "imx-imx-boot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE:mx9-generic-bsp ?= "imx-imx-boot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE:mx8-generic-bsp ?= "imx-imx-boot-bootpart-uboot-env.wks.in"
SOC_DEFAULT_WKS_FILE:mx9-generic-bsp ?= "imx-imx-boot-bootpart-uboot-env.wks.in"
WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"

View File

@ -12,8 +12,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Dual boot update verification
if test "${dualboot}" = "yes"; then
# Dual boot update verification (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${upgrade_available}" = "1"; then
echo "Update detected; Booting new system in ${active_system} ${bootattempt}"
else
@ -52,7 +52,7 @@ else
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# We are booting from the SD card.
# SD boot (MBR partition table)
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
fi
if test "${upgrade_available}" = "1"; then

View File

@ -12,8 +12,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Dual boot update verification
if test "${dualboot}" = "yes"; then
# Dual boot update verification (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${upgrade_available}" = "1"; then
echo "Update detected; Booting new system in ${active_system} ${bootattempt}"
else
@ -52,7 +52,7 @@ else
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# We are booting from the SD card.
# SD boot (MBR partition table)
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
fi
if test "${upgrade_available}" = "1"; then

View File

@ -11,8 +11,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Dual boot verification
if test "${dualboot}" = "yes"; then
# Dual boot (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${active_system}" = "linux_a"; then
echo "Booting from system A ${bootattempt}"
part number mmc ${mmcbootdev} linux_a tmp_mmcpart
@ -48,12 +48,11 @@ else
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# We are booting from the SD card.
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
# SD boot (use SD specific rootfs partition uuid)
setenv mmcroot PARTUUID=b74d3700-a3c2-4806-8cb6-4e0fed784c7f
fi
fi
# Back up environment variables
setenv ORIG_overlays ${overlays}
setenv ORIG_extra_bootargs ${extra_bootargs}

View File

@ -11,8 +11,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Dual boot verification
if test "${dualboot}" = "yes"; then
# Dual boot (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${active_system}" = "linux_a"; then
echo "Booting from system A ${bootattempt}"
part number mmc ${mmcbootdev} linux_a tmp_mmcpart
@ -48,8 +48,8 @@ else
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# We are booting from the SD card.
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
# SD boot (use SD specific rootfs partition uuid)
setenv mmcroot PARTUUID=b74d3700-a3c2-4806-8cb6-4e0fed784c7f
fi
fi

View File

@ -11,8 +11,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Dual boot verification
if test "${dualboot}" = "yes"; then
# Dual boot (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${active_system}" = "linux_a"; then
echo "Booting from system A ${bootattempt}"
part number mmc ${mmcbootdev} linux_a tmp_mmcpart
@ -48,8 +48,8 @@ else
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# We are booting from the SD card.
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
# SD boot (use SD specific rootfs partition uuid)
setenv mmcroot PARTUUID=b74d3700-a3c2-4806-8cb6-4e0fed784c7f
fi
fi

View File

@ -11,8 +11,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Dual boot verification
if test "${dualboot}" = "yes"; then
# Dual boot (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${active_system}" = "linux_a"; then
echo "Booting from system A ${bootattempt}"
part number mmc ${mmcbootdev} linux_a tmp_mmcpart
@ -48,8 +48,8 @@ else
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# We are booting from the SD card.
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
# SD boot (use SD specific rootfs partition uuid)
setenv mmcroot PARTUUID=b74d3700-a3c2-4806-8cb6-4e0fed784c7f
fi
fi

View File

@ -11,11 +11,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Pre step: check if we boot from uSD.
if test "${mmcbootdev}" = "1"; then
# We are booting from the SD card.
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
elif test "${dualboot}" = "yes"; then
# Dual boot (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${active_system}" = "linux_a"; then
echo "Booting from system A ${bootattempt}"
part number mmc ${mmcbootdev} linux_a tmp_mmcpart
@ -50,6 +47,9 @@ else
# We are booting from the eMMC using 'recovery'.
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# SD boot (use SD specific rootfs partition uuid)
setenv mmcroot PARTUUID=b74d3700-a3c2-4806-8cb6-4e0fed784c7f
fi
fi

View File

@ -11,11 +11,8 @@ if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Pre step: check if we boot from uSD.
if test "${mmcbootdev}" = "1"; then
# We are booting from the SD card.
setenv mmcroot /dev/mmcblk${mmcbootdev}p2
elif test "${dualboot}" = "yes"; then
# Dual boot (only on EMMC)
if test "${mmcbootdev}" = "${emmc_dev}" && test "${dualboot}" = "yes"; then
if test "${active_system}" = "linux_a"; then
echo "Booting from system A ${bootattempt}"
part number mmc ${mmcbootdev} linux_a tmp_mmcpart
@ -50,6 +47,9 @@ else
# We are booting from the eMMC using 'recovery'.
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
# SD boot (use SD specific rootfs partition uuid)
setenv mmcroot PARTUUID=b74d3700-a3c2-4806-8cb6-4e0fed784c7f
fi
fi

View File

@ -0,0 +1,19 @@
# short-description: Create a bootable SD card image
# long-description: Create a bootable SD card image with bootloader,
# environment partition, and boot and rootfs partitions.
#
# The disk layout used is:
# - ---------- ------------ -------------- --------------
# | | imx-boot | u-boot-env | boot | rootfs |
# - ---------- ------------ -------------- --------------
# ^ ^ ^ ^ ^
# | | | | |
# 0 | 8MiB - 32kiB 8MiB 264MiB
# ${IMX_BOOT_SEEK} 32 or 33kiB, see reference manual
#
part imxboot --source rawcopy --sourceparams="file=imx-boot.tagged" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
part u-boot-env --source empty --ondisk mmcblk --size 32k --offset 8160k --part-name u-boot-env --part-type 3DE21764-95BD-54BD-A5C3-4ABE786F38A8
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 8192 --fixed-size 256
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 8192 --uuid b74d3700-a3c2-4806-8cb6-4e0fed784c7f
bootloader --ptable gpt