Please remember to add a category to the bottom of each page that you create.
See categories help for further details, but most will probably be [[Category:HTC ModelName]].

KaiserLinux

From XDA-Developers
Jump to: navigation, search

androidlogo.png

Linux & Android on Kaiser

This page is meant for people who want to know the progress on getting Linux (and Android) to work on the HTC Kaiser device.

A lot of work has already been done by the following contributors (in alphabetical order):

  • BabelO
  • baz/ginge (Barry Carter)
  • cr2
  • dcordes
  • dzo (Dr. Martin J. Johnson)
  • marbalon (Marcin)
  • martin_(Martin Ling)
  • premy (Patrick Remy)

PLEASE NOTE: The above named persons do not take responsibility for anything you do with your phones.

In case you feel you can help out, you can find us using IRC on #htc-linux on Freenode.

You can also email:

barry.carter@gmail.com lukas.gorris@gmail.com (author of this document)

Here are some tips on customization. When you make changes in a way that would be useful to other Android users, create a patch and attach it to a forum post so that it can be incorporated into future images.


Current state

Please note that Android on the Kaiser is partially working, there is a lot of development still to be done. You can run Android, but device drivers are not working properly or even not at all. Below you'll see what works and what doesn't.

Android Cupcake

Tasks Status Comment
Boot Yes Android is booting.
Graphical interface Yes Graphical interface working fine. Some applications have resolution issues
Touch screen Yes .
R/W Access to /dev/smd0 (Control Channel) Yes .
R/W Access to /dev/smd1 (For PPP) Yes .
SD Storage Access Yes .
Hardware keyboard Yes Very functional keypad including LEDs.
Hardware button mapping Yes .
Hardware buttons: On/Off No .
Navigation Control/Enter Yes .
Stylus detection Yes A functional touch screen.
USB yes .
WLAN yes Data works, incomplete DMA support.
Bluetooth No .
GPS yes .
GPRS/EDGE/3G/HSUPA Yes .
Audio Routing (Phone) Yes Calls and pcm audio works.
SMS/MMS Yes .
Camera: front/back No .

Useful links


Research


Progress

Is under heavy development latest build: http://www.androidonhtc.com/kaiser:latest_builds

Build a Kernel

How to build the Kaiser/Nike/Polaris/Vogue kernel

This mini HOWTO is taken from dwaradzyn's post and slightly changed/updated



Initialized empty Git repository in /home/user/android-kernel/kernel/.git/ remote: Counting objects: 908251, done. remote: Compressing objects: 100% (153970/153970), done. remote: Total 908251 (delta 755115), reused 906063 (delta 753016) Receiving objects: 100% (908251/908251), 281.86 MiB || 292 KiB/s, done. Resolving deltas: 100% (755115/755115), done. Checking out files: 100% (22584/22584), done.

  • The htc-vogue branch is of our interest (again it could take a few seconds)
 The reason we use the vogue branch is that the code is very similar to the original vogue code. 
  • cd kernel
  • git checkout -b htc-vogue origin/htc-vogue
  • sample output:

Branch htc-vogue set up to track remote branch refs/remotes/origin/htc-vogue. Switched to a new branch "htc-vogue"

  • To update this branch once new commits have been made
  • run "git pull" (inside kernel directory)

Compile the kernel

Prepare default .config for Kaiser. The following will launch the config menu and ensure Kaiser is selected (along with Niki/Polaris/Vogue) in System Type. Also take care, that File Systems -> Miscellaneous Filesystems -> SquashFS is selected if you are going to mount squash images.

  • make vogue_defconfig ARCH=arm; make menuconfig
  • output:

........ lots of output ........

  1. configuration written to .config

  • And finally compile the kernel to get zImage (takes a minute or two):
  • export PATH=/path_to_android-kernel/arm-2008q3/bin:$PATH
  • make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
  • output:

........ lots of output ........

 Kernel: arch/arm/boot/zImage is ready 

  • Now copy zImage to your phone and play with it.
 Easiest way I found is to use synce-pcp (apt-get install librapi2-tools) when connected through USB 
  • synce-pcp arch/arm/boot/zImage :/Storage Card/zImage (or whatever the card is called in your language - e.g. Speicherkarte in German)
 or just copy it to the SD-card using a cardreader 
  • cp arch/arm/boot/zImage /media/disk-1 (path to your SD-card)

The other files you need:

  • data.gz (=> data.img)
  • default.txt
  • Kaiser
  • Niki
  • Polaris
  • Vogue
  • haret-0.5.2.exe
  • initrd.gz
  • system.img
  • tap the haret.exe, and accept the warning
  • when haret is running tap "run"


haret will now load the kernel and boot up android..
and you are ready to go..
when you have made the changes you want to the kernel it is just a matter of overwriting the zImage on the phone.


Get su & busybox Working

The problem is that su and busybox are not in the PATH. The busybox tools are in the /bin directory. There are other tools in the /system/xbin directory (including su), but there are not as useful. To confirm this try running /bin/ls --version which should be the busybox version. Running ls should give a color-coded listing of files and directories.

Solutions

There are at least a couple ways to solve this problem. Try one of the following.

Change the PATH when you start a shell

Run a line like export PATH=/bin:$PATH every time you start a shell. This will add the busybox tools to your PATH.

Create a symbolic link to /bin

Follow the instructions for Android data.gz image Customization. Once you have extracted the image on your PC, do the following.

cd local 
ln -s /bin bin 

This will create a symbolic link from the data image (which is in the PATH) to the /bin directory.

Notes

By the way, the /data/local/bin directory is in the data.gz image. The /bin directory is in the initrd.gz image.

Android data.gz image Customization

To customize the data.gz image, you either need to extract the files or mount the image on your PC. Let's mount the image. Copy the data.gz file from your SD card to your PC. mkdir data_image cp data.gz data_original.gz #make a backup gunzip data.gz sudo mount -o loop data data_image su and enter your PC root password cd data_image Look around and make changes sync cd .. exit #exit from su sudo umount data_image gzip data Copy the data.gz to your SD card.

If you have problems, paste your shell session into a forum post and ask for help nicely.

Android system.img Customization

To customize the system.img image, you either need to extract the files or mount the image on your PC. Let's mount the image.

  • Copy the system.img file from your SD card to your PC.
  • mkdir stock-system
  • sudo mount -o loop system.img stock-system
  • genext2fs -d stock-system -b 300000 -a system.ext2
  • mkdir temp
  • sudo mount -o loop system.ext2 temp/

---Make Changes---

  • sudo mkfs.cramfs temp/ system.1.5.img
  • sudo umount system_image
  • sudo umount temp

If you have problems, paste your shell session into a forum post and ask for help nicely.

See http://forum.xda-developers.com/showpost.php?p=4012234&postcount=5974 and http://forum.xda-developers.com/showpost.php?p=4016100&postcount=4.

Restoring Bookmarks and Email settings on a new data.img

If you need to start with fresh data.img frequently, you'll have to set your bookmarks, email and other settings again. It's possible to save your preferences in a text file and restore them in a new data.img. Basically, we'll dump the database into a text file and then restore it.

Bookmarks

To dump the bookmarks into a text file, do something like this. $ su -c "sqlite3 /data/data/com.android.browser/databases/browser.db" sqlite> .output bookmarks.sql sqlite> .mode insert sqlite> select* from bookmarks sqlite> exit You'll need to edit the file bookmarks.sql changing table to bookmarks. Save the file on your sdcard.

Here's a short script to restore the bookmarks database.

#!/bin/ash # import bookmark database from sql format

#delete all bookmarks echo deleting all bookmarks before import... su -c "sqlite3 /data/data/com.android.browser/databases/browser.db 'delete from bookmarks'"

#import bookmarks from sdcard echo Importing bookmarks... su -c "sqlite3 /data/data/com.android.browser/databases/browser.db '.read /sdcard/bookmarks.sql'"

Email accounts

The email account information is stored in a file like /data/data/com.android.email/shared_prefs/AndroidMail.Main.xml Save that file on your sdcard. When you use a fresh data.img, copy it over before your start the email application. (If you need to edit the xml file, use sort -k 3 AndroidMail.Main.xml first to organize the file a little.)

Porting linux command line apps to Android

Here are some links to information on porting command line linux apps to Android. We need help creating some better instructions.

Android Keyboard Customization

Can you help complete these instructions? How can I add the ">" key to the AT&T Tilt keymap?

Here are some relevant documents.

Android Kaiser wifi

Here is a package with all the needed files and a brief how to to get wifi running on the ti-series of wireless radios. http://www.homecncfun.com/my-downloads/?did=7

Android on the Kaiser (And Variants)

This page is meant for people who want to know the progress and process of getting Android (even Linux) to work on the Kaiser.

Warning! Please read all the instructions BEFORE attempting, this is not ready for full public use yet and a lot of features do not work, or just plain crash. Be prepared to do soft resets, possible data loss of your SD Card, or a hard reset if things go bad. If you still want to try Google Android on your Kaiser, please continue reading.

Please edit me to keep everyone up to date!

Current state - Android 1.1

