# Custom Mender Identiy with mender-convert

**URL:** <https://hub.mender.io/t/custom-mender-identiy-with-mender-convert/987>\
**Category:** General Discussions\
**Created:** [September 5, 2019, 12:16pm UTC](https://hub.mender.io/t/custom-mender-identiy-with-mender-convert/987 "2019-09-05T12:16:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![urszaugg](https://avatars.discourse-cdn.com/v4/letter/u/dec6dc/32.png) [@urszaugg](https://hub.mender.io/u/urszaugg)\
**Post date:** [September 5, 2019, 12:16pm UTC](https://hub.mender.io/t/custom-mender-identiy-with-mender-convert/987/1 "2019-09-05T12:16:14Z")

</div>

We use mender-convert with the raspbian image and copied before an own mender-device-identity script to the image. After mender-convert the script is replaced with the default mender-device-identity script. Is there a possibility to keep the mender-device-identity script or how can this be done?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [September 5, 2019, 1:40pm UTC](https://hub.mender.io/t/custom-mender-identiy-with-mender-convert/987/2 "2019-09-05T13:40:35Z")

</div>

I’ll let @mirzak comment on mechanisms to support this specific issue however in general, I think it is better to do all Mender-based configurations after running mender-convert. I think there may be issues such as this one if you are trying to prepopulate the configuration files.

---

<div class="post-metadata">

**Author:** ![simschla](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/simschla/32/340_2.png) [@simschla](https://hub.mender.io/u/simschla)\
**Post date:** [September 5, 2019, 6:33pm UTC](https://hub.mender.io/t/custom-mender-identiy-with-mender-convert/987/3 "2019-09-05T18:33:35Z")

</div>

I think changing those things AFTER mender-convert will not work, since after mender-convert there are two artefacts: the sdimg (here we could actually still change content) and the mender-artefact to be uploaded to [hosted.mender.io](http://hosted.mender.io) (here we cannot change the content anymore).

Therefore it feels like a bug that the mender-device-identity script is overwritten by mender-convert if it is already present in the source-image.

---

<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:** [September 6, 2019, 12:25pm UTC](https://hub.mender.io/t/custom-mender-identiy-with-mender-convert/987/4 "2019-09-06T12:25:15Z")

</div>

> [@simschla](#):
>
> Therefore it feels like a bug that the mender-device-identity script is overwritten by mender-convert if it is already present in the source-image.

I might lean to agreeing to this, but I believe that there is a bigger problem with the current “model”. Yes one could simply add a check not to install files if they are already there. But this would then need to apply to “more files” then `mender-device-identity`, and it quickly gets a out of hand.

This is something that would be quite easy to accomplish using the upcoming mender-convert tool (which received an overhaul for reasons like this),

> [@New iteration of the mender-convert tool](https://hub.mender.io/t/new-iteration-of-the-mender-convert-tool/824):
>
> Hi, As you might be aware of we have a tool we call mender-convert to enable support for Mender on binary distributions. We are happy that this has worked out, enabling people to securely update their devices on non-Yocto devices. Even though we are happy with the functionality of the current tool, there are a couple drawbacks in the current design of the tool, which we want to improve. We looked hard at the current code and decided, to achieve the desired design we would need to do a re-wri…

Here a “MIDDLE” step is added (which IMO would be the correct location to do this, not BEFORE and AFTER), where one is able to provide rootfs overlays and this would be the location to provide e.g a custom `mender-device-identity` file.
