Build Environment Ubuntu 9.10
- 1 Build Environment Ubuntu 9.10 (Karmic Koala)
- 1.1 Install debootstrap chroot
- 1.2 Create a Chroot Directory for Older Distro
- 1.3 Edit Configuration
- 1.4 Install Gutsy
- 1.5 Login to Gutsy
- 1.6 Install Dependencies
- 1.7 Download Build Files
- 1.8 Make a "new" user
- 1.9 Edit extras/profile
- 1.10 Setup the Environment
- 1.11 Install the Included Bitbake
- 1.12 Create Source Code Cache
- 1.13 Login
- 1.14 Setup Build Environment
- 1.15 Edit auto.conf
- 1.16 Build Basic Image
Build Environment Ubuntu 9.10 (Karmic Koala)
Despite the assertion on Build_Environment_Ubuntu_9.04, I was unable to build the basic gumstix image using the svn trunk. It seems the trunk uses some deprecated features of gcc. I would suggest trying to change symbolic links for gcc, g++, etc to point to version 4.1 instead of 4.4. If that works, then all is good. As an alternative, what you can do is install an older version of Ubuntu that is known to work in a chroot. Any program that is run in the chroot cannot "see" the real root file system, so all of the build tools it find will be the ones installed in that chroot directory. This HOWTO describes how to setup the build system with such a method.
Install debootstrap chroot
The first thing we need to do is install the chroot program that we'll be using. You can install these programs with the following two commands
sudo apt-get install dchroot debootstrap
Create a Chroot Directory for Older Distro
Now we need to create a new directory that will act as the root for the older distribution's file system. Do this with the following command
sudo mkdir /var/chroot
We now edit the configuration file for the chroot program. The file is found in /etc/schroot/schroot.conf, so open it with the following commands
cd /etc/schroot sudo gedit schroot.conf
Since the build tools from the Gutsy distribution are known to work, I opted to install that distribution in my chroot. So add the following lines to the end of schroot.conf, replacing "YourUserName" with your actual user name
[gutsy] description=Ubuntu 7.10 (Gutsy Gibbon) location=/var/chroot priority=3 users=YourUserName groups=sbuild root-groups=root
Now we need to install the older distribution into this chroot. Do this with the following command
sudo debootstrap --variant=buildd --arch i386 gutsy /var/chroot/ http://old-releases.ubuntu.com/ubuntu
If you would like to use a different distribution, just change "gutsy" to whichever distribution you want. Note you may have to use archives.ubuntu.com if the distribution isn't that old.
Login to Gutsy
Now login to the chroot-ed distribution with
sudo chroot /var/chroot
Below is a list of all the dependencies I had to install in order to get bitbake to make the gumstix-basic-image. wget and groff weren't reported by bitbake as required packages but I encountered build errors if they weren't present.
apt-get install help2man diffstat texi2html cvs subversion bzip2 gawk texinfo wget groff python-dev python-pysqlite2
Download Build Files
Now we can download the build environment from gumstix. First create a directory to download them into. Note that we're still in the chroot-ed environment so when we say "/home/YourUserName" it will actually be installed in "/var/chroot/home/YourUserName". As always, replace "YourUserName" with your actual user name.
mkdir /home/YourUserName cd /home/YourUserName mkdir gumstix cd gumstix
Then we can download the environment from subversion
svn co https://gumstix.svn.sourceforge.net/svnroot/gumstix/trunk gumstix-oe
Make a "new" user
We can't run bitbake as root so we need to create a user in this chroot. I suggest using the same user name that you use in your "real" system.
useradd YourUserName -s /bin/bash passwd YourUserName chown -R YourUserName /home/YourUserName
If you installed into a directory other than ~/gumstix/gumstix-oe then you'll need to edit a line in extras/profile to point to the right directory
Setup the Environment
To setup the environment so that the bitbake install script can find everything correctly we need to execute the profile script
Install the Included Bitbake
Now we can install bitbake with the setup script.
cd /home/YourUserName/gumstix/gumstix-oe/bitbake ./setup.py install
Create Source Code Cache
We need to create the "global" source code cache for the chroot system. Start by creating a group called "oe"
Then add yourself to it
usermod -a -G oe YourUserName
Then create the directory for caching source code
mkdir /usr/share/sources chgrp oe /usr/share/sources chmod 0775 /usr/share/sources chmod ug+s /usr/share/sources
We can't run bitbake as root so let's login
su - YourUserName
Setup Build Environment
We need to setup the build environment again by executing the profile script.
cd gumstix/gumstix-oe . extras/profile
If building for something older than verdex, we need to edit the auto.conf file.
Build Basic Image
And now we're ready to build the basic image.