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

**URL:** <https://hub.mender.io/t/any-way-to-require-a-rootfs-or-module-to-be-installed-before-a-new-module-is-installed/545>\
**Category:** General Discussions\
**Tags:** module, update-modules\
**Created:** [May 9, 2019, 10:29pm UTC](https://hub.mender.io/t/any-way-to-require-a-rootfs-or-module-to-be-installed-before-a-new-module-is-installed/545 "2019-05-09T22:29:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![speeltronics](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@speeltronics](https://hub.mender.io/u/speeltronics)\
**Post date:** [May 9, 2019, 10:29pm UTC](https://hub.mender.io/t/any-way-to-require-a-rootfs-or-module-to-be-installed-before-a-new-module-is-installed/545/1 "2019-05-09T22:29:35Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [May 10, 2019, 6:59am UTC](https://hub.mender.io/t/any-way-to-require-a-rootfs-or-module-to-be-installed-before-a-new-module-is-installed/545/2 "2019-05-10T06:59:19Z")

</div>

> 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?

```auto
mender -show-artifact

```

---

<div class="post-metadata">

**Author:** ![speeltronics](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@speeltronics](https://hub.mender.io/u/speeltronics)\
**Post date:** [May 10, 2019, 3:28pm UTC](https://hub.mender.io/t/any-way-to-require-a-rootfs-or-module-to-be-installed-before-a-new-module-is-installed/545/3 "2019-05-10T15:28:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [May 13, 2019, 6:27am UTC](https://hub.mender.io/t/any-way-to-require-a-rootfs-or-module-to-be-installed-before-a-new-module-is-installed/545/4 "2019-05-13T06:27:47Z")

</div>

> 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: [[MEN-2462] - Mender and CFEngine (by Northern.tech) Jira](https://tracker.mender.io/browse/MEN-2462)
