Gentoo Wiki


This article is still a Stub. You can help Gentoo-Wiki by expanding it.


HOWTO Gentoo on PDA

This guide describes how to install Gentoo GNU/Linux on PDA


The authors are not responsible for your actions and their consequences.

Current state

Unable to connect (whole month. fix or reload to another server)


Ability to install and use Gentoo on different PDAs...


Creating cross toolchain

We are building a system which uses eabi. Eabi support was only added in gcc 4.1.1. Unfortunately this version is not stable yet. Native building works more or less correctly, but crosscompilation in 4.1.2 is buggy. Some packages can be crosscompiled normally (most part of necessary utilities), some things just don't work properly such as bash (but this is a bash building system bug) and alsa in A620 kernel. So crosscompilation should be used with great care and a native build should be used instead. Alternatively, you can abandon eabi and use the stable 3rd version of gcc.


In the main portage tree there is a wonderful tool called crossdev. It can build cross toolchains using emerge

Installing crossdev

Code: installing crossdev
# emerge -va crossdev

Creating toolchain

I decided to use armv5te-softfloat-linux-gnueabi CHOST, so, to build it you need to run:

Code: Creating toolchains
# crossdev -t armv5te-softfloat-linux-gnueabi

You will need this toolchain for compiling the kernel. Disable fortran "-fortran" in gcc or it will not build. Experiment with versions.

Stage creation

Actually, building the stage from scratch is not easy because of cross-compilation problems. So, if creation of your own stage is not your goal, you can skip this part and use the prebuilt stages. At the moment stages for PXA250 and PXA270 based PDA's are available.

For building official stages catalyst utility is used. We are not ready for it yet, so we just tar root tree images created with emerge.

Configuring crosscompilation and building

This process is described in Gentoo Cross Development Guide in detail.

The idea is to configure portage in such a way that it installs packages to a non standard root and builds it for a CHOST that is different from the building machine. So portage would be outside system which is being built.

Some packages can't be cross-compiled. Mostly these are packages which build utilities to build themselves. There are special tools for cross-compiling such packages which run everything except the compiler in an emulator. But, as far as I know, portage doesn't have such functionality.

Instead of building such packages you can get them from binary repository.

Native rebuild

As said before, gcc 4.1.2 in cross-compilation mode doesn't work well, so it is recommended to cross-compile a minimal system, able to build packages, and then boot it, rebuild it natively and then proceed to build the system natively.

Also, instead of the first step, you can take a prebuilt stage and natively build another stage from it. This would dramatically decrease the time needed for compilation and solving problems.

Building in qemu

For building packages which require much RAM, you can use qemu. It is slow: my Athlon64 3200+ emulates an arm processor one and a half times slower than my 400 Mhz xscale. But where you can find an arm board with more than 200 megabytes of RAM? For example I didn't manage to build pygtk on PDA, but did on qemu.

By the way, the arm board that qemu emulates doesn't have any storage devices, so booting from NFS is needed.

Qemu can be installed accordingly this guide, but you need to install qemu-softmmu-0.8.2-r2 version from pda overlay because it contains extra patches for eabi handling.

You would need a kernel and VM initialization script.


Installation on a PDA consists of two parts: installation of the bootloader and installation of gentoo. Different PDAs have very different hardware, so you should go to and read how the bootloader should be installed on your particular model. Installation on the HP hx4700 and asus A620 is described here; installation on other PDAs shouldn't differ much.

Beside this you need a working linux kernel for the PDA. Gentoo on PDA project doesn't deal with maintaining or porting the kernel. We just use kernels from other distributions. The best starting point is to visit, there is CVS with the latest hh branch of the kernel. Or you can use the sys-kernel/hh-sources ebuild from pda overlay.

For installation you need a PDA, a big flash card (at least 1 Gb; an unpacked gentoo image is about 800 Mb for now. It can be made more compact but no time for this now) and a cardreader (Softik cardexport is not enough, you need a hardware cardreader).

First of all you need to partition the card. Two partitions are needed. The first can be small (several megabytes is enough) but the second partition should be big enough to store gentoo. This is why you need a card reader. Also, the partition order is very important because windows can use only the first partition (partition number zero, if you count from zero).

