Difference between revisions of "HelloWorld Examples"

From Gumstix User Wiki
Jump to: navigation, search
Line 2: Line 2:
  
 
==Hello World==
 
==Hello World==
The tar file attached [file://user.collection.tar.gz here] contains a user.collections directory complete with a number of sample helloworld recipes elucidating different use cases.  An explanation for each is given below:
+
The tar file attached [http://dl.dropbox.com/u/211887/myhelloworld.tar.gz here] 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 21: Line 21:
 
</table>
 
</table>
 
==Usage==
 
==Usage==
# [file://file.tar.gz Download] and untar this folder in your top-level OE direvictory.  For the sake of these instructions, we assume this is '~/overo-oe'.
+
# [http://dl.dropbox.com/u/211887/myhelloworld.tar.gz Download] and untar this folder in your top-level OE direvictory.  For the sake of these instructions, we assume this is '~/overo-oe'.
 
#:<pre>$ tar xzf file.tar.gx -C ~/overo-oe/ </pre>
 
#:<pre>$ tar xzf file.tar.gx -C ~/overo-oe/ </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''

Revision as of 15:57, 3 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 tar file attached here 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:
myhelloworldvanilla OE helloworld tutorialmyhelloworld
myhello-cppa simple C++ recipemyhello-cpp
myhello-makea recipe that uses a Makefilemyhello-make
myhello-cmakea recipe that uses cmake and creates a librarymyhello-cmake
myhello-pythona rather trivial python recipemyhello-python
myhello-gitshows git fetcher and patchingmyhello-git

Usage

  1. Download and untar this folder in your top-level OE direvictory. For the sake of these instructions, we assume this is '~/overo-oe'.
    $ tar xzf file.tar.gx -C ~/overo-oe/ 
  2. Bitbake the desired recipe based on its recipe name e.g. bitbake myhello-cpp
  3. 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:~ 
  4. 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.

Helpful Links