Search:  
Gentoo Wiki

HOWTO_Gumstix

Contents

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
[autoload-portage]
class=pkgcore.ebuild.portage_conf.config_from_make_conf
 
;[portage-verbose-formatter]
;inherit=portage-verbose-formatter
;default=true
 
[arm-vdb]
class=pkgcore.vdb.ondisk.tree
location=/mnt/root/var/db/pkg

[arm-domain]
CBUILD=i686-pc-linux-gnu
inherit="livefs domain"
CHOST=arm-softfloat-linux-uclibc
CFLAGS_FOR_BUILD=-spork
CFLAGS="-pipe -Os -march=armv5te"
CXXFLAGS="-pipe -Os -march=armv5te"
USE="minimal -X"
KEYWORDS="~arm"
root=/mnt/root
INSTALL_MASK="*.h"
vdb=arm-vdb

Get gumstix overlay

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

wget http://duffolon.us/~bryan/gumstix_overlay.tar.bz2 && tar xvjf gumstix_overlay.tar.bz2 -C /usr/local

Create toolchain via crossdev

crossdev --libc 0.9.28.3 --kernel 2.6.19.2-r2 --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-0.9.28.3

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 http://svn.gumstix.com/gumstix-buildroot/trunk/target/generic 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
fast
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.

ISSUES

Unresolved symbols

"can't resolve symbol '__divsi3'" errors. Make sure you have "libgcc_s.so.1" 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/libgcc_s.so.1 to get it loading the shared lib.

Hacks

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
 fi
-DEPEND="${_automake_atom}
-       ${_autoconf_atom}
-       sys-devel/libtool"
+#DEPEND="${_automake_atom}
+#      ${_autoconf_atom}
+#      sys-devel/libtool"
 RDEPEND=""
 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:
ac_cv_func_malloc_0_nonnull="yes"
;unknown variables (ones not in pkgconfig dump) will be thrown into the environment.
Retrieved from "http://www.gentoo-wiki.info/HOWTO_Gumstix"

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