Warning: BEFORE YOU BEGIN, you must make a backup of your PDA, both main memory and the card! The card will be erased during repartitioning and formatting, and main memory (RAM, not ROM) will be erased during linux boot

Bootloader installation

There are two options:

  1. flashing internal ROM (hx4700)
  2. booting from windows (linexec, haret) (hx4700, a620)

The first way is more convenient for permanent installation while the second is much safer and is the best choice for initial testing.

Installation of modified bootloader on hx4700

If you already have Familiar or Angstrom in internal flash, then it should be easy for you to use the modified SDG bootloader
Then you will have dual-boot PDA. A modified bootloader allows you to boot the kernel from the card if it is present there; otherwise the kernel is booted from the internal flash.

To install a modified bootloader you need an SD card and the ability to write to it.

Installation process:

  1. Download bootloader from
  2. Check md5summ
  3. Write it on SD card
Warning: All information on SD card will be erased
Code: Let's consider that SD is /dev/sda
# dd if=romfile of=/dev/sda

Now you need to configure the bootloader:

  1. Format first partition on the card under fat16
  2. Create directory called "boot" and copy there
    1. params
    2. zImage

If card is present during boot, kernel would be loaded from it and gentoo would boot. In another case kernel from internal flash would be used.

Booting with linexec

This option allows you to boot linux directly from windows mobile, by the way, it doesn't touch the internal ROM, so at any moment you can do a hard reset and get the PDA back with factory settings. This is the safe and easy method to put gentoo on the PDA.

Installation is very simple:

To boot gentoo, run linexec under windows. The screen will blank for a moment, then you should see the boot log. Some additional notes:

If you want to return to windows mobile, just so a hard reset and restore from a backup.

Installing gentoo linux from stage4 on CF card

To install gentoo you only need to unpack stage4 on your flash card, so plug it into the cardreader again and:

That's all. Gentoo is installed and now you can start using it.

How to work with gentoo linux on a PDA

Gentoo on a PDA is no different from usual Gentoo. So you can use your desktop experience and any gentoo-related documentation from the net.

About the boot process

While booting, gentoo will inform you that filesystem was not checked for several thousand days and modification of files is in the future. That's OK, because the clock is always reset when booting. New stages use baselayout2 and don't have such problems.

pda overlay

Gentoo on PDA project maintains pda overlay. It contains ebuilds for PDA oriented programs, like gpe or FBreader. Beside that, it contains modified ebuilds which apply additional patches needed to build for arm platform.

So it is recommended to activate it on your PDA:

Code: Adding overlay
layman -a pda

Network configuration

If you want your PDA to communicate with PC via craddle, you'll need to add usbnet support to your kernel:

Linux Kernel Configuration: Kernel configuration
  Device Drivers --->
    USB support --->
      USB Network Adapters --->
        <M> Multi-purpose USB Networking Framework 
        <M> Simple USB Network Links (CDC Ethernet subset) 
          [*]   Embedded ARM Linux links (iPaq, ...)

Then add autoloading of the usbnet module and create the usb0 network interface:

Code: Adding module to autoload and interface creation
echo "usbnet" >> /etc/modules.autoload.d/kernel-2.6 
ln -sf /etc/init.d/net.lo /etc/init.d/net.usb0 

Configure your connection in /etc/conf.d/net:

Code: /etc/conf.d/net
config_usb0=( " netmask" )    # Check /etc/conf.d/net on your PDA, subnets may differ.
mtu_usb0="1000"    # nfs will not work without it

You can check the default PDA IP address in /etc/conf.d/net in PDA disk. PXA270 stages use, the old PAX250 stage uses, and the new PXA250 stage uses

usbnet is very slow, about 600 kbps. Switching to WiFi may be much more effective, especially if you use NFS.

Interacting with PDA

The ssh deamon is started automatically while booting. Root password is "gent00" by default. Soon stages with xdm will be available. We will probably use matchbox as the WM but you always can try any other WM. fluxbox and iceWM are known to work on PDAs and on VGA screens; e17 is usable too.

Retrieved from ""

Last modified: Mon, 08 Sep 2008 07:16:00 +0000 Hits: 1,308