Working with Golden Img and Symlink


OS: Raspibian

I have a golden image that I use to create artifacts with mender-convert.
So this golden image know nothing about mender and has no partitions nor mender client.

My doubt:

  1. Where do I keep in my golden image files that must be kept between upgrades? AKA the files that should be in /data/ in field boards. Or my golden image should be already converted and using all the partitions structure of mender?
  2. System files, for exemple, known networks, shall be treated the same way by symlinks?
  3. What is the usual approach a bash command to call thoses symlinks in the system boot? Mender has some tools to organize and automate?


Hi @fisicator,

Normally the files that end up in /data will not be in your Golden Master image although that does present a bootstrapping issue.

@mirzak have we thought about processing files from the Golden Master that are already in a /data directory and making sure they are in the data partition after running mender-convert?

We don’t really have any tool to automate moving things and creating symlinks as that is going to vary widely depending on your distro and what specifically you want to maintain across OTA updates. Using a custom platform_modify() function in mender-convert is likely the best approach here.


1 Like

Dear @drewmoseley,

Thanks for your quickly reply.
If the Golden Master does not have the files that end up in /data so it makes necessary remove them after final test/approval and then proceed with mender-convert?

And If my app uses a database file, golden database will be in one location, but field devices the same database file will be in /data partition, so again after golden master is tested and approved we need to modify the app code to point to a different location before running mender-convert?

Is it the way these issues should be dealed? Or am I going to the wrong way?

Again, /etc/wpa_supplicant/wpa_supplicant.conf where raspibian saves wi-fi networks.
What is the best approach to deal with system files like these that must remain after OTA updates?

I am sorry if are too many questions, but all of this are very new for us.


This should already be taken care of in the mender-convert tool. It does treat the /data directory in a “special” way and all of it contents in the Golden image, will be moved to the data partition during conversion.


@mirzak thanks for confirming. I was unaware it did that but glad to hear that it does.

@fisicator it looks like you can just put the files in /data in your golden image and mender-convert will move them into the newly created data partition. Just be aware that when that happens, any further changes you make to them in the golden image will no be in the OTA artifacts since the /data partition is explicitly excluded from OTA.

I do recommend you limit your testing on the golden master to just enough to determine that it is sane and then do the bulk of your testing on the converted image since that is the version that will be running on your target devices.

Replacing /etc/wpa_supplicant/wpa_supplicant.conf with a symlink to something in /data may work. You will need to test it to make sure though because not all network managers behave the same way. The alternative would be to change the invocation of wpa_supplicant to actually look for the file in /data since I think it takes the filename as a command line parameter.


Thanks guys! I am running tests and will tell you if its going well.
Best Regards


I have the same question as @fisicator and I am also working on a Raspbian based image. I am just looking for clarification here:

If I understand correctly I can make a /data partition on my golden image SD card and any files located in there will be copied to the /data partition on my mender-converted image. Is that correct?

And I won’t rely on any files in the /data partition being included in OTA artifacts :slight_smile:

Hi @martind that is correct. Let us know if you encounter any issues with it but that’s how it is intended to behave.