Category:How to - virtual machine
Here is a technote on how to setup the overo development environment using the 64-bit version of Fedora 12 on a virtual machine.
Total build time for omap3-console-image was 2 hours and 20 minutes, on a iMac 27" quad-core i7 2.8Ghz processor base system with 4GB RAM. The virtual machine was configured to use 4 CPUs, 2.5GB RAM and 200GB HDD (growable).
VMware Fusion cannot use more than 4 CPUs per VM, so I guess if someone were to run Linux native on a quad code, they would be able to utilize all 8 core and reduce the build times even further.
Contents
- 1 Overview
- 2 Procedure
- 2.1 Install Fedora 12 x86 64-bit into a VMware image.
- 2.2 Enable root login.
- 2.3 Install the vmware tools
- 2.4 Install Sun JDK 1.5 (optional, only required for android development, not yet validated)
- 2.5 Install Psyco JIT compiler (skip this step, doesn't work for 64-bits yet)
- 2.6 Download, build and install kermit
- 2.7 Setup the Overo build environment
- 2.7.1 Check out the OpenEmbedded build system.
- 2.7.2 Checkout BitBake.
- 2.7.3 Creating the OE configuration files and profile.
- 2.7.4 Setup source code caching.
- 2.7.5 Improve build performance by modifying site.conf to use multiple cores
- 2.7.6 Reduce disk space usage by modifying local.conf
- 2.7.7 Modify your .bashrc file.
- 2.7.8 Install additional packages required by BitBake.
- 2.8 Install additional packages required by Fedora 12 x86 64-bit.
- 2.9 Build a basic kernel and a non-gui root file system image in one step using the following command
- 2.10 Update the org.openembedded.dev sources at regular intervals by typing the following command
- 3 Related Links
Overview
This document describes how to setup a development environment for the Overo platform using a Fedora-12 x86 64-bit VMware image.
Procedure
Install Fedora 12 x86 64-bit into a VMware image.
Ensure that you install the following packages - development-libraries - development-tools
Create a new user group called ‘developers’.
Change the primary group for all developers to the ‘developers’ group, e.g. for user ‘elvis’, change the primary group to ‘developers’.
Enable root login.
Login as a regular user
$ su
- vi /etc/pam.d/gdm
Click ‘A’ and remove user!=root from the following line
auth required pam_succeed_if.so user!=root quiet
Click Esc and then type the following command :wq!
Now modify the gdm-password file
- vi /etc/pam.d/gdm-password
Click ‘A’ and remove user!=root from the following line
auth required pam_succeed_if.so user!=root quiet
Click Esc and then type the following command :wq!
Modify /etc/sysctl.conf to make vm.mmap_min_addr = 0.
- vi /etc/sysctl.conf
Add the following line to the sysctl.conf file vm.mmap_min_addr = 0
Relogin as root
Install the vmware tools
$ su
- cd Download/vmware-tools-distrib
- ./vmware-install.pl
You can run the VMware Tools by invoking the following command:
- /usr/bin/vmware-toolbox
To enable advanced X features
1. Manually start /user/bin/vmware-user
2. Log out and log back into your desktop session
3. Restart your X session
Install Sun JDK 1.5 (optional, only required for android development, not yet validated)
$ su
- cd Downloads/jdk-5u12-linux-i586
- ./jdk-5u12-linux-i586-rpm.bin
Install Psyco JIT compiler (skip this step, doesn't work for 64-bits yet)
Download Psyco JIT compiler sources from svn
$ svn co http://codespeak.net/svn/psyco/dist/ psyco-dist
Run the python installation script as a super user
$ su python setup.py install
Download, build and install kermit
$ cd /tool $ wget ftp://www.columbia.edu/kermit/test/tar/x.tar.gz $ tar zxvf x.tar.gz $ cd ckermit-9.0 $ make linux $ su
- make install
This will install kermit in /usr/local/bin/
Set the permissions for /dev/ttyUSB0, so that a developer can access the Overo USB console.
$ su
- chgrp developers /dev/ttyUSB0
Setup the Overo build environment
Check out the OpenEmbedded build system.
$ cd /tool $ mkdir overo-oe $ cd overo-oe $ git clone git://gitorious.org/gumstix-oe/mainline.git org.openembedded.dev $ cd org.openembedded.dev $ git checkout --track -b overo origin/overo
Checkout BitBake.
$ cd /tool/overo-oe $ git clone git://git.openembedded.org/bitbake.git $ cd bitbake $ git checkout -b 1.8 --track origin/1.8 $ cd ..
Creating the OE configuration files and profile.
We now will create a profile script and the configuration files required to tailor OE to our needs.
To make this a somewhat easier task, there is a template for the required files in the openembedded installation we just did.
Copy these files to your overo-oe directory:
$ cp -r org.openembedded.dev/contrib/gumstix/build .
If you have followed the example installation and placed the build system in overo-oe in your home directory, you are now ready to proceed to the next step. If you have installed the build system in a different location you will need to edit overo-oe/build/profile and change the definition of OVEROTOP as appropriate.
Setup source code caching.
As part of the build process OpenEmbedded downloads source code tarballs for the linux kernel, compiler, and other software packages.
By default this source code cache will be placed in overo-oe/sources. If you would like this cache to be located elsewhere, now is the time to edit build/conf/site.conf and set DL_DIR as appropriate.
For example, if you would like to cache the sources in /usr/share/sources, perform the following steps:
Add new group for cache management and add operating user to this group.
$ sudo groupadd oe $ sudo usermod -a -G oe {your_username}
Next make source code storing directory and set owner and permission appropriately.
$ sudo mkdir /usr/share/sources $ sudo chgrp oe /usr/share/sources $ sudo chmod 0775 /usr/share/sources $ sudo chmod ug+s /usr/share/sources
Edit the buid/conf/site.conf and set DL_DIR to /usr/share/sources as follows:
DL_DIR = "/usr/share/sources"
Improve build performance by modifying site.conf to use multiple cores
Edit build/conf/site.conf
PARALLEL_MAKE = "-j 6" BB_NUMBER_THREADS = "6"
Reduce disk space usage by modifying local.conf
If you don't need OE to keep around the package source files (and other work files), you can add the following entry to your local.conf:
INHERIT += "rm_work"
This will significantly reduce the amount of disk space used.
Modify your .bashrc file.
- .bashrc
- Source global definitions
if [ -f /etc/bashrc ]; then . /etc/bashrc fi
- User specific aliases and functions
- Environment setup for java
export JAVA_HOME="/usr/java/jdk1.5.0_12" export PATH="${JAVA_HOME}/bin:$PATH"
- end java setup
- Environment setup for oe
export BB_ENV_EXTRAWHITE="MACHINE DISTRO ANGSTROM_MODE OVEROTOP OEBRANCH USERBRANCH"
export OVEROTOP="/tool/overo-oe" export OEBRANCH="${OVEROTOP}/org.openembedded.dev" export USERBRANCH="${OVEROTOP}/user.collection"
export CROSSCOMPILER="armv7a" export PATH="${OVEROTOP}/bitbake/bin:${OVEROTOP}/tmp/cross/${CROSSCOMPILER}/bin:$PATH" export BBPATH="${OVEROTOP}/build:${USERBRANCH}:${OEBRANCH}"
umask 0002
- end oe setup
- Environment setup for android
export REPOTOP="/tool/script" export ANDROID_JAVA_HOME=$JAVA_HOME export ANDROID_TOP="/tool/android" export ANDROID_HOST="linux-x86" export ANDROID_HOST_TOOLS="${ANDROID_TOP}/out/host/${ANDROID_HOST}/bin" export PATH="${REPOTOP}:${ANDROID_HOST_TOOLS}:$PATH"
- end android setup
Install additional packages required by BitBake.
$ su
- yum install help2man
- yum install texi2html
Install additional packages required by Fedora 12 x86 64-bit.
$ su
- yum install glibc-static
Build a basic kernel and a non-gui root file system image in one step using the following command
$ bitbake omap3-console-image $ bitbake x-load $ bitbake u-boot-omap3
Additional bitbake recipies can be found in org.openembedded.dev/packages/image
$ bitbake omap3-desktop-image $ bitbake omap3-udesktop-image
If BitBake complains about the mmap_min_addr not being set to 0, type the following :
$ su
- echo “0” > /proc/sys/vm/mmap_min_addr
Update the org.openembedded.dev sources at regular intervals by typing the following command
$ cd org.openembedded.dev $ git pull
Related Links
01. [How to install OpenEmbedded and Bitbake - PIXHAWK. http://pixhawk.ethz.ch/tutorials/omap/openembedded_bitbake_installation]
02. [Quick Command Reference for OE - PIXHAWK. http://pixhawk.ethz.ch/tutorials/omap/command_reference]
03. [Git cheat sheet - Zack Rusin. http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html]
This category currently contains no pages or media.