Including dirs in Legato sandboxed apps

Hello,

I created in my /home/ an empty dir. Then, in my sandboxed legato app’s adef I added a requires/dir section and add /home/foodir. Under /legato/systems/current/appsWriteable/myapp/home I don’t find the foodir.
If I create a file in foodir and then reboot (or restart legato) I find the foodir linked ( including bar file). ( I have to restart legato else my sandbox doesn’t detect any changes - restarting the app doesn’t change anything)
So If my foodir is empty the link isn’t created ?
How can I include it? because the files I try to include are created after legato starting.

Also,(correct me if I’m wrong) this means that sandboxed apps doesn’t include files out of sandbox dynamically (files and dirs. created by user or other apps after the legato start) ?
How can this be fixed in order to include empty dirs. and then files without restarting the board/Legato?

My target is : ar758x
Legato version : 17.05

Thank you.

Part of your problem might be Legato’s treatment of the /home directory. When Legato launches, it mounts its own /mnt/flash/home directory onto /home, effectively hiding your /home/foodir directory. When the box reboots, you can see the directory again (as long as you don’t run Legato).

Put your directory somewhere else, and you’ll be okay. I recommend not using /tmp, again because of some Legato behaviors. Use /opt, perhaps.

I’m in read only, so I cannot use /opt. But this legato behavior exists also with created dirs./files under /var/run directory.
Is there anyway to resolve this problem in order to include empty dirs or files under /tmp and include them in my sandbox (dynamically, without restarting legato fwk each time I want to include a dir/file)?

Can you paste the relevant section from your ADEF file here?