Difference between revisions of "Category:How to - virtual machine"

From Gumstix User Wiki
Jump to: navigation, search
(Created page with 'Hi, Here is a technote on how to setup the overo development environment using the 64-bit version of Fedora 12. Total build time for omap3-console-image was 2 hours and …')
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Hi,
+
Here is a technote on how to setup the overo development environment using the 64-bit version of Fedora 12 on a virtual machine.
      Here is a technote on how to setup the overo development environment using the 64-bit version of Fedora 12.  
+
  
 
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).
 
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).
Line 6: Line 5:
 
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.  
 
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.  
  
Overview
+
=Overview=
  
 
This document describes how to setup a development environment for the Overo platform using a Fedora-12 x86 64-bit VMware image.
 
This document describes how to setup a development environment for the Overo platform using a Fedora-12 x86 64-bit VMware image.
  
Procedure
+
=Procedure=
  
Step 01.00: Install Fedora 12 x86 64-bit into a VMware image.
+
==Install Fedora 12 x86 64-bit into a VMware image.==
  
 
Ensure that you install the following packages
 
Ensure that you install the following packages
Line 22: Line 21:
 
Change the primary group for all developers to the ‘developers’ group, e.g. for user ‘elvis’, change the primary group to ‘developers’.
 
Change the primary group for all developers to the ‘developers’ group, e.g. for user ‘elvis’, change the primary group to ‘developers’.
  
Step 02.00: Enable root login.
+
==Enable root login.==
  
Step 02.01: Login as a regular user
+
===Login as a regular user===
  
 
$ su
 
$ su
Line 45: Line 44:
 
Click Esc and then type the following command :wq!
 
Click Esc and then type the following command :wq!
  
Step 02.03: Modify /etc/sysctl.conf to make vm.mmap_min_addr = 0.
+
===Modify /etc/sysctl.conf to make vm.mmap_min_addr = 0.===
  
 
# vi /etc/sysctl.conf
 
# vi /etc/sysctl.conf
Line 52: Line 51:
 
vm.mmap_min_addr = 0
 
vm.mmap_min_addr = 0
  
Step 02.03: Relogin as root
+
===Relogin as root===
  
  
Step 03.00: Install the vmware tools
+
==Install the vmware tools==
  
 
$ su
 
$ su
Line 73: Line 72:
  
  
Step 04.00: Install Sun JDK 1.5 (optional, only required for android development, not yet validated)
+
==Install Sun JDK 1.5 (optional, only required for android development, not yet validated)==
  
 
$ su
 
