Following a previous discussion I’ve been looking into using mender convert rather than snapshots
And I think it’s very nearly there however I have two areas I’m not clear on:
I’m running a program which writes out to a file in the users home directory, I’d like this file to persist between rootfs updates.
I understand that the /data partition should be used for this however I don’t have write access as the partition is owned by root.
Is there a way to configure mender-convert to change the permissions on the created partitions during the conversion?
Or would it be possible to use state scripts to move files from home to /data and back again during the update process?
My other issue is using rootfs overlays, is there any information on what the permissions / owner of overlay files need to be on the host machine or how ownership is assigned during conversion?
I can’t seem to reliably recreate the issue but when using an overlay (just adding a file to home directory) the file is added correctly however the permissions of other files seemed to be randomly altered (e.g. /etc is owned by pijuice which is a user created by the UPS software similar for random files in the home directory)
Any assistance of info would be greatly appreciated
With respects to data partition, in your golden master, setup the /data folder with a subfolder structure as per your requirements with correct permissions and it’ll get copied to the data partition during mender-convert conversion
Yes, that’s correct. Also, regarding ownership, I think anything created in your golden master will be copied into the new image with the same ownership and permissions.
You can also add files through the mender-convert rootfs-overlay in a similar fashion.
Tried this morning and no luck, do I need to alter a config / parameter somewhere?
I’m just using the base scripts/configs from mender-convert and adding a custom config just for LZMA compression
I’ve added a data folder to my golden image’s root which contains a second folder inside (backup) that is owned by the user so they have a place to backup to between rootfs updates.
However it doesn’t seem to copy over to the converted image/artifact, after uploading and deploying I see /data/mender/... but no /data/backup/... on the updated Pi
if starting with the golden master, then you need to do a full re-image of the device from the full disk image created by mender-convert, it wont be part of the mender-artifact as far as i’m aware.