# Bundle required files

**URL:** <https://forum.legato.io/t/bundle-required-files/6406>\
**Category:** Legato Application Framework\
**Created:** [January 25, 2023, 8:09am UTC](https://forum.legato.io/t/bundle-required-files/6406 "2023-01-25T08:09:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HudriWudri](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@HudriWudri](https://forum.legato.io/u/HudriWudri)\
**Post date:** [January 25, 2023, 8:09am UTC](https://forum.legato.io/t/bundle-required-files/6406/1 "2023-01-25T08:09:43Z")

</div>

Hello, we would like to bundle all the required files for an app or several apps into the app package. I found the bundle option for the .cdef, however, this command copies the required files only to the app’s folder but we need some files directly in the /home/root folder since more than one app need access to it. Are there options to do that? BR

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [January 25, 2023, 9:16am UTC](https://forum.legato.io/t/bundle-required-files/6406/2 "2023-01-25T09:16:37Z")

</div>

Does this help?

> [@Opening Files in Sandboxed App](https://forum.legato.io/t/opening-files-in-sandboxed-app/5525):
>
> Quick question: I created a file in /tmp on my WP8548: /tmp/test.txt How do i access it in my Sandboxed app? I tried adding requires: { file: { /tmp/test.txt /tmp } } But i still cannot open it.

Or you can use unsandboxed app

Or you can refer to this sample app

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/httpGet/httpGet.adef>

---

<div class="post-metadata">

**Author:** ![HudriWudri](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@HudriWudri](https://forum.legato.io/u/HudriWudri)\
**Post date:** [January 25, 2023, 10:39am UTC](https://forum.legato.io/t/bundle-required-files/6406/3 "2023-01-25T10:39:21Z")

</div>

Accessing the files is not the problem but bundling them with the package. I don’t want to copy all those required files separately or with a script on to the device but have them added when I install the app.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [January 25, 2023, 11:03am UTC](https://forum.legato.io/t/bundle-required-files/6406/4 "2023-01-25T11:03:07Z")

</div>

You mean like this one?

> <https://github.com/legatoproject/legato-af/blob/master/apps/test/audio/audioPlaybackRec/audioPlaybackRec.adef>

---

<div class="post-metadata">

**Author:** ![HudriWudri](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@HudriWudri](https://forum.legato.io/u/HudriWudri)\
**Post date:** [January 25, 2023, 11:22am UTC](https://forum.legato.io/t/bundle-required-files/6406/5 "2023-01-25T11:22:37Z")

</div>

Yes, but this bundles the files directly into the app folder. I need some of them in the /home/root folder outside of the app folders.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [January 25, 2023, 11:28am UTC](https://forum.legato.io/t/bundle-required-files/6406/6 "2023-01-25T11:28:50Z")

</div>

I don’t see method other than calling a script in unsandboxed app to write to that folder

> [@Bundle file outside sandbox](https://forum.legato.io/t/bundle-file-outside-sandbox/4399/5):
>
> My app is unsandboxed. sandboxed: false bundles: { file: { data.txt /mnt/userrw/ } } but file is created at /legato/systems/current/appsWriteable/myApp/mnt/userrw/data.txt and not at /mnt/userrw/data.txt Is it possible to do with .adef file so I can directly write outside or I have to rely on copying file from /legato/systems/current/appsWriteable/myApp/mnt/userrw/data.txt to /mnt/userrw/data.txt ?

---

<div class="post-metadata">

**Author:** ![HudriWudri](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@HudriWudri](https://forum.legato.io/u/HudriWudri)\
**Post date:** [January 27, 2023, 5:50am UTC](https://forum.legato.io/t/bundle-required-files/6406/7 "2023-01-27T05:50:52Z")

</div>

I found a workaround. All files that are required by only one app can (obviously) be bundled with that app. For all other files an unsandboxed app with which the other files were bundled is started. This app then creates or copies the corresponding files to the home directory. However, a restart is required to satisfy Legato’s requirements for an app which are defined in the .adef or .cdef. Is there an API to restart the Sierra Wireless module from within an app?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [January 27, 2023, 5:55am UTC](https://forum.legato.io/t/bundle-required-files/6406/8 "2023-01-27T05:55:52Z")

</div>

you can see here:

> [@Reset modem API function](https://forum.legato.io/t/reset-modem-api-function/3233/6):
>
> Hi. I too needed this some time ago and implemented it much like @jyijyi using faultAction: reboot in the adef file. It has the added benefit of allowing the app to run sandboxed and let the supervisor deal with fault recovery. I went a step further and bundled this functionality up in a separate app with the intention of adding more “custom” APIs for other system functions I might need available to any app running on my system. Basically, my utility app .c file consisted of something like th…
