I have a device that runs a custom server that shows a frotend to a user which can be used to do some changes to the device itself. I now also want to add a functionality in that frotend for the user to upload and install a new firmware version to update the device itself.
My first idea was to use my custom frontend/server to upload an artifact in some folder and then to use the mender commands to install this artifact on the device. However to properly then install and start the new firmware I would have to reboot the device and also do some checks to verify proper reboot/restart with the new firmware and potentially then also do a rollback. This all seems to be supported by mender looking at the state diagram, however, I then found this statement in the documentation:
Calling the Mender client from the command line with the
install
command will only invoke the two first states,Download
andArtifactInstall
. Additionally,ArtifactFailure
may be executed if there is an error.Calling the Mender client from the command line with the
commit
command will only invoke the two last states,ArtifactCommit
andCleanup
. Additionally,ArtifactRollback
andArtifactFailure
may be executed if there is an error.The
ArtifactReboot
,ArtifactVerifyReboot
andArtifactRollbackReboot
states are never invoked when calling the Mender client from the command line.
Here: https://raw.githubusercontent.com/mendersoftware/mender/master/support/modules/directory
I am now a little bit confused. It seems I cannot do a reboot with checks and potential rollback with the mender client commands.
How am I supposed to implement a proper logic/architecture like I want to have?
Am I maybe on the wrong track and instead should better use the D-BUS API to control the mender deamon to check for a new update under a specifiy folder instead of using the mender client commands?