Difference between revisions of "HelloWorld Examples"
From Gumstix User Wiki
Ashcharles (Talk | contribs) |
Ashcharles (Talk | contribs) |
||
Line 2: | Line 2: | ||
==Hello World== | ==Hello World== | ||
− | The | + | The git repository given below contains a user.collections directory complete with a number of sample helloworld recipes elucidating different use cases. An explanation for each is given below: |
<table> | <table> | ||
<tr> | <tr> | ||
Line 20: | Line 20: | ||
</tr> | </tr> | ||
</table> | </table> | ||
+ | |||
==Usage== | ==Usage== | ||
− | # | + | # Clone this git repository from your top-level OE directory. For the sake of these instructions, we assume this is '~/overo-oe'. |
− | #:<pre>$ | + | #:<pre>$ ~/overo-oe/ </pre> |
+ | #:<pre>$ git clone git://github.com/ashcharles/oe-usercollection.git user.collection</pre> | ||
+ | #:'''Note:''' If you already have a ''user.collection'' director, you might like to clone the repository by its default name (oe-usercollection) and then let bitbake know about this folder: | ||
+ | #:<pre>$ ~/overo-oe/ </pre> | ||
+ | #:<pre>$ git clone git://github.com/ashcharles/oe-usercollection.git</pre> | ||
+ | #:Edit the ''~/overo-oe/build/conf/site.conf'' file so Bitbake know about this new directory.</pre> | ||
# Bitbake the desired recipe based on its recipe name e.g. ''bitbake myhello-cpp'' | # Bitbake the desired recipe based on its recipe name e.g. ''bitbake myhello-cpp'' | ||
# Copy the newly created package file from your build machine to your Gumstix. You might do this by transfering the files on microSD card, using a serial connection, or, most simply, copying them over an internet connection. E.g. | # Copy the newly created package file from your build machine to your Gumstix. You might do this by transfering the files on microSD card, using a serial connection, or, most simply, copying them over an internet connection. E.g. | ||
Line 31: | Line 37: | ||
#:<pre>Hello world! </pre> | #:<pre>Hello world! </pre> | ||
− | There are lots of use cases not covered here, feel free to add new or request new ones | + | There are lots of use cases not covered here, feel free to add new or request new ones (ash (AT) gumstix (DOT) com) |
==Helpful Links== | ==Helpful Links== | ||
* http://docs.openembedded.org/usermanual/usermanual.html#recipes_helloworld_example | * http://docs.openembedded.org/usermanual/usermanual.html#recipes_helloworld_example | ||
* http://www.gumstix.net/User-How-To-s/view/Build-system-overview/Hello-world-tutorial/110.html | * http://www.gumstix.net/User-How-To-s/view/Build-system-overview/Hello-world-tutorial/110.html |
Revision as of 11:26, 9 March 2010
The OpenEmbedded (OE) manual introduces Bitbake recipes using a single 'helloworld' tutorial. While this is a useful introduction, there are many other common use cases.
Hello World
The git repository given below contains a user.collections directory complete with a number of sample helloworld recipes elucidating different use cases. An explanation for each is given below:
Recipe: | Description: | Command: | |
---|---|---|---|
myhelloworld | vanilla OE helloworld tutorial | myhelloworld | |
myhello-cpp | a simple C++ recipe | myhello-cpp | |
myhello-make | a recipe that uses a Makefile | myhello-make | |
myhello-cmake | a recipe that uses cmake and creates a library | myhello-cmake | |
myhello-python | a rather trivial python recipe | myhello-python | |
myhello-git | shows git fetcher and patching | myhello-git |
Usage
- Clone this git repository from your top-level OE directory. For the sake of these instructions, we assume this is '~/overo-oe'.
$ ~/overo-oe/
$ git clone git://github.com/ashcharles/oe-usercollection.git user.collection
- Note: If you already have a user.collection director, you might like to clone the repository by its default name (oe-usercollection) and then let bitbake know about this folder:
$ ~/overo-oe/
$ git clone git://github.com/ashcharles/oe-usercollection.git
- Edit the ~/overo-oe/build/conf/site.conf file so Bitbake know about this new directory.</pre>
- Bitbake the desired recipe based on its recipe name e.g. bitbake myhello-cpp
- Copy the newly created package file from your build machine to your Gumstix. You might do this by transfering the files on microSD card, using a serial connection, or, most simply, copying them over an internet connection. E.g.
$ scp ~/overo-oe/tmp/deploy/glibc/ipk/armv5te/myhelloworld_0.0.1-r0.5_armv5te.ipk root@mygumstixcom:~
- Install your package and test it out:
> opkg install myhelloworld_0.0.1-r0.5_armv5te.ipk
> myhelloworld
Hello world!
There are lots of use cases not covered here, feel free to add new or request new ones (ash (AT) gumstix (DOT) com)