Hi,
I’ve integrated mender into our board and went through the integration checklist ok but for some reason an image update isn’t working. It does the update and reboots but as soon after booting it reboots again. I checked the update and it’s using the right device for the update
Oct 22 13:14:36 octave-imx8mnevk mender[375]: time="2020-10-22T13:14:36Z" level=info msg="Opening device \"/dev/mmcblk2p2\" for writing"
Oct 22 13:14:36 octave-imx8mnevk mender[375]: time="2020-10-22T13:14:36Z" level=info msg="Native sector size of block device /dev/mmcblk2p2 is 512 bytes. Mender will write in chunks of 1048576 bytes"
Oct 22 13:15:56 octave-imx8mnevk mender[375]: time="2020-10-22T13:15:56Z" level=info msg="All bytes were successfully written to the new partition"
Oct 22 13:15:56 octave-imx8mnevk mender[375]: time="2020-10-22T13:15:56Z" level=info msg="The optimized block-device writer wrote a total of 5449 frames, where 0 frames did need to be rewritten (i.e., skipped)"
Oct 22 13:15:57 octave-imx8mnevk mender[375]: time="2020-10-22T13:15:57Z" level=info msg="Wrote 5712642048/5712642048 bytes to the inactive partition"
Oct 22 13:15:57 octave-imx8mnevk mender[375]: time="2020-10-22T13:15:57Z" level=info msg="State transition: update-store [Download_Enter] -> update-after-store [Download_Leave]"
Which looks good as it’s updated the image to /dev/mmcblk2p2. But when it reboots the kernel command line is wrong
[ 0.000000][ T0] Kernel command line: root=/dev/mmcblk2p1 console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 maxcpus=0
NOTE: I’m using an eMMC where the bootloader is in mmcblk2boot0 so Mender is setup to use
MENDER_ROOTFS_PART_A="/dev/mmcblk2p1"
MENDER_ROOTFS_PART_A_DEFAULT="/dev/mmcblk2p1"
MENDER_ROOTFS_PART_A_NAME="/dev/mmcblk2p1"
MENDER_ROOTFS_PART_A_NAME_DEFAULT="/dev/mmcblk2p1"
MENDER_ROOTFS_PART_A_NAME_DEFAULT_mender-ubi="/dev/mmcblk2:rootfsa"
MENDER_ROOTFS_PART_A_NUMBER="1"
MENDER_ROOTFS_PART_A_NUMBER_DEFAULT="1"
MENDER_ROOTFS_PART_A_NUMBER_DEFAULT_mender-ubi="0"
MENDER_ROOTFS_PART_B="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_B_DEFAULT="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_B_NAME="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_B_NAME_DEFAULT="/dev/mmcblk2p2"
MENDER_ROOTFS_PART_B_NAME_DEFAULT_mender-ubi="/dev/mmcblk2:rootfsb"
MENDER_ROOTFS_PART_B_NUMBER="2"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT="2"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_mender-ubi="1"
When the new image boots I managed to log in and get the journal output before it reboots and I get the following
Oct 22 13:16:17 octave-imx8mnevk login[309]: ROOT LOGIN on '/dev/ttymxc1'
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: Started Wait for Network to be Configured.
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: Reached target Network is Online.
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: Started Mender OTA update service.
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: Reached target Multi-User System.
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: Starting Update UTMP about System Runlevel Changes...
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: systemd-update-utmp-runlevel.service: Succeeded.
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: Started Update UTMP about System Runlevel Changes.
Oct 22 13:16:24 octave-imx8mnevk systemd[1]: Startup finished in 1.869s (kernel) + 18.834s (userspace) = 20.704s.
Oct 22 13:16:24 octave-imx8mnevk mender[318]: time="2020-10-22T13:16:24Z" level=info msg="Loaded configuration file: /var/lib/mender/mender.conf"
Oct 22 13:16:24 octave-imx8mnevk mender[318]: time="2020-10-22T13:16:24Z" level=info msg="Loaded configuration file: /etc/mender/mender.conf"
Oct 22 13:16:24 octave-imx8mnevk mender[318]: time="2020-10-22T13:16:24Z" level=info msg="Mender running on partition: /dev/mmcblk2p1"
Oct 22 13:16:25 octave-imx8mnevk mender[318]: time="2020-10-22T13:16:25Z" level=info msg="State transition: init [none] -> init [none]"
It probably reboots because it maybe detects that it has rebooted to the same partition?
To prove it can boot the other image I ran
root@octave-imx8mnevk:~# fw_setenv mender_boot_part 2
root@octave-imx8mnevk:~# fw_setenv mender_boot_part_hex 2
and rebooted and it was fine
$ mount
/dev/mmcblk2p2 on / type ext4 (ro,relatime)
Any ideas to what I have done wrong? I can’t recall making any changes to U-Boot I think the automatic integration was fine.