Mender.conf - How to add persistent settings with mender-convert

We are using mender-convert to generate a partitioned image from our Golden Image.

I know about the new “split” strategy for mender.conf,
and I am also aware of the access modalitites and priorities on both files /etc/mender/mender.conf and /var/lib/mender -> /data/mender/mender.conf is based: /etc first then /data.

As far as I can see, the file /data/mender/mender.conf is generated during mender-convert process,
where the only two lines it contains (with “RootfsPartA” and “RootfsPartB”) are written.

But we need to have more than these two lines in the persistent /data mender.conf file.
For example ServerURL and XXXIntervalSeconds must be user-configurable in our device and therefore also have to survive OTA updates.
Consequently these settings need to reside in /data, not in /etc.
This is the reason, why I need to have these lines in /data/mender/mender.conf with the initial image (output by mender-convert).

I am afraid now, that these additional lines cannot be added by a rootfs_overlay because this would interfere with the way mender-convert generates /data/mender/mender.conf.

What can I do ?

I think you can use a hook/override to modify the file after it is created. The USER_LOCAL_MODIFY_HOOKS are processed after data/mender/mender.conf is created so that should work.

Many thanks for your ultra-sonic speed reply :grinning:
I didn’t know that, seems to be exactly what I need.