Update shows "already installed" and doesn't get committed

85 views
Skip to first unread message

Sam Lewis

unread,
Feb 5, 2019, 1:57:53 AM2/5/19
to Mender List mender.io
I'm attempting to get mender working for my device on a non-yocto build system and I thought I had everything integrated. However, I'm having some trouble getting updates to work correctly.

On my device, the update seems to go well. It downloads the artifact and reboots into the new partition, as expected. However, on the server the progress goes from "rebooting" to "already installed" after the device reboots. The mender client also looks as though it doesn't commit the update on the new partition, because rebooting the device once it has successfully booted into the new partition causes uboot to boot back to the original partition because the bootlimit is exceeded.

Curiously, once booted back into the original partition, the mender client seems to know that it should have been updated and complains that "got invalid entrypoint into the state machine: state: reboot".

Am I doing something wrong? Why does the client think the update was already installed and why isn't it committing the update? It seems to be that after the reboot, the client doesn't realise it's in the updated partition and instead tries to pull the update again? Is it possible that the mender client state is being stored in the wrong uboot environment?

Some potentially relevant info:

* I'm using the Mender demo server
* The existing rootfs and update rootfs use the same mender-agent.pem file (it's symlinked from /data)
* Using mender 1.7
* The update rootfs is basically the same as the original rootfs but with /etc/mender/artifact_info changed as well as some new files in the root directory. All the mender configuration apart from this is the same across both rootfs.
* I have the following /etc/fw_env.conf file:

    /dev/mmcblk0 0x400000 0x20000
    /dev/mmcblk0 0x800000 0x20000

  and I have the corresponding offsets and sizes set in my uboot src (I guess if this wasn't working then it wouldn't properly reboot into the new partition?)
* Using the default identity script which uses the mac address, mac address doesn't change after the update and both pre and post update seem to properly identify as the same device in the UI

Mender logs attached, from both before and after the reboot (before the reboot is on mmcblk0p2 and after is mmcblk0p3). In the "after-reboot" logs I included the mender logs for the client once I had rebooted from the updated partition.

Appreciate any help, I'm assuming this is probably just me misconfiguring something but I'm having trouble figuring out what I misconfigured!
mender-after-reboot.txt
mender-before-reboot.txt

Kristian Amlie

unread,
Feb 5, 2019, 2:11:36 AM2/5/19
to men...@lists.mender.io, Sam Lewis
It sounds like the persistent data partition is not correctly mounted
when booting the new rootfs. This causes Mender to forget everything
about the update it was doing. Make sure it is mounted, and that it is
the same partition.

--
Kristian

signature.asc

Sam Lewis

unread,
Feb 5, 2019, 2:16:20 AM2/5/19
to Kristian Amlie, men...@lists.mender.io
Ah -- I have the same persistent partition mounted in both partitions to /data but perhaps I'm not symlinking mender directories/files to it as I should?

What files should be persistent between partitions other than mender-agent.pem?

Kristian Amlie

unread,
Feb 5, 2019, 2:29:46 AM2/5/19
to Sam Lewis, men...@lists.mender.io
On 05/02/2019 08:16, Sam Lewis wrote:
> Ah -- I have the same persistent partition mounted in both partitions to
> /data but perhaps I'm not symlinking mender directories/files to it as I
> should?
>
> What files should be persistent between partitions other than
> mender-agent.pem?

All files inside /data/mender, though in reality mender looks for the
folder /var/lib/mender. Normally this is symlinked to /data/mender.

You cannot symlink individual files, because Mender creates files in
that folder that also need to be persistent.

--
Kristian
signature.asc
Reply all
Reply to author
Forward
0 new messages