Difference between revisions of "Hammer How to buildroot"

From eLinux.org
Jump to: navigation, search
m (Added step to copy kernel config file)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
1) buildroot needs hammer-config copied to .config
 
 
2) if you dont have makeinfo installed need to patch
 
/buildroot/toolchain_build_arm/binutils-2.17.50.0.17/missing
 
to comment out line 302 "test -f $file || exit 1"
 
 
3) kernel is compiled outside of buildroot
 
 
4) copy hammer-config to .config
 
 
5) edit Makefile to set the cross compiler path properly
 
 
6) make oldconfig
 
 
7) make zImage
 
 
8) in apex "xr 0x30008000" then send the zImage (arch/arm/boot/zImage) via xmodem
 
 
8a) ubuntu 6.06 LTS needs lrzsz installed for xmodem etc. to work in minicom.
 
 
9) in apex "boot"
 
 
10) cat /proc/version ==>  Linux version 2.6.22 (kenm@kenm-desktop) (gcc version 4.1.2) #1 Sat Sep 1 12:50:36 MDT 2007
 
 
11) now that you have a working kernel, you may want to configure it for networking,
 
see [[How_to_Networking]]
 
 
==Building under Ubuntu==
 
 
 
The following steps were successful using the Gutsy Gibbon release (7.10) of ubuntu. All commands are executed from the command line.
 
The following steps were successful using the Gutsy Gibbon release (7.10) of ubuntu. All commands are executed from the command line.
  
First, you need to install the compilers and tools.
+
First, you need to install the compilers and tools. You also have to be sure that sh is linked to bash instead of dash, which will break some things.
 
  sudo apt-get install build-essential libncurses-dev bison flex texinfo zlib1g-dev gettext libssl-dev wget
 
  sudo apt-get install build-essential libncurses-dev bison flex texinfo zlib1g-dev gettext libssl-dev wget
 +
cd /bin
 +
sudo rm sh
 +
sudo ln -s bash sh
 +
 +
For Ubuntu/Kubuntu (8.10):
 +
sudo apt-get install build-essential libncurses-dev bison flex gettext
 +
cd /bin
 +
sudo rm sh
 +
sudo ln -s bash sh
  
 
Decide where you're going to build everything. I decided to create a directory called hammer in my home directory.
 
Decide where you're going to build everything. I decided to create a directory called hammer in my home directory.
Line 38: Line 18:
 
  cd hammer/source
 
  cd hammer/source
  
Note: If you copy the whole directory tree from the CD, you'll get a directory called SOURCE which will be read-only. I prefer lowercase filenames, so I renamed the files. The files on the CD were also truncated to 8.3 filenames, so the names won't match what you see here.
+
Note: these files are also found on the cd shipped with your [[Hammer_Board]] under the hammer/source directory
  
 
Grab the latest files (these were from the [[Hammer_Board_Software]] page). This assumes that you're still in the source directory
 
Grab the latest files (these were from the [[Hammer_Board_Software]] page). This assumes that you're still in the source directory
 
<pre>
 
<pre>
wget http://www.elinux.org/images/4/4c/Buildroot-01032008.tar.gz
+
wget http://www.elinux.org/upload/b/b6/Buildroot-01082008.tar.gz
 
wget http://www.elinux.org/images/f/ff/Hammer-linux-2.6.22-09122007.diff.gz
 
wget http://www.elinux.org/images/f/ff/Hammer-linux-2.6.22-09122007.diff.gz
 
wget http://www.elinux.org/images/e/ef/Hammer-kernel-config
 
wget http://www.elinux.org/images/e/ef/Hammer-kernel-config
Line 49: Line 29:
  
 
Build buildroot
 
Build buildroot
  tar xzf Buildroot-01032008.tar.gz
+
  tar xzf Buildroot-01082008.tar.gz
 
  cd buildroot
 
  cd buildroot
 
  cp Hammer-config .config
 
  cp Hammer-config .config
  make menuconfig
+
  make oldconfig
    Exit from menuconfig without making any changes. This creates the .config.cmd file
+
 
  make
 
  make
 
  cd ..
 
  cd ..
  
