Gentoo Wiki



Gentoo Gumstix

This is a HOWTO for a Gentoo setup on a gumstix ARM embedded computer using pkgcore.

Install pkgcore

emerge -a pkgcore

  1. setup pkgcore.conf
  2. in this case root is setup in '/mnt/root'. The vdb is also located within the root directory (moving it elsewhere is perfectly fine).
Code: Example pkgcore.conf file
# cat /etc/pkgcore.conf

inherit="livefs domain"
CFLAGS="-pipe -Os -march=armv5te"
CXXFLAGS="-pipe -Os -march=armv5te"
USE="minimal -X"

Get gumstix overlay

  1. download/unpack
  2. this comes with a couple custom packages (baselayout and kernel) but most importantly uclibc

wget && tar xvjf gumstix_overlay.tar.bz2 -C /usr/local

Create toolchain via crossdev

crossdev --libc --kernel --gcc 3.4.6-r2 --stage4 --target arm-softfloat-linux-uclibc

Install common packages

Install baselayout

pmerge --add-config 'arm-domain' default true -va baselayout-gumstix

Install packages where cat/pkg is something like sys-apps/busybox

pmerge --add-config 'arm-domain' default true -va cat/pkg

Install required packages

So you don't need to make everything static install uClibc:

pmerge --add-config 'arm-domain' default true uclibc-

pmerge --add-config 'arm-domain' default true --add-config 'arm-domain' USE 'make-symlinks' -va sys-apps/busybox

pmerge --add-config 'arm-domain' default true sys-apps/tinylogin

(add more example packages)

Kernel - get/setup/build

pmerge -va gumstix-sources

Note: If using gcc < 4.0 you'll need to uncheck CONFIG_AEABI under Kernel Features
Code: Build the kernel
cd /usr/src/linux
make ARCH=arm menuconfig

make ARCH=arm CROSS_COMPILE=arm-softfloat-linux-uclibc-

make ARCH=arm CROSS_COMPILE=arm-softfloat-linux-uclibc- INSTALL_MOD_PATH=/mnt/root/ modules_install

Commandline|arm-softfloat-linux-uclibc-objcopy -O binary -R .note -R .comment -S arch/arm/boot/compressed/vmlinux ./linux.bin

Make kernel usable for u-boot:

pmerge -va mkimage-u-boot

mkimage -A arm -O linux -T kernel -C none -a 0xa0008000 -e 0xa0008000 -n "uImage" -d ./linux.bin ./uImage

cp uImage /mnt/root/boot

Setup jffs2 image

Install tools on host:

pmerge -va mtd-utils

Get device_tables.txt (list of devices to create in /dev)

svn co dev_table
cp dev_table/device_table.txt .

mkfs.jffs2 -l -U -e 128KiB -d /mnt/root -D device_table.txt -o rootfs_arm_gumstix sumtool -e 128KiB -i rootfs_arm_gumstix -o rootfs_arm_gumstix.jffs2

Install image to Gumstix device

Installing the image requires connecting to the device via serial connection. To do this install ckermit:

pmerge -a ckermit

Code: Setup defaults
# .kermrc:
set carrier-watch off
set speed 115200
set file type bin
set reliable
set flow-control none
set rec pack 4096
set send pack 4096
set window 5
set prefixing all

Copy file via kermit

GUM> loadb a2000000

(/pwd/) C-Kermit>send rootfs_arm_gumstix.jffs2

  1. flash once file copied over

GUM>protect on 1:0-1 && jera all && cp.b a2000000 40000 ${filesize} .... GUM>boot

Yay, all done.


Unresolved symbols

"can't resolve symbol '__divsi3'" errors. Make sure you have "" in /lib (e.g. this file is found in /usr/lib/gcc/arm-softfloat-linux-uclibc/3.4.6/)

To fix this I had to add LD_PRELOAD=/lib/ to get it loading the shared lib.


Code: Do not merge autotools.eclass dependencies:
--- /usr/portage/eclass/autotools.eclass        2007-07-13 01:06:10.000000000 -0500
+++ autotools.eclass    2007-07-13 01:06:04.000000000 -0500
@@ -35,9 +35,9 @@
        [[ ${WANT_AUTOCONF} == "latest" ]] && WANT_AUTOCONF="2.5"
        export WANT_AUTOCONF
-       ${_autoconf_atom}
-       sys-devel/libtool"
+#      ${_autoconf_atom}
+#      sys-devel/libtool"
 unset _automake_atom _autoconf_atom
Code: Getting includes and libs from your root directory (for dependencies you've already built):
;under your domain in pkgcore.conf
CFLAGS="-pipe -Os -march=armv5te -I/mnt/root/usr/include"
LDFLAGS="-L/mnt/root/lib -L/mnt/root2/usb/lib"
CXXFLAGS="-pipe -Os -march=armv5te -I/mnt/root/usr/include"
;also, ./configure variables:
;unknown variables (ones not in pkgconfig dump) will be thrown into the environment.
Retrieved from ""

Last modified: Fri, 05 Sep 2008 10:58:00 +0000 Hits: 1,783