Hi,
I have been attempting to get my arria10 iWave board to work with the server.
As can be seen in the following picture I have successfully managed to get my board to register with our demo server:
However I am finding that I am unable to get the server to download a new artefact completely, it gets stuck at 69%. I’m forced to abort the deployment and when rebooting the target device it goes into a constant reset after booting the Mender OTA service.
I think this is a probably due to a target configuration problem due to the partition layout that I need to use & the setup of fw_printenv.
Target SD partition: (seen from card reader on server)
Device Boot Start End Blocks Id System
/dev/sdf1 2048 1026048 512000+ b W95 FAT32
/dev/sdf2 1026049 4098049 1536000+ 83 Linux
/dev/sdf3 4098050 4118530 10240+ a2 Unknown
/dev/sdf4 4120576 30449663 13164544 5 Extended
/dev/sdf5 4122624 7194623 1536000 83 Linux
/dev/sdf6 7196672 7458815 131072 b W95 FAT32
Sectors | Type | Description |
---|---|---|
0 - 511 | Raw | Bootloader |
512 – 2047 | Raw | Environment Variables |
2048 – 1026048 | FAT32 | Boot Partition |
1026049 – 4098049 | Ext3 | Linux RootFS Bank 1 |
4098050 – 4118530 | Raw | U-boot Binary Image |
4122624 - 7194623 | Ext3 | Linux RootFS Bank 2 |
7196672 - 7458815 | FAT32 | Mender Data Partition |
The Bootloader is supplied by Intel for the Arria10. It requires that there is an FPGA image in the Boot FAT32 partition (if this is not there the bootloader will hang), once this is loaded it runs the u-boot binary located at sector 4098050. This is why I have created the second Linux RootFS partition and Data partition after the current structure of the SD card.
I have tried to reflect this in Mender variables that I added to local.conf:
############################################################
# Mender Changes
# The name of the disk image and Artifact that will be built.
# This is what the device will report that it is running, and different updates must have different names
# because Mender will skip installation of an Artifact if it is already installed.
MENDER_ARTIFACT_NAME = “release-2”
INHERIT += “mender-full”
# A MACHINE integrated with Mender.
MACHINE = “iwg24m”
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"
MENDER_STORAGE_DEVICE = “/dev/mmcblk0”
MENDER_STORAGE_DEVICE_BASE = “${MENDER_STORAGE_DEVICE}p”
# Memory card with 16GiB of storage.
MENDER_STORAGE_TOTAL_SIZE_MB = “16384”
MENDER_BOOT_PART_SIZE_MB = “500”
MENDER_DATA_PART_SIZE_MB = “128”
MENDER_BOOT_PART = “{MENDER_STORAGE_DEVICE_BASE}1"*
*MENDER_DATA_PART = "{MENDER_STORAGE_DEVICE_BASE}6”
MENDER_ROOTFS_PART_A = “{MENDER_STORAGE_DEVICE_BASE}2"*
*MENDER_ROOTFS_PART_B = "{MENDER_STORAGE_DEVICE_BASE}5”
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = “systemd”
DISTRO_FEATURES_BACKFILL_CONSIDERED = “sysvinit”
VIRTUAL-RUNTIME_initscripts = “”
ARTIFACTIMG_FSTYPE = “ext4”
As my bootloader is not physically located in a partition, I set this variable to the FAT32 partition that is used by the bootloader. Will this cause an issue?
I do see these parameters reflected in my u-boot environment variable and my mender.conf in the rootfs:
root@iwg24m:/etc/mender# cat mender.conf
{
- “InventoryPollIntervalSeconds”: 1800,*
- “RetryPollIntervalSeconds”: 300,*
- “RootfsPartA”: “/dev/mmcblk0p2”,*
- “RootfsPartB”: “/dev/mmcblk0p5”,*
- “ServerURL”: “https://docker.mender.io”,*
- “ServerCertificate”: “/etc/mender/server.crt”,*
- “UpdatePollIntervalSeconds”: 1800*
}
However what concerns me is that the partition layout that is generated from my Yocto build (Angstrom-gsrd-console-image-glibc-ipk-v2017.06-iwg24m.sdimg) is as follows:
*Start End Blocks Id System*
*49152 1073151 512000 c W95 FAT32 (LBA)*
*1081344 17154047 8036352 83 Linux*
*17154048 33226751 8036352 83 Linux*
*33226752 33488895 131072 83 Linux*
This doesn’t seem to be based on the Mender variables.
Can I used my own partition layout which matches the Mender variables I have set, or will this cause an issue?
fw_printenv:
Running mender directly from the command line I see the following error:
root@iwg24m:~# /usr/bin/mender
ERRO[0000] Failed to read the current active partition: No match between boot and root partitions.: exit status 1 module=main
ERRO[0000] Must give one of -rootfs, -commit, -bootstrap or -daemon arguments module=main
Reading some forum posts this indicated that there was an error with fw_printenv, so I ran this command:
root@iwg24m:~# fw_printenv
Cannot parse config file: No such file or directory
I found that my environment variables were being written to an incorrect area of the SD card and corrected this by adding the following setting in my local.conf.
MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 = “0x4000”
MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2 = “0x9D800”
I can now see that my environment variables are being written to the correct area of my SD card. When running setenv in u-boot the environment variables are being alternatively written to the main and redundant banks.
This however is not fixing my issues with fw_printenv.
I checked /etc/fw_env.conf and can see it’s a symbolic link:
0 lrwxrwxrwx 1 root root 26 Feb 28 12:52 fw_env.config -> /data/u-boot/fw_env.config
However I do not have a u-boot directory in /data.
How does this get created?
Thanks