Any way to require a rootfs or module to be installed before a new module is installed

module
update-modules
#1

Is there any way to require that a rootfs or update module already be installed before a new module is installed? If not and this can only be done using scripts, is there any way to determine what modules or rootfs artifacts have already been installed by running a script on the device to be updated? I noticed in a comment that the artifact_info file is deprecated in version 2.0 and updates are being stored in the db now. Is there any way for a device to access this db? Thanks!

#2

Is there any way to require that a rootfs or update module already be installed before a new module is installed?

No, I don’t think so. This would be hard for the client to enforce, because there are many means to install a new update module.

If not and this can only be done using scripts, is there any way to determine what modules or rootfs artifacts have already been installed by running a script on the device to be updated?

You can figure out which update modules are installed simply by listing the contents of /usr/share/mender/modules/v3. The closest to figuring out which rootfs artifact is installed is looking at the /etc/mender/artifact_info file, since it will be from the last rootfs (but not the last artifact).

I noticed in a comment that the artifact_info file is deprecated in version 2.0 and updates are being stored in the db now. Is there any way for a device to access this db?

mender -show-artifact
#3

So, if I install a module update using for instance the single-file module to install a file that changes the artifact_name on my device when I look on the mender server? I thought these module updates were just for application updates. Now how do I know what rootfs artifact is installed on a device from the mender server? It’s just showing my single-file artifact name now which was a test module.

I actually meant to ask is there any way to determine what update module artifacts or rootfs artifacts have already been installed by running a script on the device to be updated?

#4

So, if I install a module update using for instance the single-file module to install a file that changes the artifact_name on my device when I look on the mender server? I thought these module updates were just for application updates. Now how do I know what rootfs artifact is installed on a device from the mender server? It’s just showing my single-file artifact name now which was a test module.

Of course you can do that deliberately, but why would you?

I actually meant to ask is there any way to determine what update module artifacts or rootfs artifacts have already been installed by running a script on the device to be updated?

Unfortunately no.

The management of naming of full updates (like rootfs updates) vs “partial” updates (like updating single files) is something we may improve in the future. One possibility is to have a history of all partial updates, which is reset at every full update, but there are many corner cases to discuss. There is a ticket for it here: https://tracker.mender.io/browse/MEN-2462