Add the cross compiler tools into your path. You may want to add this to your ~/.bashrc, although you should replace $(pwd) with the absolute path to your hammer/source directory.
+
Add the cross compiler tools into your path. You may want to add this to your ~/.bashrc(or ~/.dashrc) , although you should replace /home/hammer with the absolute path to your hammer/source directory.
export PATH=$(pwd)/buildroot/build_arm/staging_dir/bin:${PATH}
+
  
Build the kernel:
+
export PATH="${PATH}:/home/hammer/buildroot/build_arm/staging_dir/bin"
tar xzf linux-2.6.22.tar.gz
+
 
gunzip -c Hammer-linux-2.6.22-09122007.diff.gz | patch -p0
+
Note: If you run the linux version of vmware (i.e. linux is the host OS) then you'll want to add the Hammer staging_dir/bin to the end of the PATH, rather than the beginning, otherwise vmware will fail to load (you'd need to edit your ~/.bachrc and logout/login or reboot to actually see this failure)
cd linux-2.6.22
+
 
edit the Makefile and add the following 2 lines to the top of the Makefile
+
  export PATH=${PATH}:$(pwd)/buildroot/build_arm/staging_dir/bin
  ARCH=arm
+
  CROSS_COMPILE=arm-linux-
+
cp hammer-config .config
+
make oldconfig
+
  make zImage
+
  
The kernel can be found in arch/arm/boot/zImage
+
For the technically minded, the vmware launcher script uses a utility called ldd, and since the hammer staging_dir/bin also includes a different version of ldd, vmware gets confused when it uses the wrong ldd utility.
  
 +
Now [[Hammer_How_to_build_Kernel|build the kernel]] or view an introduction to [http://labor-liber.org/en/gnu-linux/development/ GNU Development]
 
[[category:TCT-Hammer]]
 
[[category:TCT-Hammer]]
 
[[category:TinCanTools]]
 
[[category:TinCanTools]]

Latest revision as of 22:05, 18 November 2008

The following steps were successful using the Gutsy Gibbon release (7.10) of ubuntu. All commands are executed from the command line.

First, you need to install the compilers and tools. You also have to be sure that sh is linked to bash instead of dash, which will break some things.

sudo apt-get install build-essential libncurses-dev bison flex texinfo zlib1g-dev gettext libssl-dev wget
cd /bin
sudo rm sh
sudo ln -s bash sh

For Ubuntu/Kubuntu (8.10):

sudo apt-get install build-essential libncurses-dev bison flex gettext
cd /bin
sudo rm sh
sudo ln -s bash sh

Decide where you're going to build everything. I decided to create a directory called hammer in my home directory.

cd ~
mkdir -p hammer/source
cd hammer/source

Note: these files are also found on the cd shipped with your Hammer_Board under the hammer/source directory

Grab the latest files (these were from the Hammer_Board_Software page). This assumes that you're still in the source directory

wget http://www.elinux.org/upload/b/b6/Buildroot-01082008.tar.gz
wget http://www.elinux.org/images/f/ff/Hammer-linux-2.6.22-09122007.diff.gz
wget http://www.elinux.org/images/e/ef/Hammer-kernel-config
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.tar.gz

Build buildroot

tar xzf Buildroot-01082008.tar.gz
cd buildroot
cp Hammer-config .config
make oldconfig
make
cd ..

Add the cross compiler tools into your path. You may want to add this to your ~/.bashrc(or ~/.dashrc) , although you should replace /home/hammer with the absolute path to your hammer/source directory.

export PATH="${PATH}:/home/hammer/buildroot/build_arm/staging_dir/bin"

Note: If you run the linux version of vmware (i.e. linux is the host OS) then you'll want to add the Hammer staging_dir/bin to the end of the PATH, rather than the beginning, otherwise vmware will fail to load (you'd need to edit your ~/.bachrc and logout/login or reboot to actually see this failure)

export PATH=${PATH}:$(pwd)/buildroot/build_arm/staging_dir/bin

For the technically minded, the vmware launcher script uses a utility called ldd, and since the hammer staging_dir/bin also includes a different version of ldd, vmware gets confused when it uses the wrong ldd utility.

Now build the kernel or view an introduction to GNU Development