# Adding custom mender-device-identity with mender-convert 2.0.0

**URL:** https://hub.mender.io/t/adding-custom-mender-device-identity-with-mender-convert-2-0-0/1677
**Category:** General Discussions
**Tags:** mender-convert
**Created:** [March 23, 2020, 2:49pm UTC](https://hub.mender.io/t/adding-custom-mender-device-identity-with-mender-convert-2-0-0/1677 "2020-03-23T14:49:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![spratesi](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@spratesi](https://hub.mender.io/u/spratesi)
#### Post date: [March 23, 2020, 2:49pm UTC](https://hub.mender.io/t/adding-custom-mender-device-identity-with-mender-convert-2-0-0/1677/1 "2020-03-23T14:49:15Z")

</div>

Needing to implement a custom `mender-device-identity` file, I would like to know if I can add it in the overlays folder (as passed with --overlay) for mender-convert.

Generalizing the question, I would like to know if:

- files in the overlay folder are applied consistently after the installation of all the mender files?
- the permissions of files in the overlay folder are preserved?

Thank you for your good work

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [March 23, 2020, 2:53pm UTC](https://hub.mender.io/t/adding-custom-mender-device-identity-with-mender-convert-2-0-0/1677/2 "2020-03-23T14:53:08Z")

</div>

> Needing to implement a custom `mender-device-identity` file, I would like to know if I can add it in the overlays folder (as passed with --overlay) for mender-convert.

This should be possible e.g if you put them in `overlay_dir/usr/share/mender/identity`

> files in the overlay folder are applied consistently after the installation of all the mender files?

This should be the case, it is the last operation performed on the filesystem. You can see it here.

> <https://github.com/mendersoftware/mender-convert/blob/master/mender-convert-modify#L249-L252>

> the permissions of files in the overlay folder are preserved?

This should also be the case as they are copied using `rsync --archive` which should preserver permissions among other things.

---

<div class="post-metadata">

### Author: ![spratesi](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@spratesi](https://hub.mender.io/u/spratesi)
#### Post date: [April 9, 2020, 1:46pm UTC](https://hub.mender.io/t/adding-custom-mender-device-identity-with-mender-convert-2-0-0/1677/3 "2020-04-09T13:46:47Z")

</div>

As a follow-up I share a note about something that has bitten me, because of my distraction.  
You need to make sure to change permissions to the rootfs\_overlay/ elements or in the final image you will have / and part of the hierarchy with an user different from root (e.g. 1000) as owner.  
This is of course obvious since `rsync -a` is used. Just need to pay attention.

```auto
chown -R root:root rootfs_overlay/
chmod -R 755 rootfs_overlay/
chmod 755 rootfs_overlay/usr/share/mender/identity/mender-device-identity

```
