Difference between revisions of "User:Spramanik"

From Gumstix User Wiki
Jump to: navigation, search
Line 206: Line 206:
 
</UL>
 
</UL>
 
This will print out “hello world!”
 
This will print out “hello world!”
 +
 +
<H2>Running on Verdex Pro</H2>
 +
The previous instructions will cause problems using Ubuntu8.10 when getting the basic image built.  There is a workaround by installing the old version of gcc, but as this caused other problems, I regressed to Ubuntu 8.4.  Here is how I got the image built to install on the Verdex Pro. Ensure you follow the note at the top of the page and switch the bash pointer.
 +
 +
Dependencies
 +
<UL>
 +
<LI>Follow the Previous instruction on installing Ubuntu, but install version 8.4 
 +
<LI> You can setup your own password during installation
 +
<LI> Then follow the instructions to download and install the dependencies, but don't download bitbake yet
 +
</UL>
 +
 +
Setup
 +
<UL>
 +
<LI> Go back to your home folder
 +
<LI> $mkdir gumstix
 +
<LI> $cd gumstix
 +
<LI> $svn co https://gumstix.svn.sourceforge.net/svnroot/gumstix/trunk gumstix-oe
 +
</UL>
 +
 +
This can take a little bit to download. Once its done then do the following:
 +
<UL>
 +
<LI> $cat gumstix-oe/extras/profile >> ~/.bashrc
 +
<LI> $ sudo groupadd oe
 +
<LI> $ sudo usermod -a -G oe your_username
 +
<LI> $ sudo mkdir /usr/share/sources
 +
<LI> $ sudo chgrp oe /usr/share/sources
 +
<LI> $ sudo chmod 0775 /usr/share/sources
 +
<LI> $ sudo chmod ug+s /usr/share/sources
 +
</UL>
 +
I found that I had to change some permissions on folders in order to get everything to run. Make sure that you have full permission to the gumstix folder without having to sudo. Then do the following
 +
 +
<UL>
 +
<LI> $bitbake gumstix-basic-image
 +
</UL>
 +
 +
On my Acer this build took almost 8 hours, so don't panic if it seems to hang at some points.  There were some points in which my machine would try to connect to the repositories to download info and it would have to try several times, which obviously added time to the build.
 +
 +
When the build is done and you are back at your prompt:
 +
<UL>
 +
<LI> ls ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/
 +
</UL>
 +
This will show you several files. You want to ensure that you have the following files:
 +
<UL>
 +
<LI>gumstix-basic-image-gumstix-custom-verdex.jffs2
 +
<LI> uImage-2.6.22-r1-gumstix-custom-verdex.bin
 +
</UL>
 +
 +
These are the files you will be shooting over to the verdex pro. Now you have to setup Kermit:
 +
<UL>
 +
<LI> $ sudo apt-get install ckermit
 +
</UL>
 +
Then create a script in your home directory (it doesn't really matter where, just somewhere you can get to it easily)
 +
Add the following and make sure to change the take line to match your path:
 +
 +
#!/usr/bin/kermit +
 +
kermit -l /dev/ttyUSB0
 +
set speed 115200
 +
set reliable
 +
fast
 +
set carrier-watch off
 +
set flow-control none
 +
set prefixing all
 +
set file type bin
 +
set rec pack 4096
 +
set send pack 4096
 +
set window 5
 +
take /home/yourname/gumstix/gumstix-oe/extras/kermit-setup
 +
connect
 +
 +
 +
  
  

Revision as of 10:58, 24 March 2009

Bitbake on Ubuntu

Getting Started

  1. Download Ubuntu from: [1]
  2. Burn ISO Image to a disk
  3. Put Disk into machine of your choice (These examples are run on an Acer Aspire Model: KAW60)
  4. Install Ubuntu from Disk

Once Ubuntu is up and running Type:

  • $ sudo passwd
  • $ yourpassword

Configure internet access using:

  • $ ifconfig eth0 xxx.xxx.xxx.xxx OR
  • $ net-setup

Note: On the Acer, Ubuntu automatically connected Note: Every command run with sudo will require yourpassword in order to run Note: Most likely /bin/sh is linked to /bin/dash. If so, then change /bin/sh to link to /bin/bash. If you don't this could cause file corruption and the build image wont work! Run "sudo dpkg-reconfigure dash" and select "no" on the screen when given the option to install dash as /bin/sh.


Dependencies

There are a couple of dependencies which must be installed first:

  • Monotone (or bitkeeper, but I used monotone) <UL="circle">
  • This requires that Boost is installed
  • Pyscho JIT Compiler
  • Python compiler (should come with OS) Download These from [2] [3] [4] </UL> Create a directory under your home directory called slug
    • $cd /home/yourname
    • $mkdir slug

    Place all of the downloaded files into this directory and extract them. Either by right clicking and choosing extract OR

    • $ gunzip –d name followed by $ tar –xfv name

    Monotone

    Monotone will not install without other dependencies. Run the following:

    • $ sudo apt-get install autoconf
    • $ sudo apt-get install automake
    • $ sudo apt-get install gettext
    • $ sudo apt-get install libboost-dev
    • $ sudo apt-get install libz-dev
    • $ sudo apt-get install g++

    Run the commands:

    • $ cd boost_1_38_0
    • $ ./configure
    • $ make install
    • $ sudo apt-get install python
    • $ sudo apt-get install make
    • $ sudo apt-get install subversion
    • $ sudo apt-get install psycho OR
    • $ sudo python setup.py install
    • Ungunzip monotone-0.42
    • $ cd monotone-0.42
    • $ sudo ./configure
    • $sudo apt-get install monotone

    To Configure Monotone:

    Create a configure script in /home/yourname/slug if one is not created. Include the following lines in the script:

    $aclocal-1.9&&autoreconf –install $AUTOMAKE=automake-1.9 ACLOCAL=aclocal-1.9 autoreconf install

    Download automake1.9 (if not installed) from [5] Extract and run

    • $sudo apt-get install automake1.9

    Then run

    • $sudo ./configure

    To fetch the monotone sources run:

    • mtn --db=mt.mtn db init
    • mtn --db=mt.mtn pull monotone.ca “net.venge.monotone*”
    • mtn --db=mt.mtn --branch=net.venge.mnotone checkout monotone-sources

    Getting Bitbake

    You can either download bitbake from: [6]

    OR go into /home/yourname/slug and run:
    

    Additional help can be found at:

      [7] If you downloaded bitbake, then save and extract the files in /home/yourname/slug cd into the bitbake directory You can either run:
    • $sudo apt-get install bitbake OR
    • $ sudo ./setup.py install --prefix=/usr/local

    Run the following:

    • $sudo mkdir openembedded
    • $cd openembedded
    • $sudo mkdir packages
    • $cd packages
    • $sudo mkdir file
    • $cd file

    Create the following files

    Set-env

    OEROOT="/home/yourname/slug" OESYS=$OEROOT/bitbake-1.8.12 PKGDIR=$OEROOT/openembedded OEBUILD=$OEROOT/build BBPATH=$OEBUILD:$PKGDIR:$OESYS PATH=$OESYS/bin:$PATH cd $OEBUILD LD_LIBRARY_PATH= export PATH LD_LIBRARY_PATH BBPATH export LANG=C unset LC_CTYPE unset CC unset CXX alias bb=bitbake echo "Environment set up for OpenEmbedded development."

    Local.conf

    OEROOT = "/home/yourname/slug" DL_DIR = "${OEROOT}/sources" BBFILES = ${OEROOT}/bitbake-1.8.12/openembedded/packages/*/*.bb BBPATH = ${OEROOT}/bitbake-1.8.12 OEMASK = "" PREFERRED_PROVIDERS = " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross" MACHINE = "nslu2" DISTRO = "unslung" OEINCLUDELOGS = "yes"

    Hello-1.0.bb

    DESCRIPTION = "hello world sample program"PR = "r0"DEPENDS = ""SRC_URI = "file://hello.c"S = "${WORKDIR}"do_compile () { ${CC} ${CFLAGS} ${LDFLAGS} -o hello hello.c}do_install () { install -d ${D}${bindir}/ install -m 0755 ${S}/hello ${D}${bindir}/}FILES_${PN} = "${bindir}/hello"

    Hello.c

    #include "stdio.h“ main(){ printf("Hello World\n");}

    Where to put the files:

    • /home/yourname/slug/set-env
    • /home/yourname/slug/bitbake-1.8.12/openembedded/packages/hello-1.0.bb
    • /home/yourname/slug/bitbake-1.8.12/openembedded/packages/file/hello.c
    • /home/yourname/slug/bitbake-1.8.12/conf/local.conf

    In the bitbake.conf file – located in the conf folder, ensure that OEDIR is set to: /home/yourname/slug Also ensure that you change the path in the files you just created to match your directory structure


    In /home/yourname/slug run:

    • $sudo ./set-env

    This sets up the openembedded environment which is needed to finish running everything from bitbake

    Building Hello World

    Once all files are in the correct place and the dependencies are installed, run the following:

    • $cd /home/yourname/slug/bitbake-1.8.12/openembedded/packages
    • $bitbake world OR
    • $bitbake –b hello

    World will build everything in the folder -b hello will only build the hello package

    • $sudo apt-get install hello
    • $hello

    This will print out “hello world!”

    Running on Verdex Pro

    The previous instructions will cause problems using Ubuntu8.10 when getting the basic image built. There is a workaround by installing the old version of gcc, but as this caused other problems, I regressed to Ubuntu 8.4. Here is how I got the image built to install on the Verdex Pro. Ensure you follow the note at the top of the page and switch the bash pointer.

    Dependencies

    • Follow the Previous instruction on installing Ubuntu, but install version 8.4
    • You can setup your own password during installation
    • Then follow the instructions to download and install the dependencies, but don't download bitbake yet

    Setup

    This can take a little bit to download. Once its done then do the following:

    • $cat gumstix-oe/extras/profile >> ~/.bashrc
    • $ sudo groupadd oe
    • $ sudo usermod -a -G oe your_username
    • $ sudo mkdir /usr/share/sources
    • $ sudo chgrp oe /usr/share/sources
    • $ sudo chmod 0775 /usr/share/sources
    • $ sudo chmod ug+s /usr/share/sources

    I found that I had to change some permissions on folders in order to get everything to run. Make sure that you have full permission to the gumstix folder without having to sudo. Then do the following

    • $bitbake gumstix-basic-image

    On my Acer this build took almost 8 hours, so don't panic if it seems to hang at some points. There were some points in which my machine would try to connect to the repositories to download info and it would have to try several times, which obviously added time to the build.

    When the build is done and you are back at your prompt:

    • ls ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/

    This will show you several files. You want to ensure that you have the following files:

    • gumstix-basic-image-gumstix-custom-verdex.jffs2
    • uImage-2.6.22-r1-gumstix-custom-verdex.bin

    These are the files you will be shooting over to the verdex pro. Now you have to setup Kermit:

    • $ sudo apt-get install ckermit

    Then create a script in your home directory (it doesn't really matter where, just somewhere you can get to it easily) Add the following and make sure to change the take line to match your path:

    1. !/usr/bin/kermit +

    kermit -l /dev/ttyUSB0 set speed 115200 set reliable fast set carrier-watch off set flow-control none set prefixing all set file type bin set rec pack 4096 set send pack 4096 set window 5 take /home/yourname/gumstix/gumstix-oe/extras/kermit-setup connect



    Other Factors

    These instructions will change depending on the OS being used. Tutorial was based on information from: [8]For More information please see the above mentioned site

    Question / Comments

    For other questions, comments, or if you find anything incorrect, please contact me at:

    Sarah Pramanik - sarah.pramanik@gmail.com