Step-by-step Buildroot/Busybox Root File System

From odroid US
Revision as of 00:46, 19 January 2013 by 12.191.56.10 (Talk)

Jump to: navigation, search

UNDER CONSTRUCTION -- ACTIVE EDITING, PLEASE DON'T MAKE CHANGES


This tutorial is for Developers. It is written to work with the odroidu2-ubuntu or odroidu2-debian SD-Card images [is this specific enough?]

It is not for Android developers.

Introduction

Did you know you can easily make a very small custom-built Linux system? The key is to use the famous "Buildroot" package. This tutorial presents an example to get you started.

You can add additional packages as you like. Many products have been built using this technique with busybox playing the central role.


Prerequisites

  • You MUST have access to the serial console -- use the USB/Serial adapter [check actual Hardkernel name]
  • You need an SD-card reader/writer
  • You need to start with an SD-Card loaded with the odroid ubuntu image: odroidu2_20130104-linaro-ubuntu-desktop-uSDeMMC.img.xz. You can read about how to install it here: Step-by-step Ubuntu SD Card Setup
  • You need a Linux host (or virtual machine) running a Debian-based distribution: Debian, Ubuntu, Mint, Knoppix, etc. This is because the buildroot scripts pick up packages, including an ARM toolchain that are automatically installed.
  • For this tutorial, you can use the provided odroidu2 kernel -- or build your own, see: Kernel Compiling. The kernel must have the network driver (smsc95xx) built-in rather than built as a kernel module. This lets us bring up the network interface once the root file system is installed.
  • You need to be able to write the resulting root file system image to the SD-Card. See: [Updating from Root File System Images]

    Overview

    We are going to:

  • Download the example files and extract them
  • Expand the buildroot package and add the odroidu2 configuration
  • Use make to pull in all required packages and prepare the root file system image
  • Write the image to SD-Card
  • Boot the buildroot root file system on our odroid

    Download Example Files

    You can use your browser, or use web get.

    # Go to some convenient folder
    cd ~
    # Get the example files
    wget http://odroid.us/odroid/users/osterluk/buildroot-example/buildroot-example.tgz
    wget http://odroid.us/odroid/users/osterluk/buildroot-example/buildroot-example.tgz.md5sum
    md5sum -c buildroot-example.tgz.md5sum
    # Assuming the md5sum is correct, continue
    tar -xvf buildroot-example.tgz
    cd buildroot-example
    
    


    Configure buildroot with just the busybox package:

    cp