Give a Flapak app read-write access to its own internal file system

Olof Nord olof.nord at tutanota.com
Mon Jan 31 23:35:54 UTC 2022


Many many thanks for this information!

By making use of $XDG_DATA_HOME I found a workaround.

Cheers,
Olof 

31 Jan 2022, 21:59 by b at bpiotrowski.pl:

> On 31/01/2022 21.40, Olof Nord wrote:
>
>> Hello Flatpak devs!
>>
>> I have a demo application[1], which during initial startup, extracts some archives inside the Flatpak.
>>
>> Is there any flags/ways of giving the application write access to its own internal file system?
>> In my case to "/app/bin/resources".
>> This folder does not exist during build, but is created at startup.
>>
>> Currently, I receive the following error message during startup:
>> "unlinkat /app/bin/resources: read-only file system".
>>
>> The files are only relevant to the application itself, there is no need to access them from outside.
>>
>> I have found "--sandbox-expose" to expose read-write access to a file, but this argument isn't valid as a finish-args, and using "--filesystem" isn't really applicable as the folder exists only inside the Flatpak itself (It also does not address the problem, I have tried).
>>
>> Using Flatpak 1.12.4, flatpak-builder 1.2.2.
>>
>> Any advice or further information would be greatly appreciated!
>>
>> Cheers,
>> Olof Nord
>>
>> [1]https://gitlab.com/olof-nord/go-astilectron-flatpak-demo <https://gitlab.com/olof-nord/go-astilectron-flatpak-demo>
>>
>
> As far as I know, /app is read-only except for the extra-data modules, which can extract data to /app/extra during installation. There is no solution to that, it's by design.
>
> A possible workaround is extracting files to $XDG_DATA_HOME, but I assume you would need to change your app to look for the data there.
>
> Bart
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/flatpak/attachments/20220201/49514b76/attachment.htm>


More information about the Flatpak mailing list