Installing Linux on Palm LifeDrive

Rólam
   Főoldal
   Önéletrajzom
   Képek

Tanulmányok és Oktatás
   EAF1
   EAF3
   EAF4
   Fontkészlet
   PNY1
   PP
   ProgKör
   Visual Basic

Érdeklődési körök
   Linux
   Linux PalmLD
   RDiff

Munkák
   Önéletrajz
   CV in English




utolsó módosítás:
2010. augusztus 9.

NOTE: This document is no longer actively developed, since I switched to an Android based device.

About this document

The goal of this is to describe the steps for building and upgrading Linux distribution for Palm LifeDrive PDA. These steps are based on http://www.openembedded.org/index.php/Getting_Started as starting point.

Installing required softwares

You should install into the build environment the softwares mentioned on http://www.openembedded.org/index.php/Required_Software

Directory Structure

The next step is completing the same part of the http://www.openembedded.org/index.php/Getting_Started document. NOTE: The same notation will be used for directories as the step uses (namely /stuff for base directory of the build environment). NOTE: I use /angstrom-sources for location of the sources downloaded by either directly or thru bitbake.

Obtaining BitBake

I recomend installing BitBake from the svn repository described in Getting Started document. The steps are the followings (included from the document):

cd /stuff/
svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake

Obtaining OpenEmbedded

cd /angstrom-sources
git clone git://git.openembedded.org/openembedded
cd /stuff
git clone /angstrom-sources/openembedded

The above commands create two repositories. The first is a mirror from the original repository while the second is mirror of the first one. This is needed because if you want to use a particular commit id, you should do:

cd /stuff/openembedded
git reset --hard <commitid>

This would cause the HEAD relocated on the git repository so you can go back to the original HEAD with:

cd /stuff/openembedded
git pull

The last command would pull from /angstrom-sources/openembedded. You could use the online repository for the same but why bother with the bandwidth?

Updating the mirror:

cd /angstrom-sources/openembedded
git pull

If you updated your repository and want to update your working copy, do the following steps:

cd /stuff/openembedded
git pull

TODO: Explore how the git branching system could be used for this task.

Creating local configuration

cd /stuff
mkdir -p build/conf
cp openembedded/conf/local.conf.sample build/conf/local.conf

Edit your build/conf/local.conf file (and read it). Beside your decisions, you should set the next settings (you may change some of them, if for example you decide to move your sorce directory):

  • DL_DIR = "/angstrom-sources"
  • BBFILES := "/stuff/openembedded/recipes/*.bb"
  • PREFERRED_PROVIDERS += " virtual/libqte2:qte" NOTE: After the PREFERRED_PROVIDERS settings.
  • MACHINE = "palmld"
  • DISTRO = "angstrom-2008.1"
  • DISTRO_TYPE = "release"
  • IMAGE_FSTYPES = "ext2"
  • PARALLEL_MAKE = "-j 2" NOTE: Use this if your system has multiple processor or processor with more than one core installed. The number is suggested to be the count of processors or processor cores.
  • Remove the whole line containing definition of REMOVE_THIS_LINE.

Setting up build environment variables

The build process need some environment variables to export. You can set up these every time you want to build. You can also set up your system to export these variables every time you login. For this edit your ~/.bashrc file and add the next lines to a point that is reached in your file:

export PATH=/stuff/bitbake/bin:$PATH	# use your bitbake not system wide installed if there is any
export BBPATH=/stuff/build:/stuff/openembedded

Corrections to the build database

opie-taskbar-images

CVS version of this package is selected but it does not compile.
Solution: Edit /stuff/openembedded/recipes/opie-taskbar/opie-taskbar-images_cvs.bb, replace PV value with the actual date (in YYYYMMDD format). On 2007. october 11.:

PV = "20071011"

TODO: Maybe stable 1.2.3 version could be selected with PREFERRED_PROVIDERS.

Build the kernel and OPIE

cd /stuff/openembedded
bitbake virtual/kernel opie-image

Go eat a pizza. (This will take long time.)

Clean rebuild in a properly set up environment

  • cd /stuff
    rm -rf tmp org.openembedded.dev
    mtn --db=/angstrom-sources/OE.mtn checkout --branch=org.openembedded.dev
    

  • Complete "Corrections to the build database".

  • bitbake virtual/kernel opie-image
    

TODO: bitbake virtual/kernel should be corrected it generates a fully unbootable kernel.

Setting up build environment for the kernel

cd /stuff/openembedded/tmp/cross/armv5te/bin
for prg in gcc ld ar nm objcopy; do
	ln -s arm-angstrom-linux-gnueabi-$prg arm-linux-$prg
done

Add the next line to your ~/.bashrc:

export PATH=/stuff/openembedded/tmp/cross/arm5vte/bin:$PATH

Building the kernel

Palm LifeDrive default config works for the first steps. It could bring up the console. It does not boot however but with bitbake virtual/kernel the console is only filled with garbage. There is a bug in the kernel source code version used by the openembedded repository, so you should compile the most up to date kernel from git://git.hackndev.com/hackndev/linux-hnd.git .

cd /angstrom-sources
git clone git://git.hackndev.com/hackndev/linux-hnd.git

TODO: Check if the HEAD of monotone repository uses a good kernel (without battery draining bug).

Unpacking initramfs.tar.bz2:

su
tar -xvvjf /angstrom-sources/initramfs.tar.bz2 -C /stuff

Getting the kernel source (from local repository):

cd /stuff
git clone /angstrom-sources/linux-hnd

Updating the kernel source:

cd /angstrom-sources/linux-hnd
git pull
cd /stuff/linux-hnd
git pull
cd /stuff/linux-hnd
make palmld_defconfig
make menuconfig

In the menu which is bringing up after issuing the make menuconfig command you should:

  • Change the location of initramfs source to /stuff/initramfs. This file is generated from busybox sources (you must compile them to a static version of busybox). TODO: Integrated initramfs building into the automatic kernel building process

  • Remove PCMCIA support, because the palmld_pcmcia kernel module loading causes freeze (in currently used kernel version - this may change in next kernel versions). System Type --> Intel PXA2xx Implementations --> Palm LifeDrive --> Palm LifeDrive PCMCIA driver --> < >

  • Remove USB support, because battery draining. Device Drivers --> USB support --> USB Gadget Support --> Support for USB Gadgets < >

TODO: Check if most up to date kernel contains this bug (PCMCIA).

TODO: Check if most up to date kernel contains battery draining if USB support is enabled.

After exiting from the menu you should end up with a kernel config (.config) similar to this one: kernel-config.

Start building the kernel.

make

NOTE: After the kernel is built, you should install your just compiled kernel modules into the image.

su -m
cd /stuff/linux-hnd
modprobe loop
rm -rf /tmp/new_modules
make INSTALL_MOD_PATH=/tmp/new_modules modules_install
rm -f /tmp/new_modules/lib/modules/2.6.21-hnd3/build
rm -f /tmp/new_modules/lib/modules/2.6.21-hnd3/source
mount -oloop /stuff/openembedded/tmp/deploy/glibc/images/palmld/opie-image-palmld.ext2 /mnt
rm -rf /mnt/lib/modules
cp -af /tmp/new_modules/lib /mnt
rm -rf /tmp/new_modules
umount /mnt
exit

NOTE: I will integrate kernel building process into bitbake package.

Making the touchscreen work

In the generated opie image the touchscreen is not working for some reason. You should use this /etc hierarchy instead of the one generated into the image.

su -m
modprobe loop
mount -oloop /stuff/org.openembedded.dev/tmp/deploy/glibc/images/palmld/opie-image-palmld.ext2 /mnt
tar -xvvjf /angstrom-sources/etc.tar.bz2 -C /mnt
umount /mnt
exit

TODO: Integrate etc.tar.bz2 content to the bitbake files.

TODO: Document that initramfs could be added by setting CONFIG_INITRAMFS_SOURCES to the apropriate directory/file.

TODO: initramfs should be automatically/automagically be assembled, generate list file for this.

Displaying the power state of the device

Bitbake opie-batteryapplet:

cd /stuff/org.openembedded.dev
bitbake opie-batteryapplet

Copy the resulting opie-batteryapplet_1.2.3.ipk to the device and install it from the running OS. TODO: This step and the previous (build & install) should be achived by bitbake opie-image.

Under the running OS issue the following command to load battery support:

modprobe palm_battery

TODO: This should be done automatically by inserting the palm_battery line to the correct file in /etc.

TODO: This should be set up automatically by correcting the image which is generated by bitbake opie-image. (After the touchscreen bug is eliminated.)

TODO: Update initramfs capability to the one provided by TP2 image.

This is build 20080102.

This build is the above steps repeated from clean sources. Integrated experiments from build 20071113 and build 20071231.

This build results in a fully bootable image.

NOTE: With the most up to date kernel, USB module unloaded, palm_battery module loaded and opie-batteryapplet installed it seems that the battery draining problem is gone.

Next step is to bring sound device into working state (if TP2 can do it).

Log for build 20080102

TODO: Disabling bluetooth results in freeze - probably opie application tries to remove the bluetooth module and causes a kernel crash (need to test on TP2 too).

TODO: Opie-batteryapplet says that remaining power is near 50% however palm's own application says it is near 90%. (There could be an error in reading the remaining power from the hardware.) Tested on both 20080102 build and on TP2.

TODO: Need to tap twice on Suspend menu to start the suspending of the OS.

MTN versions

  • 20071020: 2007-10-20T19:01:23
  • 20080320: 2008-03-20T19:55:31
  • 20080821: 2008-08-20T23:17:40 (currently does not compile)

QA tests

  • Booting should be succeded five times from five tries.
  • Touch screen should work.

Stay tunned :)

Older builds

cd /stuff/org.openembedded.dev/tmp/work/palmld-angstrom-linux-gnueabi/linux-hackndev-2.6-2.6.21-hnd2-r11/trunk

bitbake opie-zsafe