PDA
This article is still a Stub. You can help Gentoo-Wiki by expanding it.
Contents |
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.
PROCEED AT YOUR OWN RISK.
Current state
- Minimal working system is built. PXA250 and PXA270 based PDA's are supported
- X starts and works correctly
- Touchscreen works
- Minimal graphical environment is built
- All files are available on Gentoo.ru
- Website about Gentoo on PDA is available at http://projects.gentoo.ru/gentoo-pda (Russian)
- PDA software overlay named "pda" is avaliable via layman
Unable to connect ftp://gentoo.ru (whole month. fix or reload to another server)
Target
Ability to install and use Gentoo on different PDAs...
TODO
- Decrease system size by deleting man info and other documentation from PDA
- Use unionfs to split user programs and building environment.
- Determine list of packages, which are convinient for use on PDA. Just for helping building your own environment: many desctop applications are unusable because they don't fit screen or frequently require keyboard.
- Support for old and creation of new ebuilds, including ebuilds for FBReader and GPE.
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.
Crossdev
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
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 handhelds.org 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 handhelds.org, 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).
Bootloader installation
There are two options:
- flashing internal ROM (hx4700)
- 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:
- Download bootloader from gentoo.ru
- Check md5summ
- Write it on SD card
| Code: Let's consider that SD is /dev/sda |
# dd if=romfile of=/dev/sda |
- Now boot PDA in service mode. To do this hold down simultaneously Addressbook, iTask and Reset
- Folow the instructions on the screen (backlight won't work).
- It may warn about a checksum error, that's normal.
Now you need to configure the bootloader:
- Format first partition on the card under fat16
- Create directory called "boot" and copy there
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:
- Format first partition under fat32.
- Place the bootloader in the root of this partition. linexec, kernel image, initrd, if you need it (I don't use it) and bootloader config params.txt.
To boot gentoo, run linexec under windows. The screen will blank for a moment, then you should see the boot log. Some additional notes:
- Under windows, the storage card directory name depends on localization. So linexec should be built separately for every language. The suggested build works with storage card named "Storage Card". Here you can download linexec for other languages.
- This method definitely works for A620 with windows mobile 2003 SE. It may not work on other PDAs. In this case, try using the more powerful haret bootloader.
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:
- Format the second partition under ext2 or any other FS that your kernel supports.
- Download stage from gentoo.ru.
- Mount the second partition and untar stage on flash card.
- Edit /etc/conf.d/net and /etc/X11/xorg.conf according to your needs and your hardware
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=( "172.16.0.1 netmask 255.255.0.0" ) # 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 172.16.0.10, the old PAX250 stage uses 172.168.0.1, and the new PXA250 stage uses 192.168.0.201.
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.
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should be using interactive floor plans and real estate agent tools.
