how do you include a lua file as part of the binary image that you flash to a board.

classic Classic list List threaded Threaded
2 messages Options
james osburn james osburn
Reply | Threaded
Open this post in threaded view
|

how do you include a lua file as part of the binary image that you flash to a board.

I would like to have a like a file as part of the binary image.
is that possible. or is this done post elua binary image install.
also isnt there a way to start running a lua file as part of the
board startup?
james

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Dado Sutter Dado Sutter
Reply | Threaded
Open this post in threaded view
|

Re: how do you include a lua file as part of the binary image that you flash to a board.

Hello,

On Thu, Nov 10, 2011 at 01:27, james osburn <[hidden email]> wrote:
> I would like to have a like a file as part of the binary image.
> is that possible. or is this done post elua binary image install.
> also isnt there a way to start running a lua file as part of the
> board startup?

Both of your requirements are supported by eLua.
To have your file as part of the binary image, you need to include it
on the ROM File System. This can be done at compile time, adding your
file to the romfs folder (and a little extra configuration for now).
This is (a bit superficially) explained at
http://wiki.eluaproject.net/eLua%20File%20Systems and in more detail
at http://www.eluaproject.net/doc/v0.8/en_filesystems.html

Another (easier) way, using the eLua Web Builder
(builder.eluaproject.net), which allows you to upload your files to a
personal area of your account and then select which files will be part
or not of your eLua builds.
We'll be ready to help you with any of your choice.

In both cases, files can be added to the binary image in three
different options:
- Verbatim: Files are added as is
- Compressed: Files are added in source-code format (compiled at run
time) but the source is compressed to save space.
- Compiled: Files are pre-compiled before being added to the binary
eLua image. This saves still more space and avoids the extra compile
step during the excecution. You loose the access to your source code
at run time though but this is generaly not a problem.
If you have enough space in your ROM, you can work in one "mode"
during development and then switch to a more optimized one on the
final production version.

About your last question, all you need is to name your file
"autorun.lua" (or autorun.lc in the case of a Lua pre compiled file),
to make it run automatically upon an eLua "boot" or reset.
When eLua starts, it checks to see if there is a file called
autorun.lua (or .lc) in one of our File Systems. In this case the
shell is not started and the program is immediately excecuted.
This is mentioned on the eLua Boot sequence at
http://www.eluaproject.net/doc/v0.8/en_arch_overview.html#boot

Dado







> james
>
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev