RSS

Ubuntu Natty on Pandaboard: Native Build Steps

01 Oct

Natty on Pandaboard

 
 
 
 
 
 
 
 
 
 

When I decided to make changes in the Ubuntu Natty Linux kernel (Version 2.6.38) for Pandaboard on my laptop. I thought, it would be a straight forward affair to build it and flash the generated image onto the Pandaboard’s SD card and see it running smoothly…

That time did not know that I would need to change my plan and search the Internet for right build instructions, which eventually I could not find.

Later I decided to go for another option, native build the Kernel on the Pandaboard itself..

After a brief search, I found a very crisp information at Adventures in Silicon. While the instructions there were for Ubuntu Maverick. I could change a bit and use it for my purpose i.e. native build Ubuntu Natty.

All the following steps mainly originate from Dingo_Aus’ post, I have modified the details w.r.t. Natty.

BTW: Before going ahead, let me remind you about my journey to current 16GB SD card. Initially, I started with 4GB SD card , as it was not enough for native build I went for 8GB SD card. Later during the build, found that 8GB too was no sufficient. So had to upgrade the SD card to the current 16GB size.

So, be ready with such SD card.

  • Step 1: Setup
  • Update all the repository lists:

    sudo apt-get update

    Next, install all the packages to fulfill any dependencies that may arise while building the Kernel:

    sudo apt-get build-dep linux-image-$(uname -r)

    Once done above step would consume more than 800MB of card space.

  • Step 2 : Download kernel source
  • I created a directory called ‘kernel’ under my home and ran following command:

    git clone git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git

    Above command would take long time depending upon your Internet speed, client requests at ubuntu.com, so be prepared for it.

    Then checkout the working directory ti-omap4:

    git checkout -b working origin/ti-omap4

    If you need to customize the build configuration, you can use following command. This step is purely optional.

    fakeroot debian/rules editconfigs

  • Step 3 : Build the Kernel from source
  • Navigate to ubuntu-natty directory which has all the kernel source.

    cd ubuntu-natty

    Build the kernel package with following commands:

    fakeroot debian/rules clean

    export $(dpkg-architecture -aarmel)

    do_tools=false fakeroot debian/rules binary-arch

    For me these commands took more than 5 hours. At the end you should a lot of .deb and .udeb files one level up (i.e. at kernel directory).

    In my kernel directory, following files were generated:

    kernel/linux-headers-2.6.38-1209_2.6.38-1209.15_armel.deb
    kernel/linux-headers-2.6.38-1209-omap4_2.6.38-1209.15_armel.deb
    kernel/linux-image-2.6.38-1209-omap4_2.6.38-1209.15_armel.deb

    kernel/block-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/crypto-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/fat-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/fs-core-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/fs-secondary-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/input-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/irda-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/kernel-image-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/md-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/mouse-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/nic-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/nic-shared-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/nic-usb-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/parport-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/plip-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/ppp-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/sata-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/scsi-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/squashfs-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/storage-core-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/usb-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb
    kernel/vlan-modules-2.6.38-1209-omap4-di_2.6.38-1209.15_armel.udeb

  • Step 4 : Install the kernel
  • To install the kernel you would need the following generated .deb files (IN THE SAME ORDER).

    kernel/linux-headers-2.6.38-1209_2.6.38-1209.15_armel.deb
    kernel/linux-headers-2.6.38-1209-omap4_2.6.38-1209.15_armel.deb
    kernel/linux-image-2.6.38-1209-omap4_2.6.38-1209.15_armel.deb

    Make sure you are using correct files, versions before you start installing the kernel.

    Following are the commands to install kernel:

    1) sudo dpkg -i linux-headers-2.6.38-1209_2.6.38-1209.15_armel.deb

    2) sudo dpkg -i linux-headers-2.6.38-1209-omap4_2.6.38-1209.15_armel.deb

    3) sudo dpkg -i linux-image-2.6.38-1209-omap4_2.6.38-1209.15_armel.deb

    Again, this installation step would take some time, so be patient..

  • Step 5 : Copy the kernel onto SD card
  • This step is important as uBoot needs to know the location of this built kernel to load next time when the Pandaboard boots.

    sudo flash-kernel 2.6.38-1209-omap4

    From Dingo_aus’s post: flash-kernel writes the uIamge, uInitrd and boot.scr files to the boot partition of the SD card.

Advertisements
 
Leave a comment

Posted by on October 1, 2011 in Linux, Pandaboard, Technical

 

Tags: , , , , , , ,

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: