Hi again,
.wks
is definitely a good lead :
# short-description: Create SD card image with a boot partition
# long-description:
# Create an image that can be written onto a SD card using dd for use
# with i.MX SoC family
# It uses u-boot + other binaries gathered together on imx-boot file
#
# The disk layout used is:
# - ---------- -------------- --------------
# | | imx-boot | boot | rootfs |
# - ---------- -------------- --------------
# ^ ^ ^ ^ ^
# | | | | |
# 0 | 8MiB 72MiB 72MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
# 33 32 or 33kiB, see reference manual
#
part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align 33
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 8192 --size 64
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 8192
bootloader --ptable msdos
But, from there I’ve started to try to split work in 2 updating imx-boot
and boot
.
Taking a closer look to the difference between the imx-boot
file and the dd
’ed mmcblk2boot0
:
We can see that imx-boot
starts at the address 0x008400
in mmcblk2boot0
not sure how that match with the 33kiB.
Length seams to match between imx-boot
and mmcblk2boot0
(accounting the offset) but again not with the .wks
for some reason ?
Both contain the modified uboot logs and script witch give me the impression I should be able to make it work by updating mmcblk2boot0
.
I’ve tried to dump boot
using dd on mmcblk2p1
but it’s mostly empty…
Going through the build files i’ve found xxx.testdata.json
here are some the of the informations that seemed relevant :
"IMAGE_OVERHEAD_FACTOR": "1.5",
"IMAGE_ROOTFS_ALIGNMENT": "1",
"IMAGE_ROOTFS_EXCLUDE_PATH": " data/ uboot/",
"IMX_BOOT_SEEK": "33",
"IMX_BOOT_SOC_TARGET": "iMX8MM",
"IMX_DEFAULT_ATF_PROVIDER": "imx-atf",
"IMX_DEFAULT_BOOTLOADER": "u-boot-imx",
"MENDER_BOOT_PART": "/dev/mmcblk2p1",
"MENDER_BOOT_PART_DEFAULT": "/dev/mmcblk2p1",
"MENDER_BOOT_PART_DEFAULT:mender-ubi": "",
"MENDER_BOOT_PART_FSOPTS": "",
"MENDER_BOOT_PART_FSOPTS_DEFAULT": "",
"MENDER_BOOT_PART_FSTAB_OPTS": "defaults,sync",
"MENDER_BOOT_PART_FSTAB_OPTS_DEFAULT": "defaults,sync",
"MENDER_BOOT_PART_FSTYPE": "auto",
"MENDER_BOOT_PART_FSTYPE_DEFAULT": "auto",
"MENDER_BOOT_PART_FSTYPE_TO_GEN": "vfat",
"MENDER_BOOT_PART_FSTYPE_TO_GEN_DEFAULT": "vfat",
"MENDER_BOOT_PART_LABEL": "boot",
"MENDER_BOOT_PART_MOUNT_LOCATION": "/uboot",
"MENDER_BOOT_PART_MOUNT_LOCATION:mender-grub:mender-bios": "/boot/grub",
"MENDER_BOOT_PART_MOUNT_LOCATION:mender-systemd-boot": "/boot",
"MENDER_BOOT_PART_MOUNT_LOCATION:mender-uboot": "/uboot",
"MENDER_BOOT_PART_NUMBER": "1",
"MENDER_BOOT_PART_NUMBER_DEFAULT": "1",
"MENDER_BOOT_PART_NUMBER_DEFAULT:mender-ubi": "",
"MENDER_BOOT_PART_SIZE_MB": "256",
"MENDER_BOOT_PART_SIZE_MB_DEFAULT": "16",
"MENDER_BOOT_PART_SIZE_MB_DEFAULT:mender-systemd-boot": "64",
"MENDER_BOOT_PART_SIZE_MB_DEFAULT:mender-ubi": "0",
"MENDER_CALC_ROOTFS_SIZE": "835584",
"MENDER_CONFIGURATION_VARS": " RootfsPartA RootfsPartB InventoryPollIntervalSeconds RetryPollIntervalSeconds ArtifactVerifyKey ServerCertificate ServerURL UpdatePollIntervalSeconds",
"MENDER_CONNECT_USER": "root",
"MENDER_DATA_PART": "/dev/mmcblk2p4",
"MENDER_DATA_PART_DEFAULT": "/dev/mmcblk2p4",
"MENDER_DATA_PART_DEFAULT:mender-ubi": "/dev/mmcblk2p2",
"MENDER_DATA_PART_FSOPTS": "",
"MENDER_DATA_PART_FSOPTS_DEFAULT": "",
"MENDER_DATA_PART_FSTAB_OPTS": "defaults",
"MENDER_DATA_PART_FSTAB_OPTS_DEFAULT": "defaults",
"MENDER_DATA_PART_FSTYPE": "auto",
"MENDER_DATA_PART_FSTYPE_DEFAULT": "auto",
"MENDER_DATA_PART_FSTYPE_DEFAULT:mender-ubi": "ubifs",
"MENDER_DATA_PART_FSTYPE_TO_GEN": "ext4",
"MENDER_DATA_PART_FSTYPE_TO_GEN_DEFAULT": "ext4",
"MENDER_DATA_PART_LABEL": "data",
"MENDER_DATA_PART_NUMBER": "4",
"MENDER_DATA_PART_NUMBER_DEFAULT": "4",
"MENDER_DATA_PART_SIZE_MB": "128",
"MENDER_DATA_PART_SIZE_MB_DEFAULT": "128",
"MENDER_DEVICE_TYPE": "awpu510",
"MENDER_DEVICE_TYPES_COMPATIBLE": "awpu510",
"MENDER_DEVICE_TYPES_COMPATIBLE_DEFAULT": "awpu510",
"MENDER_DEVICE_TYPE_DEFAULT": "awpu510",
"MENDER_DEVICE_TYPE_DEFAULT:beaglebone-yocto:mender-grub": "awpu510-grub",
"MENDER_EFI_LOADER": "u-boot",
"MENDER_EXTRA_PARTS": "",
"MENDER_EXTRA_PARTS_TOTAL_SIZE_MB": "0",
"MENDER_FEATURES": "mender-image mender-uboot mender-image-sd mender-client-install mender-auth-install mender-update-install",
"MENDER_FEATURES_DISABLE": " mender-grub mender-image-uefi",
"MENDER_FEATURES_ENABLE": "mender-image mender-uboot mender-image-sd mender-client-install",
"MENDER_FLASH_MINIMUM_IO_UNIT": "512",
"MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET": "2",
"MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT": "2",
"MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT:mender-grub:mender-bios:mender-image-bios": "1",
"MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT:mender-grub:mender-bios:mender-image-gpt": "34",
"MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET_DEFAULT:mender-ubi": "0",
"MENDER_IMAGE_BOOTLOADER_FILE": "",
"MENDER_IMAGE_BOOTLOADER_FILE:imx8mnevk": "imx-boot",
"MENDER_IMAGE_BOOTLOADER_FILE_DEFAULT": "",
"MENDER_IMAGE_BOOTLOADER_FILE_DEFAULT:mender-grub:mender-bios": "grub-core.img",
"MENDER_IMAGE_BOOTLOADER_FILE_DEFAULT:mender-ubi": "u-boot.bin",
"MENDER_IMAGE_ROOTFS_MAXSIZE_DEFAULT:mender-ubi": "",
"MENDER_IMAGE_ROOTFS_SIZE_DEFAULT": "835584",
"MENDER_IS_ON_MTDID": "",
"MENDER_MACHINE": "awpu510",
"MENDER_MAXIMUM_LEB_COUNT": "1024",
"MENDER_MBR_BOOTLOADER_FILE": "",
"MENDER_MBR_BOOTLOADER_FILE_DEFAULT": "",
"MENDER_MBR_BOOTLOADER_FILE_DEFAULT:mender-grub:mender-bios": "boot.img",
"MENDER_MBR_BOOTLOADER_LENGTH": "446",
"MENDER_MTDIDS": "",
"MENDER_MTDPARTS": "",
"MENDER_MTD_UBI_DEVICE_NAME": "",
"MENDER_MTD_UBI_DEVICE_NAME_DEFAULT": "",
"MENDER_MTD_UBI_DEVICE_NAME_DEFAULT:mender-ubi": "ubi",
"MENDER_NAND_FLASH_PAGE_SIZE": "2048",
"MENDER_PARTITIONING_OVERHEAD_KB": "16384",
"MENDER_PARTITIONING_OVERHEAD_KB_DEFAULT": "16384",
"MENDER_PARTITIONING_OVERHEAD_KB_DEFAULT:mender-ubi": "2129920",
"MENDER_PARTITION_ALIGNMENT": "8388608",
"MENDER_PARTITION_ALIGNMENT_DEFAULT": "8388608",
"MENDER_PARTITION_ALIGNMENT_DEFAULT:mender-ubi": "8388608",
"MENDER_PERSISTENT_CONFIGURATION_VARS": "RootfsPartA RootfsPartB",
"MENDER_RESERVED_SPACE_BOOTLOADER_DATA": "16777216",
"MENDER_RESERVED_SPACE_BOOTLOADER_DATA_DEFAULT": "16777216",
"MENDER_RESERVED_SPACE_BOOTLOADER_DATA_DEFAULT:mender-uboot": "16777216",
"MENDER_ROOTFS_PART_A": "/dev/mmcblk2p2",
"MENDER_ROOTFS_PART_A_DEFAULT": "/dev/mmcblk2p2",
"MENDER_ROOTFS_PART_A_NAME": "/dev/mmcblk2p2",
"MENDER_ROOTFS_PART_A_NAME_DEFAULT": "/dev/mmcblk2p2",
"MENDER_ROOTFS_PART_A_NAME_DEFAULT:mender-ubi": "/dev/mmcblk2:rootfsa",
"MENDER_ROOTFS_PART_A_NUMBER": "2",
"MENDER_ROOTFS_PART_A_NUMBER_DEFAULT": "2",
"MENDER_ROOTFS_PART_A_NUMBER_DEFAULT:mender-ubi": "0",
"MENDER_ROOTFS_PART_B": "/dev/mmcblk2p3",
"MENDER_ROOTFS_PART_B_DEFAULT": "/dev/mmcblk2p3",
"MENDER_ROOTFS_PART_B_NAME": "/dev/mmcblk2p3",
"MENDER_ROOTFS_PART_B_NAME_DEFAULT": "/dev/mmcblk2p3",
"MENDER_ROOTFS_PART_B_NAME_DEFAULT:mender-ubi": "/dev/mmcblk2:rootfsb",
"MENDER_ROOTFS_PART_B_NUMBER": "3",
"MENDER_ROOTFS_PART_B_NUMBER_DEFAULT": "3",
"MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:mender-ubi": "1",
"MENDER_SERVER_URL": "https://hosted.mender.io",
"MENDER_STATE_SCRIPTS_VERSION": "3",
"MENDER_STORAGE_DEVICE": "/dev/mmcblk2",
"MENDER_STORAGE_DEVICE_BASE": "/dev/mmcblk2p",
"MENDER_STORAGE_DEVICE_BASE_DEFAULT": "/dev/mmcblk2p",
"MENDER_STORAGE_DEVICE_BASE_DEFAULT:mender-ubi": "/dev/mmcblk2_",
"MENDER_STORAGE_DEVICE_DEFAULT": "/dev/mmcblk0",
"MENDER_STORAGE_DEVICE_DEFAULT:mender-ubi": "ubi0",
"MENDER_STORAGE_PEB_SIZE": "8388608",
"MENDER_STORAGE_TOTAL_SIZE_MB": "2048",
"MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT": "1024",
"MENDER_SWAP_PART_SIZE_MB": "0",
"MENDER_SWAP_PART_SIZE_MB_DEFAULT": "0",
"MENDER_UBI_LEB_PEB_BLOCK_OVERHEAD": "0",
"MENDER_UBI_LEB_SIZE": "8388608",
"MENDER_UBI_TOTAL_BAD_PEB_OVERHEAD": "0",
"MENDER_UBI_TOTAL_FIXED_OVERHEAD": "33554432",
"MENDER_UBI_TOTAL_LEB_PEB_OVERHEAD": "0",
"MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET": "8388608",
"MENDER_UBOOT_ENV_UBIVOL_NUMBER_1": "3",
"MENDER_UBOOT_ENV_UBIVOL_NUMBER_2": "4",
"MENDER_UBOOT_POST_SETUP_COMMANDS": "",
"MENDER_UBOOT_POST_SETUP_COMMANDS_DEFAULT": "",
"MENDER_UBOOT_PRE_SETUP_COMMANDS": "",
"MENDER_UBOOT_PRE_SETUP_COMMANDS_DEFAULT": "",
"MENDER_UBOOT_STORAGE_DEVICE": "",
"MENDER_UBOOT_STORAGE_DEVICE_DEFAULT": "",
"MENDER_UBOOT_STORAGE_DEVICE_DEFAULT:mender-ubi": "dummy",
"MENDER_UBOOT_STORAGE_INTERFACE": "",
"MENDER_UBOOT_STORAGE_INTERFACE_DEFAULT": "",
"MENDER_UBOOT_STORAGE_INTERFACE_DEFAULT:mender-ubi": "dummy",
That seems to confirm the partitions layout, the 33
KiB/KB/B/? offset.
I’m still missing something…