$ su
Line 80: Line 79:
  
  
Step 05.00: Install Psyco JIT compiler (skip this step, doesn't work for 64-bits yet)
+
==Install Psyco JIT compiler (skip this step, doesn't work for 64-bits yet)==
  
Step 05.01: Download Psyco JIT compiler sources from svn
+
===Download Psyco JIT compiler sources from svn===
  
 
$ svn co http://codespeak.net/svn/psyco/dist/ psyco-dist
 
$ svn co http://codespeak.net/svn/psyco/dist/ psyco-dist
  
Step 05.02: Run the python installation script as a super user  
+
===Run the python installation script as a super user===
  
 
$ su python setup.py install
 
$ su python setup.py install
  
  
Step 06.00: Download, build and install kermit
+
==Download, build and install kermit==
  
 
$ cd /tool
 
$ cd /tool
Line 109: Line 108:
  
  
Step 07.00: Setup the Overo build environment
+
==Setup the Overo build environment==
  
Step 07.01: Check out the OpenEmbedded build system.
+
===Check out the OpenEmbedded build system.===
  
 
$ cd /tool
 
$ cd /tool
Line 120: Line 119:
 
$ git checkout --track -b overo origin/overo
 
$ git checkout --track -b overo origin/overo
  
Step 07.02: Checkout BitBake.
+
===Checkout BitBake.===
  
 
$ cd /tool/overo-oe
 
$ cd /tool/overo-oe
Line 129: Line 128:
  
  
Step 07.03: Creating the OE configuration files and profile.
+
===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.
 
We now will create a profile script and the configuration files required to tailor OE to our needs.
Line 142: Line 141:
  
  
Step 07.04: Setup source code caching.
+
===Setup source code caching.===
  
 
As part of the build process OpenEmbedded downloads source code tarballs for the linux kernel, compiler, and other software packages.  
 
As part of the build process OpenEmbedded downloads source code tarballs for the linux kernel, compiler, and other software packages.  
Line 166: Line 165:
 
DL_DIR = "/usr/share/sources"
 
DL_DIR = "/usr/share/sources"
  
Step 07.05: Improve build performance by modifying site.conf to use multiple cores
+
===Improve build performance by modifying site.conf to use multiple cores===
  
 
Edit build/conf/site.conf
 
Edit build/conf/site.conf
Line 173: Line 172:
 
BB_NUMBER_THREADS = "6"
 
BB_NUMBER_THREADS = "6"
  
Step 07.06: Reduce disk space usage by modifying local.conf  
+
===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:
 
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:
Line 181: Line 180:
 
This will significantly reduce the amount of disk space used.
 
This will significantly reduce the amount of disk space used.
  
Step 07.07: Modify your .bashrc file.
+
===Modify your .bashrc file.===
  
 
# .bashrc
 
# .bashrc
Line 240: Line 239:
  
  
Step 08.00: Install additional packages required by BitBake.
+
===Install additional packages required by BitBake.===
  
 
$ su
 
$ su
Line 247: Line 246:
  
  
Step 09.00: Install additional packages required by Fedora 12 x86 64-bit.
+
==Install additional packages required by Fedora 12 x86 64-bit.==
  
 
$ su
 
$ su
Line 254: Line 253:
  
  
Step 10.00: Build a basic kernel and a non-gui root file system image in one step using the following command
+
==Build a basic kernel and a non-gui root file system image in one step using the following command==
  
 
$ bitbake omap3-console-image
 
$ bitbake omap3-console-image
Line 270: Line 269:
 
# echo “0” > /proc/sys/vm/mmap_min_addr
 
# echo “0” > /proc/sys/vm/mmap_min_addr
  
Step 11.00: Update the org.openembedded.dev sources at regular intervals by typing the following command
+
==Update the org.openembedded.dev sources at regular intervals by typing the following command==
  
 
$ cd org.openembedded.dev
 
$ cd org.openembedded.dev
 
$ git pull
 
$ git pull
  
 +
=Related Links=
  
Related Topics
+
01. [How to install OpenEmbedded and Bitbake - PIXHAWK. http://pixhawk.ethz.ch/tutorials/omap/openembedded_bitbake_installation]
  
None
+
02. [Quick Command Reference for OE - PIXHAWK. http://pixhawk.ethz.ch/tutorials/omap/command_reference]
  
Related Links
+
03. [Git cheat sheet - Zack Rusin. http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html]
 
+
01. How to install OpenEmbedded and Bitbake - PIXHAWK.
+
 
+
02. Quick Command Reference for OE - PIXHAWK.
+
 
+
03. Git cheat sheet - Zack Rusin.
+

Latest revision as of 13:00, 25 January 2010

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.

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

  1. 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

  1. 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.

  1. 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

  1. cd Download/vmware-tools-distrib
  2. ./vmware-install.pl

You can run the VMware Tools by invoking the following command:

  1. /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

  1. cd Downloads/jdk-5u12-linux-i586
  2. ./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

  1. 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

  1. 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.

  1. .bashrc
  1. Source global definitions

if [ -f /etc/bashrc ]; then . /etc/bashrc fi

  1. User specific aliases and functions
  1. Environment setup for java

export JAVA_HOME="/usr/java/jdk1.5.0_12" export PATH="${JAVA_HOME}/bin:$PATH"

  1. end java setup


  1. 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

  1. end oe setup
  1. 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"

  1. end android setup


Install additional packages required by BitBake.

$ su

  1. yum install help2man
  2. yum install texi2html


Install additional packages required by Fedora 12 x86 64-bit.

$ su

  1. 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

  1. 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.