Transfer files and or create a directory as a part of application update

Hello ,

I trying to check my understanding here. I wanted transfer some files or links and if possible create a directory structure on my persistent data.

I thought the best way to go about it would be doing a application update and using mender directory update module.

One of the users notified me that I had to add modules in yocto configuration. But even after that I am unable to successfully perform an application update.

I think the problem was that I didn’t create a proper application update and in between the update I power cycled the system?

So I have two questions that might help me solve my issue.

  1. Is this the right way to achieve this?
  2. How do I populate these below mentioned variables
DEST_DIR="/opt/installed-by-directory/"
FILE_TREE="dir-to-deploy"

So DEST_DIR is where I want to directory to be installed right? So for example if I want to achieve an output like this

–data
-------mender
-------uboot
-------system(New folder structure)

Then

DEST_DIR=/data/

is this correct?
or should it be

DEST_DIR=/data/system/

Where system is the new folder I want installed in /data

FILE_TREE should be the name of my folder created. So in the above example it should be equatl to system ?

As far as I recall it should be DEST_DIR=/data/system. Does that not work for you?

I had only tried /data I will try it now. That could be where I am going wrong
I will update you in some time

That worked

Is there a way to send a soft link file as an application update?

Edit 1
The reason I am asking this is because. I wanted to test an application update that does the following.

  1. Create a folder structure
  2. Transfer a .conf file
  3. Transfer a symlink file
  4. Transfer a text file

I was able to create a folder structure. I transferred a .conf file used by timesyncd and a symlink file used by timedatectl

the conf file worked okay. I was able to restart systemd-timesyncd and saw the status changing.

  1. The only issue I had, was in transferring a symlink file. How do I transfer a symlink file in application update

  2. how do I change the owner of the files involved in application update to root. I see that now the owner of the group is basically the user who creates the update?
    Is there a way to specify who the owner should be while creating an application update?

Not in the current update modules. I suspect these changes are best implemented as a state script since it is likely going to be very custom and any attempt to make it generic will not likely work for many use cases.

The alternative would be to use a script type update module but I think the state script approach is simpler.

Edit 3 I will add my question to an existing discussion