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

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

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.

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.

3 Likes

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.

chown -R root:root rootfs_overlay/
chmod -R 755 rootfs_overlay/
chmod 755 rootfs_overlay/usr/share/mender/identity/mender-device-identity
1 Like