Hello to all,
I have recently started using a raspberry pi 3 with yocto kirkstone branch and meta-mender at the same branch for constructing an image for my pi. After following all the guidelines at System updates: Yocto Project | Mender documentation I was able create the sdimg image and successfully boot my target.
I have some questions though and I would like some clarifications if possible.
The image constructed from yocto / mender if I make an fdisk I get the following:
fdisk -l core-image-raspberrypi3.sdimg
Disk core-image-raspberrypi3.sdimg: 1,18 GiB, 1262485504 bytes, 2465792 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x86882af8
Device Boot Start End Sectors Size Id Type
core-image-raspberrypi3.sdimg1 * 24576 106495 81920 40M c W95 FAT32 (LBA)
core-image-raspberrypi3.sdimg2 106496 1155071 1048576 512M 83 Linux
core-image-raspberrypi3.sdimg3 1155072 2203647 1048576 512M 83 Linux
core-image-raspberrypi3.sdimg4 2203648 2465791 262144 128M 83 Linux
I see that the starting sector is the 24576 while the previous sectors are used for the uboot.env file.
So the first 8MB (uboot.env) + 4MB alignment? = 12MBs are used for the uboot.env file
As also stated from the wks file:
cat mender-sdimg.wks
part --source rawcopy --sourceparams="file=/home/<path>/uboot.env" --ondisk "mmcblk0" --align 4096 --no-table
part --source rawcopy --sourceparams="file=/home/<path>/core-image-raspberrypi3.bootimg" --ondisk "mmcblk0" --align 4096 --fixed-size 40 --active
part --source rawcopy --sourceparams="file=/home/<path>/care-image-raspberrypi3.ext4" --ondisk "mmcblk0" --align 4096 --fixed-size 524288k
part --ondisk "mmcblk0" --fstype=ext4 --align 4096 --fixed-size 524288k
part --source rawcopy --sourceparams="file=/home/<path>/core-image-raspberrypi3.dataimg" --ondisk "mmcblk0" --align 4096 --fixed-size 128
According to the provisioning instructions stated here:
https://docs.mender.io/system-updates-yocto-project/provisioning-a-new-device
Use of the dd command is the method for the first provisioning of the target.
But I also used the yocto wic command to provision the target due to the expand option it has for the data partition to take up all the remaining space.
So after using the following wic command:
wic write core-image-raspberrypi3.dataimg /dev/sdb --expand 1:0,2:0,3:0,4:26G
I get the following partitioning at the target:
fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 28.5 GiB, 30601641984 bytes, 59768832 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x86882af8
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 83967 81920 40M c W95 FAT32 (LBA)
/dev/mmcblk0p2 83968 1132543 1048576 512M 83 Linux
/dev/mmcblk0p3 1132544 2181119 1048576 512M 83 Linux
/dev/mmcblk0p4 2181120 59768831 57587712 27.5G 83 Linux
Again the target seems to boot and operate fine.
The starting sector now is 2048.
So my question now is:
Where is the uboot.env now is stored?
In both situations the contents of fw_env.config is:
/dev/mmcblk0 0x400000 0x4000
/dev/mmcblk0 0x800000 0x4000
and fw_printenv works normally.
Is there a change that the uboot.env being written with the wic method to the boot partition and overwrite some files there or happens to being written to an empty space and my target just happens to boot or the whole procedure even with the wic command is accepted?
Finally my target has an eMMC card which has two special partitions:
/dev/mmcblk0boot0
/dev/mmcblk0boot1
Which seems to be completely empty now.
Are there any variables in mender which enable to use those partitions in order to store there the uboot.env?
And is it possible to write to those partitions via the sdimg via the initial provisioning?
Thanks a lot in advance,
Any help is welcome!