Is Mender Server Mandatory for deployment?

Hi Guys,

We have a Azure IoT hub based cloud infrastructure which we use to deliver the packages/file till the devices. Devices have our own properitery agents running. I am using mender client in my yocto embedded Linux based devcies. My question is do i need the Mender server as mandatory to give the updates to the mender client. Can i use my own delivery mechanism and mender client can just look into a particular directory to get the platform updates (Mender Artifact).

Hello @CoderOnWinks,

The Mender server is not mandatory and you can run the client in something we call “Standalone mode”,

https://docs.mender.io/2.0/architecture/standalone-deployments

Thanks for the reply. I went through the documents. It says in standalone mode, we don’t have to run the mender client as a daemon. So what i will do, is write a script and watch the folder where i am expecting the update (.mender artifact) on my device. I suppose (.mender artifact) is the only thing which we will push from our cloud and once it is received at devices, script will do "mender -install " where URI will be local folder path. And expected is the new (rootfs+kernel) gets flashed on secondary partition. Is this correct understanding.

That is a correct understanding. Note that you can also specific remote URI to the mender -install command.

1 Like

Thanks for info.

I’m not sure on whether you are performing file update (only some file or folder) or block update (rootfs). For block update (i.e rootfs+kernel), the following are the process w.r.t the standalone method:

  1. Assuming you have the .mender artifact in a file server (remote) with a specific URL. Then initiate the client update using mender -install <URL>. This will initiate the standalone mender client.

  2. Please note that, mender shall stream the update. Hence, if you are in partition block A, then the .mender artifact will directly stream and start update on the partition B.

  3. Once, fetching and update is completed, then we need to manually reboot the platform to switch into the new partition block B.

  4. If everything is as expected, then perform mender -commit to finalize the update

I hope this gives the better idea :bulb:

Thanks Ajith for explanation.

I am going to do block update (i.e rootfs+kernel). For that what if the .mender artifact is downloaded on my device via some mechanism through our proprietary cloud. i am planning to have a script which will do mender -install where will be my local folder path. I hope this works too?

Hi,

I am trying to use mender in standalone mode. Till now , i am able to manually patch the uboot fork which i am using. Able to build the uboot-fw-utils. Finally i am just looking for generating the .mender artifact, but in that process when i do bitbake , i get below error.

The rootfs size 2097152(K) overrides IMAGE_ROOTFS_MAXSIZE: 425984(K)

Did i miss something to set, however i am not setting any mender partitions or sizes. My flash procedure, creates all partition and load the image at manufacturing process. I just need .mender artifacts. Please guide.

I believe that, you got confuse with the term steaming vs downloading.
Mender do streaming where the artifact directly go to the other partition and perform the update with -install option. All the checksum and CRC will be calculated on the fly with the help of tarball and HTTPS.

Hence, you can perform -install from a script which can take the URL directly from your cloud (if it is a known CA verified) and perform the update.
The mender preferred steps are:

could artifact update ->script -> -install ->update

instead of

cloud update ->download ->script -> -install -> update.

This one is answered here

Hi Ajith,

We cannot take the URL directly from our cloud. We have an agent which manages and downloads files for us from our cloud infra. Once i have that file in device, can i just use the file path in the mender -install <local_file_path> instead of a URL?

Thanks,
Pankaj

Yes. That should work just fine but it will obviously require a fairly large amount of free space in the onboard storage media.

Yes, this should be fine.

Standalone supports either from URL or from a local file-based storage (say, /mnt/usb1/release1.mender)
Please see - https://docs.mender.io/2.1/architecture/standalone-deployments#deploy-an-artifact-to-a-device - to get the details.

I am able to setup everything on my imx6ull custom board and things are working fine with my custom partitions. I am able to do an update locally from filesystem. I just have one query, if somehow the mender artifact is corrupt, how does the rollback happens. Is it automatically taken care of or we have to do something like i am scripting to commit the update on the reboot. Any pointers?

Is there any way we know in standalone deployment that whether the mender -install failed or succeeded. I was writing a script to do some file watching and then do the update. How can i get the status, so that i can reboot board as per status and then commit as the board boots up.

You must ensure that the device is restarted/rebooted without running mender -commit, and this will ensure a rollback is performed which is handled automatically in U-boot.

If mender -install returns success you know the following:

  • writing the image to the storage medium succeeded and integrity and signature (if enabled) checks passed
  • The update of bootloader flags succeeded and on next reboot it will try to boot the new image