Skip to content

Building Minimal Filesystem (Buildroot)

March 22, 2013

This article will show steps require to build a minimal file system using buildroot. Minimal file system is good when you only want the smallest footprint of file system and there is no frequent addition of software packages. Once the file system has build, any additional package can be added through buildroot (if the package is available by default).

On the other hands, another method of getting file system is using linaro or ubuntu that provide a pre-built minimal file system. Once you enable these system, any further package update will be as easy as desktop update using ‘apt-get’ tools. The draw-back of this is the minimal file system may not be ‘minimal’ in size as file system built from build root.

A good reference for this topic would be on www.elinux.org

Following steps below to build a minimal file system the build root way:

  1. Getting build-root files
  2. Getting buildroot configurations files
    • cp Config.buildroot .config
    • vi .config
      • change BR2_JLEVEL=8 to BR2_JLEVEL=4 (for laptop 4 core processsor)
      • enable BR2_PACKAGE_UDEV=y
  3. Build
    • make
    • coffee break! or prayer time
  4. If steps 3 goes well, the output file will be located at ‘output/image/rootfs.tar.bz2.
  5. Follow guide on www.elinux.org to enable the file system
    • Enable ttyO2
      • vi etc/securetty
        • insert ttyO2
      • vi etc/inittab
        • //ttyS2::respawn:/sbin/getty -L ttyS2 115200 vt100 # GENERIC_SERIAL
        • ttyO2::respawn:/sbin/getty -L ttyS2 115200 vt100 # GENERIC_SERIAL
      • vi etc/init.d/S10udev:19
        • remove below lines that disable ttyO2
          • # old kernels don’t use udev
            case $(uname -r) in
            2.6*|2.7*)  ;;
            *)          exit 0;;
            esac
  6. While building the file system, one problem that I faced is ‘can’t open /dev/ttyO2: No such file or directory’. I managed to solve this using following method:
    • In buildroot .confile files, enable BR2_PACKAGE_UDEV=y
    • Edit file etc/init.d/S10udev:19 to remove below lines that disable ttyO2
      • # old kernels don’t use udev
        case $(uname -r) in
        2.6*|2.7*)  ;;
        *)          exit 0;;
        esac
Advertisements

From → Embedded Linux

Leave a Comment

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: