HOWTO Setup GumStix Buildroot on an existing (X)Ubuntu System

From HBMobile
Revision as of 19:29, 16 December 2007 by Msh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The Easy Route

If you want to get things going as fast as possible, the best way to do this is to use the build_myphone.sh script from the downloads section of the web site. You can always find the latest version of the build_myphone.sh script for (X)Ubuntu systems at:

http://hbmobile.org/downloads/XU_CURRENT/build_myphone.sh

This script downloads all the packages required to build the GumStix Linux system, then adds support for DirectFB, libpng, libjpeg, freetype, sftp and ppp over /dev/ttyS0 (the middle serial port on the ConsoleLCD.) Then in an orgastic explosion of compilation, it builds everything. If everything goes well, you're left with three files in the ~/Projects directory:

  • u-boot.bin
  • rootfs.arm_nofpu.jffs2
  • uImage

These are the files you'll need to reflash your myPhone. More information about reflashing can be found at the HOWTO Reflash the GumStix Verdex page.

Note that the current version of (X)Ubuntu we support is 7.10, and the script in the XU_CURRENT directory has been tested with this Linux distro. Users of other Linux distros may have some success with it, but your mileage may definitely vary.

Check your /etc/apt/sources.list before running the script

As a test, I installed Xubuntu 7.10 on a very old laptop that did not have a built in WiFi chipset (remember the days before WiFi?) I'm happy to say the install went well, but it took me a few minutes to realize... if you install on a machine that does not have a working network adapter when you do the install, it will disable network software updates by commenting out various lines in the /etc/apt/sources.list file.

If you have reason to believe your network adapter was deactivated when you installed, you may want to check this file out. This file is supposed to look something like this:

####################################
### Official Ubuntu Repositories ###
####################################

# Gutsy Final Release Repository
deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse

# Gutsy Security Updates
deb http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
#deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse

# Gutsy Bugfix Updates
deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse

# Gutsy Backports (new software versions, provided by the Ubuntu Backports Project)
deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse

# Ubuntu Commercial
deb http://archive.canonical.com/ubuntu gutsy partner
#deb-src http://archive.canonical.com/ubuntu gutsy partner

If the lines that start with "deb" are commented out... well... that's bad. To fix the situation, use vi or your favorite editor to remove the comments from the front of the "deb" lines and run the command:

sudo apt-get update

The disk will spin, the lights will blink and you should see the apt-get tool updating its database of software packages.

Okay, Run the Script Already

To run the script, you can use the following shell commands:

wget http://hbmobile.org/downloads/XU_CURRENT/build_myphone.sh
chmod 755 build_myphone.sh
./build_myphone.sh

The Less Easy Route

"Two roads diverged in a wood

And I took the one less traveled by
And that has made all the difference"

-- Robert Frost, Road Less Travelled

So if you're reading this far, it likely means there was a problem with the build_myphone.sh script; or maybe you're just the kind of person who likes to know what scripts executing on your machine (sometimes with root permissions) are doing. Here's what's going on:

Use apt-get to Install Required Packages

The command

sudo apt-get install build-essential libncurses5-dev bison flex texinfo zlib1g-dev gettext libssl-dev libc6-dev make g++ gcc automake1.9 subversion libpng12-dev libjpeg62-dev libfreetype6-dev pkg-config fbset libdbus-1-dev libdbus-glib-1-2 libdbus-glib-1-dev libglib-2.0-dev lrzsz mtd-tools

downloads the packages required on (X)Ubuntu to make sure things build right.

Add Soft Links for bash and zcat

For reasons unknown to mortals, the ascended (X)Ubuntu masters chose to make /bin/sh a soft link to /bin/dash. As we all know, this is an affront to the great work of the secret cabal of bash shell programmers. Or something. But seriously, some of the packages referenced in the GumStix buildroot fail in mysterious ways if /bin/sh is soft linked to /bin/bash. The fix is to make /bin/sh a link to /bin/bash.

Also, it seems that some of the packages assume that the command gzcat will be found somewhere on the system. But... the (X)Ubuntu default is to leave gzcat fans wanting.

The following commands change things around so this isn't an issue:

cd /bin
sudo rm sh
sudo ln -s bash sh
sudo ln -s zcat gzcat