Tasks Status Comment
Boot OK .
Graphical interface  ? .
Touch screen Yes Working.
SD Storage Access Partial Will see Audio and Photos
Hardware keyboard Yes add board-kaiser-keypad.atttilt=1 to default.txt in set cmdline for ATT Tilt
Hardware buttons .
  • Power = Button Power
  • Camera Button = Run camera
  • Scrollwheel = Up/Down
  • Up = Up
  • Down = Down
  • Right = Right
  • Left = Left
  • Center = Select
  • Talk = Talk
  • Back/End = End/Screen Off
  • Right Softkey = Volume up (phone, media, alarm)
  • Left Softkey = Volume down (phone, media, alarm)
  • IE = Home
  • Mail = ?
  • Start Button = Menu
  • PTT = ?
  • OK = back
USB  ? .
Wifi Yes .
Bluetooth NO .
GPS Yes .
GPRS/EDGE/3G/HSUPA Partial/?/?/? .
Audio Yes To listen to your music
Audio Routing (Phone) Yes To make & receive calls
SMS/MMS YES/YES .
Camera: front/back NO/NO .

Updates

Rather than keep the above table up to date, you can check the port status on the Android on HTC Site here

Updated 11/10/2010 - thought it might be helpful to list the different builds available, they all have pros and cons and things that don't quite work. There are 2 main versions at present, but each 'cook' creates their own variant, so its personal choice which one you wish to use. Donut is Android 1.6. Eclair is Android 2.1

Most stable build (has the most working features) at time of writing is Myn's Warm Donut (Android 1.6).

Below is the current list of builds with what Doesn't work! next to it.

Donut:

Eclair

A good Thread for those new to Android Android FAQ - Starting point for Android newbies

Ensure you have the latest Kernel for your build for Eclair use dzo kernel's

Another good thread to check out is Google Android on the HTC Kaiser

How to get Android up and running on the Kaiser's SD card (doesn't flash phone).

Note: Radio and ROM version no longer matter (not verified.) And formatting the Storage card to FAT32 seems to work better.

If you wish to partition your SD Card to 1 x FAT32 and 2 x EXT2 partitions (System/Data), then this a good How to Thread or follow the how to video.

  • Get the latest files from here (under Files, the link Latest Version): here
  • or here

You need both the basefiles and Haret archive files.

  • Extract these files to the root of your SD card
  • Edit default.txt to look like the following:


 set RAMSIZE 0x07000000
set RAMADDR 0x10000000
set FBDURINGBOOT 0
set MTYPE 1553
set KERNEL zImage
set initrd "\Storage Card\initrd.gz"
set cmdline "pm.sleep_mode=4 board-htcvogue.panel_type=0 msm_sdcc.msmsdcc_fmax=20000000 no_console_suspend"
boot


  • For non english version of Windows Mobile, replace "Storage Card" by the name of your storage card. E.g. "Carte de Stockage" for French.
  • AT&T Users should replace the 'cmdline' above with the following to enable data connections:


 set cmdline "ppp.username=WAP@CINGULARGPRS.COM ppp.password=CINGULAR1 board-kaiser-keypad.atttilt=0 pm.sleep_mode=4 board-htcvogue.panel_type=0 msm_sdcc.msmsdcc_fmax=20000000 no_console_suspend"


  • Run the file haret.exe
  • Click the Run button >
    • It is possible to use a folder for the files, or to use a kaiser specific default.txt which is in Dzo's archive but as some people find difficulty doing this, I have provided a simple set of instructions.
    • If you really don't understand any of the above, or even below, I STRONGLY suggest to reconsider messing with Android until it matures a little more to run on our Kaisers.

Here is an example directory structure of a working storage card.

Storage Card/

   AndroidApps/      -- This folder is for .APK files, which I will explain later.
download/
Music/
PICTURES/ -- Put photos here!
wallpapers/ -- The phone will read this just like the "Pictures Folder"
./data.gz -- data.bin after you load it for the first time.
./DEFAULT.TXT -- This file will tell HARET what to do.
./HARET.exe -- Loads Android
./INITRD.gz
./system.bin -- System Files
./zImage -- The Kernel, The heart of linux, be prepared to replace this file a lot as updates are released.

How do I install an .APK file that I've downloaded?

Easy! Create the AndroidApps folder on your storage card, and place them in there. Note that some apps will not show up unless you use another app called appinstaller that will let you use NON Market apps on the phone more easily.

Will Android reflash my phone?

NO! at least not yet. What it does is shut down Windows Mobile to load up Android, which does not harm your existing Rom.

Can I Make calls?

Yes, you can also receive calls as well! As of right now though, all audio is through the speakerphone.

Can I send or receive texts or picture messages?

SMS is working, and MMS works when connected to the internet.

Does GPS Work?

Yes.

Will Android ever turn on me?

Well, not unless you let it watch Terminator or Battlestar Galatica too much. But that would just be silly, a phone watching tv.... Or would it...

Sites of interest.


Back to Kaiser