Bundled files not updated

Hi,

I noticed that bundled directories of an application are not updated when the application’s they belong to is updated.

For example, I have an application A version 1.0.0 with the following adef file:

version: v1.0.0
sandboxed:false
executables:
{
myExec = ( MyComponent )
}
processes:
{
run:
{
( myExec )
}
}
bundles:
{
dir:
{
[rw] data ./
}
}
the data directory contains one file named “myFile.txt”

If I change the content of myFile.txt and if I bundle it into a new version of my application (v1.0.1 for example) after having update the application onto the target, the content of myFile.txt is not updated. The old content still present into the file system.

I observed this behaviour for both local and remote update (through AirVantage).

How can I force the system to override myFile.txt with the one of my new application ?

Thanks for your help.

This looks like a bug in how updates are handled – the upgrader will not overwrite existing bundled files with a new file with the same name. As far as I can tell the only way (currently) to force the system to install the new file is to give it a different name.

I’ve entered an issue for this in our bug tracker.

Hi Keith,

Thanks for your answer.

I made additional tests and I notice that if the access right to the directory are set to read only the update overide previous file.

Could you please send me tracker or jira id ?

thanks

David

The JIRA ID is LE-7168.

Thanks !

I’m now following the LE ticket.

Regards,

David

Hi,

has this bug been solved?
If yes, in which legato version?

Greetings,
annaertd

Hi,

am also interested if this has been solved. By the way - can anyone send me a link to the mentioned Jira site for bug tracking please? Am not able to find it anywhere…

Regards,
Clemens

No, it is not solved.
You can app remove the application or rename to another filename

Hi,

unfortunately is neither removing the app in before for us an option nor a file renaming.
By the way - I did some investigation and could see that actually the updated bundled files are transferred to the target, but not within the app’s folder. This is what I could see:
I got a bundled file: blah.sh which shall be updated. After update I can see 2 different locations of this file:
/legato/systems/current/appsWriteable/dirtest/bin/blah.sh
and
/legato/systems/current/apps/dirtest/writeable/bin/blah.sh
The last file location contains the updated content, but when starting the app (which shall give out the content), it only issues the old one (seen on 1st file location).
Does somebody know about this behavior? Are there any ways to influence this maybe?

Regards,
Clemens

If the file is read only, it should be updated correctly

yeah, that’s true - I observed this during tests. Now I wish this would also apply to writeables :wink:

This seems to be the intended behaviour of the bundling mechanism with rw files. The reason why the file is not updated is because the file might have been updated by the user already and replacing it will result in loss of all the data.

I was also thinking about this possible intention - but shouldn’t this process better be configurable? Because it may also be the case that a file must be overwritten by an update - ignoring any user changes on it…

To do the override, user can upgrade their application and modify the bundled file as ro. This will override the existing file as ro. If they really want it to rw again, they will need to upgrade again but specify their bundle file as rw.

You might also try if unsandbox app can help you.

unsandboxed app is not an option sadly. I was already trying to modify file attributes (rw<->r), but this is not permitted. Maybe this has something to do with the smack rules.

how about updating the app twice?
the first time will be using RO, then the file on the module will be updated.
The second time will be using RW, then you can modify the file.

thanks for the hint - but overwriting (by another update) a read-only file seems to be forbidden :frowning:

didn’t you say “yeah, that’s true - I observed this during tests” for the RO test?
Do you mean the second time by rw file is forbidden?

Here I have tried to remove the file in WP76 module before downloading the RW bundled file, it seems working fine.

e.g.
rm /legato/systems/current/appsWriteable/dirtest/bin/blah.sh

yeah - during a common system update it is permitted to overwrite a read-only file. Hence the only solution I see would be to rename all bundled rw-files first, the do the update and in case of success such renamed files could be deleted or moved back (when update fails).