Home > Uncategorized > Raspberry Pi: Tuning the Kernel – 0.1

Raspberry Pi: Tuning the Kernel – 0.1

My assignment for the class SBR600, is to build and tune the kernel for the Raspberry Pi device (The Raspberry Pi device is a tiny, inexpensive ARM microcomputer designed to use in educational environments), it involves optimizing the kernel to run as efficiently as possible on the Raspberry Pi.

The steps for compiling a custom kernel for the RaspPi looked fairly simply, in that there are surprisingly few! Those steps are as follows:

  1. Retrieve kernel (Version 2.6.35.7)
  2. Retrieve RaspPi kernel patch (RaspPi Patch)
  3. Apply patch to the kernel
  4. Add in DWC_otg folder
  5. Make the zImage from the patched kernel
  6. Run the python imagetool

I ran into problems while attempting to make the zImage of the kernel.

Upon running the command:

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- zImage

I was greeted with the following error:

/bin/sh: arm-none-linux-gnueabi-gcc: command not found
 make[1]: *** [kernel/bounds.s] Error 127 

After a bit of research I learn I’m missing a toolchain required to utilize the gnueabi-gcc toolset for the make command. So I located and downloaded said toolchain (arm-2011.03-41-arm-none-linux-gnueabi.bin)

Running that toolchain installer I ran into yet another error:

Error: Missing 32-bit libraries on 64-bit Linux host

It seems that I require certain 32bit libraries in order to CROSS_COMPILE the RaspPi kernel.

With the direction of frojoe on the #seneca freenode channel I was directed to this MeeGo wiki page which details the installation of the toolchain:

mkdir -p ${HOME}/tmp
cd ${HOME}/tmp
wget -c https://sourcery.mentor.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
mkdir -p ${HOME}/opt
tar -C ${HOME}/opt -vjxf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
export PATH=${HOME}/opt/arm-2009q1/bin:${PATH}

After applying these fixes and re-running the make command I encountered this error:

/bin/sh: /home/nlambert/opt/arm-2009q1/bin/arm-none-linux-gnueabi-gcc: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Some research lead me to yum install glibc.i686, which corrected this issue. Re-running the make command results in the building of the kernel to the zImage.

I then ran the python imagetool-uncompressed.py script and am greeted with a kernel.img(4.7mb) in the tools directory.

This is my first kernel for the RaspberryPi with stock settings.

Advertisements
Categories: Uncategorized
  1. November 7, 2011 at 5:06 pm

    Reminds me of my experiences with Linux over the years. What a difference today, where a typical pc with a good mobo and standard hardware can load the latest Ubuntu no sweat, and where I was even able to load Gentoo (except I could not get the sound working) just by following the instructions at gentoo.org

    However, I suspect that the Raspberry Pi being supported by a bunch of motivated students, will quickly advance to a viable first computer marketed in a little bubble pack in the candy aisle.

  1. December 8, 2011 at 6:07 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: