Thursday, March 12, 2015

Building Debian Wheezy for Gumstix Overo

This writeup goes over details on how to build and install a Debian Wheezy Linux image for an Overo Gumstix board. The build notes and images in this post are for a stock Debian Wheezy OS configured for a Gumstix Overo device. The Debian image is configured for easy SSH network access over wired, wireless or USB when the Gumstix device is powered.

This Debian build utilizes the kernel, modules and firmware from the Gumstix Overo Yocto build. You do not have to build your own Yocto image as this documentation utilizes a precompiled version, but if you are interested in building your own, you can check our my previous post "Building Yocto Linux Images for the Gumstix Overo"

Here is a short summary of what this writeup covers:

How to manually build a Debian Wheezy image for a Gumstix Overo.

An alternative scripted method to build a Gumstix Debian image.

Where to download precompiled Debian Wheezy Gumstix Overo image if you are not interested in building them yourself.

How to install a Debian Wheezy image to an SD card for your Gumstix board.

How to access your image after installation

Manually Building a Gumstix Overo Debian Image

These steps build a base Debian Wheezy OS for the Gumstix Overo board and uses files, kernel modules, firmware obtained from a Gumstix Overo Yocto build. You do not have to build your own Yocto image as this documentation utilizes a precompiled version, but if you are interested in building your own, you can check our my previous post "Building Yocto Linux Images for the Gumstix Overo"

NOTE: This documentation utilizes the deboostrap command so you will likely have to build this on a Debian or Ubuntu based system. There are some tricks to get around this, but they are not covered here.

Create Your Build Directory

First we will create a build directory. It is not required that you follow the same directory build structure. However, if you do use a different directory structure, you will have to substitute your directories in my build commands.

mkdir -p gumstix/debian
cd gumstix/debian

Install Build Dependancies

We must first install these following applications in order to build our base OS

Bundle the Root File System for Your New Debian OS

Finally, we tar up our configured Debian filesystem. This filesystem will be used during the install stage for our Gumstix SD card.

cd wheezy
sudo tar -cjf ../wheezy.tar.bz2 *
cd ..

Gumstix Overo Debian Wheezy Scripted Build

In order to speed up the Debian Gumstix build process, I have composed a bash script from all of the manual build steps described above. The script can be found here. This script was tested on a base Debian 7.7 , Ubuntu 14.04 and Kali Linux 1.0.9 system. The script contains sudo commands so it will prompt you periodically for a root password when it needs to run privileged commands.

Download the Build Script

The build script that encapsulates all of the manual build steps can be obtained from by github repo as shown below.

Install the Image to an SD Card

Once you have built or downloaded your Debian Wheezy Gumstix image, you can use the steps listed in this section to flash the image to an SD card. You can then use the SD card to boot your Gumstix board.

These steps require a Linux machine

Insert Your SD Card

Make sure to note the device block it gets mapped to. In most instances it will /dev/sdb

Format Your SD card

In the command below, replace sdX with the device your SD card was mapped to which you noted in the previous step

Download Uboot Files if you Don't Already Have Them.

If you built your image manually and did not download it, you will have to obtain a MLO, uImage and u-boot.img file. To get these you can grab them from a Yocto build or download them with the following commands.

Copy Uboot Files and OS Filesystem to the SD Card

On a Debian system your SD card partitions should automatically get mounted to /media/boot and /media/root. If this is not the case then make sure your SD cards are mounted and substitute the mount directory referenced in the instructions below.

On ubuntu 14.04 you may have to unplug and replug your SD card to make it remount after running mk2partsd from the step above. Also on Ubuntu 14.04 your mount locations may be /media/username/{boot,rootfs}

How to Access the Debian Wheezy Image Running on a Gumstix

The manual build steps above and the precompiled images set up the base Debian OS to be easily accessed via ssh over wifi, ethernet or USB networking.

NOTE: USB serial console support for the Debian image is not setup so you will not be able to log in via minicom, etc

Recommended Method for Accessing Precompiled Images

The easiest way to access your Debian system is via SSH over the USB network interface it provides.

Plug in your Gumstix board which is attached to a daughter board with a usb device port (Tobi, Thumbo, etc) to your host computer.

Once the Gumstix board finishes booting the OS you can ssh to it over USB with username:root password:hackgnar

ssh root@172.16.1.2

Credentials and IP Addresses for the Debian Image

The precompiled image (or images created with the build script) is setup with the password "hackgnar" for the root user.

The ipaddress for the Gumstix USB network interface is 172.16.1.2

Other Methods for Accessing the Installed Debian Image

Here are all of the methods that you can use to access the image running on your Gumstix Board

SSH to the usb network interface located at the address listed above. The Debian image is configured to serve your host computer a DHCP address in the 172.16.1.0/24 block.

SSH to the ethernet interface if you are using a daughter board with ethernet capabilities (Tobi, etc). The eth0 interface will pull a DHCP address.

SSH to the WiFi interface. This will require that you setup your wpa supplicant file located at /etc/wpa_supplicatnt/wpa_supplicant.conf prior to flashing your SD card.

NOTE: USB serial console support for the Debian image is not setup so you will not be able to log in via minicom, etc

Summary

Hopefully you have found this document for installing Debian on a Gumstix Overo useful. Many of the steps can be altered to install different operating systems. With a little alteration of the debootstrap command, you should be able to install any OS supported by debootstrap. This document can also be altered to install Debian based operating systems to different hardware such as the Gumstix DuoVero series. As the only Gumstix product I own is an IronStorm-P COM with a Thumbo and Tobi board, this document only focuses on this hardware.

My next post will cover installing a Kali Linux OS to the Gumstix Overo board. I have already tested this setup extensively and just need to finalize some documentation. Other upcoming posts will cover other various operating systems such as the latest Ubuntu, Fedora, etc.

If you have any comments or questions please feel free to send them my way. You can post comments here or contact me via Twitter @hackgnar.