2010-06-10 18:23:37     Adding Lua and common modules to uClinux?

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-06-10 18:23:37     Adding Lua and common modules to uClinux?

Gilles Ganault (FRANCE)

Message: 90251   

 

Hello

 

Apparently, the Lua that comes with the uClinux source code is just the interpreter, while I need some common modules like LuaSocket, LuaSQL + SQLite, etc.

 

Has someone already succeeded in compiling those modules for the Blackfin (BF532) and included them into uClinux to build an image ready to be downloaded in eg. the Atcom IP01 appliance?

 

Thank you.

QuoteReplyEditDelete

 

 

2010-06-11 10:11:48     Re: Adding Lua and common modules to uClinux?

Rob Maris (GERMANY)

Message: 90264   

 

Gilles,

 

I'm not sure, but perhaps you can get some useful information regarding compiling those modules on this embedded lua page:

 

  www.eluaproject.net/

 

I'd believe that thost modules would compile fine with blackfin, since lua is very portable, and so the add-ons should, too. Simply start to try compilng it as if you would compile a Linux app, apart from the kernel - at least for quick feasibility check. I hope that standard linux header files will do for the socket resources.

 

You could copy the compiled binaries in the target's lua directory or put it in romfs.

 

LuaSocket would be a fine add-on.

 

-Rob

QuoteReplyEditDelete

 

 

2010-06-11 11:08:35     Re: Adding Lua and common modules to uClinux?

Gilles Ganault (FRANCE)

Message: 90266   

 

Thanks Rob for the feedback. I'll investigate and see if I can compile some modules and somehow integrate them into a uClinux image.

QuoteReplyEditDelete

 

 

2010-06-11 11:25:12     Re: Adding Lua and common modules to uClinux?

Robin Getz (UNITED STATES)

Message: 90267   

 

Rob/Gilles:

 

If you let me know which are the common Lua modules you need - I can add them to the dist for the next release.

 

-Robin

QuoteReplyEditDelete

 

 

2010-06-24 16:53:57     Re: Adding Lua and common modules to uClinux?

Gilles Ganault (FRANCE)

Message: 90608   

 

Thanks Robin.

 

I know very little about Lua yet, but I need at least the following modules to write the scripts I have in mind to be used with Asterisk/AGI:

 

 

    LuaSocket

    LuaSQL + SQLite3

 

 

eLua was built to run on embedded platforms, so would seem like a better candidate for inclusion in uClinux-dist than the regular flavor, but eLua "strives to offer the same features as the desktop version of Lua, complementing them with specific features for embedded use and discarting the need of an operating system running on the microcontrollers." (source)

 

Thank you.

QuoteReplyEditDelete

 

 

2010-10-10 13:52:02     Re: Adding Lua and common modules to uClinux?

Rob Maris (GERMANY)

Message: 94386   

 

Luasocked is added. Potential committers to trunk: please check second patch. The first patch simply represents the original luasocket source as inserted in lib/.

 

According to the second patch I have momentarily assumed that luasocket is always built when lua is selected. Shoudn't be a problem, since socket library is quite small and is ought to be used "always".

QuoteReplyEditDelete

 

 

2010-10-10 13:53:45     Re: Adding Lua and common modules to uClinux?

Rob Maris (GERMANY)

Message: 94387   

 

The patches...

 

luasocket_add.patch

luasocket.patch

QuoteReplyEditDelete

 

 

2010-10-27 12:55:28     Re: Adding Lua and common modules to uClinux?

Gilles Ganault (FRANCE)

Message: 95326   

 

Thanks Rob, I'll check it out.

 

Generally speaking...

 

1. Why are patches used in uClinux-dist? To make it easier to add an x86 Linux application by just adding the original source code and providing patch files that will tweak the source code to be uClinux-compatible?

 

2. Is there a HOWTO that explains how to go from "Hello, world" to an integrated application in uClinux-dist, including how to modify its Makefile, adding this package in menuconfig, etc.

 

Thank you.

QuoteReplyEditDelete

 

 

2010-10-27 13:30:06     Re: Adding Lua and common modules to uClinux?

Mike Frysinger (UNITED STATES)

Message: 95327   

 

please search the wiki:

  docs.blackfin.uclinux.org/doku.php?id=adding_user_applications

QuoteReplyEditDelete

 

 

2010-11-01 16:40:03     Re: Adding Lua and common modules to uClinux?

Gilles Ganault (FRANCE)

Message: 95453   

 

Thanks Mike. For those looking for the same thing, there are a few articles to shed some light about adding applications to the uClinux-dist tree:

 

  docs.blackfin.uclinux.org/doku.php?id=uclinux_on_blackfin

 

  docs.blackfin.uclinux.org/doku.php?id=application_development

QuoteReplyEditDelete

 

 

2010-11-02 17:17:19     Re: Adding Lua and common modules to uClinux?

Rob Maris (GERMANY)

Message: 95494   

 

Gilles,

 

I see that you have "found" my contribution. Please also refer to

 

  blackfin.uclinux.org/gf/forummessage/94388

 

where you also also have put an inquiry in july. My response there documents a short test with luasocket. Regarding the patches: If there is some confusion about it, don't hesitate to ask, or: did you get it working with luasocket?

QuoteReplyEditDelete

 

 

2010-11-12 09:46:57     Re: Adding Lua and common modules to uClinux?

Gilles Ganault (FRANCE)

Message: 95803   

 

Thanks Robin. I downloaded the nightly build and noticed that Luasocket isn't part of it, so checked the two patches but... I've never used patches and don't know what to do with them. I read the two patches and they seem to include changes to several files (Makefile.local, Makefile, config, etc.) What is the right way to apply patches? Do I just un packet the Luasocket source code, copy the two patches, run "patch", and expect the files to be updated accordingly?

 

Out of curiosity, how did you go about making changed to Luasocket so that it would be compiled into a uClinux-dist image? Do you go through the source code, looking for instructions that are known to work in x86 but not on an MMU-less CPU like the Blackfin, and find a way to rewrite them?

 

Thank you.

QuoteReplyEditDelete

 

 

2010-11-12 10:21:23     Re: Adding Lua and common modules to uClinux?

Rob Maris (GERMANY)

Message: 95804   

 

Gilles, I didn't consider cases where folks arn't using git. The patches are created using git. Apply without git, from the uclinux-dist directory:

 

patch -p1 < luasocket_add.patch

 

(adds luasocket in lib/)

 

patch -p1 < luasocket.patch)

 

(adds modifications to build tree)

 

 

Remark: with an appropriate viewer (e.g. KDE's kompare), diff files can be viewed very comfortably as side-by-side views. This helps understand the patches, e.g. regarding your question how it is integrated in uClinux build process (make file patch).

 

-Rob

QuoteReplyEditDelete

 

 

2010-11-12 17:32:13     Re: Adding Lua and common modules to uClinux?

Gilles Ganault (FRANCE)

Message: 95808   

 

Thanks for the tip. The source tree was patched OK.

Attachments

    Outcomes