Home Gumstix Gumstix Minimal, quick booting Gumstix image

Minimal, quick booting Gumstix image

I have been working with a configuration for the Gumstix Overos that can boot into Linux in under 10 seconds from power-on.

 

At least half of the 10 second boot time is spent in u-boot loading and uncompressing the Linux kernel. There are changes coming to u-boot's MMC driver by Gumstix and U-Boot developers that should improve this.

The changes documented here are focused more on creating a smaller kernel with fewer drivers and removing some userland processes that normally run at startup with standard gumstix images. As a side effect, the smaller kernel size does help with the u-boot load/uncompress time.

We use systems configured similar to the one described here in some of the work I do for Fluid Imaging Technologies.

The project repository can be found on Github http://github.com/scottellis/overo-oe/tree/minimal

The repository is a clone of the overo branch of the gumstix-oe/mainline repository hosted here http://gitorious.org/gumstix-oe/mainline.

There are several branches in my repository. The overo branch is unmodified from Gitorious and could be used by anyone if gitorious.org is having problems. I'll be keeping it relatively current.

The branch I'm playing with for the faster booting kernels is called 'minimal'. The kernel used is 2.6.34.

The kernel config is slimmed down from the Overo default.

  • No display drivers (no dss) or touchscreens
  • No wireless, bluetooth or wifi
  • smsc911x (Tobi NIC) built in
  • omap2_mcspi (SPI), g_ether (usb-net) and g_serial (usb-serial) as modules

I have the recipe/linux/linux-omap3_2.6.34.bb set to default the kernel configuration for the MUSB to be a peripheral. I never use the OTG port as a host.

The kernel supports network booting.

The kernel config can be found in recipes/linux/linux-omap3-2.6.34/overo/defconfig.

There is a patch for board-overo.c to stop it from mucking with GPIO 144/145 even if there is no display stuff in the kernel. The recipes/linux/linux-omap3_2.6.34.bb recipe uses it. I pushed a patch like this to the Gumstix maintainers and it looks like something similar to it will now be in later Overo kernel board files and this patch won't be needed.

Userland is also very minimal. I use an image I call work-image.bb, which is based on the stock OE minimal-image.bb. It adds the kernel module packages above and also ssh, devmem2, tcpdump and iperf. I install my own device drivers and userland programs afterwards.

I also made some changes to a few recipes to remove unnecessary dependencies and which also cut down on the build time particularly when rebuilding a fresh OETMP.

You can look at the git log, but here's a summary

  • openssh - removed libpam and xauth dependencies
  • libxml2 - removed python dependency
  • libpcap (tcpdump) - removed the bluez (bluetooth) dependency which brings in X

Eliminating X from console image builds is finally accomplished!!!

 

So if you aren't used to git, here's how you might use that Github repository.

cd ${OVEROTOP}/org.openembedded.dev
git remote add -f se-overo-oe git://github.com/scottellis/overo-oe.git
git checkout -b minimal se-overo-oe/minimal
git branch -a
* minimal
org.openembedded.dev
overo
remotes/origin/HEAD -> origin/org.openembedded.dev
remotes/origin/org.openembedded.dev
remotes/origin/overo
remotes/se-overo-oe/minimal

cd ${OVEROTOP}
bitbake -c clean virtual/kernel; bitbake virtual/kernel; bitbake work-image

When you want to go back to the normal Gumstix OE branch run

cd ${OVEROTOP}/org.openembedded.dev
checkout overo

And here's a sample boot log of the image running - boot-log.txt

I also remove a few of the init.d scripts as part of my rootfs copying scripts. If you are interested in speed, the important script to remove is udev. The systems I work on are pretty static when it comes to devices so udev is unnecessary.  Here's the script I use for reference fix-minimal-startup-scripts.sh.

My next experiment will be to completely remove the userland udev programs from the images or at least make some serious mods to the udev scripts.

Chris Whittenburg at sleepyrobot.com has an article for using busybox's mdev - Alternative to udev in openembedded/Angstrom

If you really care about boot times, don't forget to modify the u-boot bootdelay variable.

 

Update - 28Feb2011

I added another branch for a minimal image based on the latest 2.6.36r97 gumstix kernel. You can download prebuilt files here - Downloads/minimal-2.6.36r97/. All the pieces are there, MLO, u-boot, uImage and rootfs. Install it the way you normally would, SD card, Nand or NFS.

The source for the build can be found here github.com/scottellis/overo-oe/tree/minimal-2.6.36.