[Touch Cruise Android Development] devslashnull:
Tried the procedure, but it failed miserably at applying the mentioned patch file. I question the line:

Code:
git checkout -b android-msm-2.6.25

That branch is not htc specific, and it may be the cause of the problems.

I've been talking to a number of people (dcordes, thanks), on the #htc-linux channel at freenode IRC, and finally I managed to build a linux kernel that actually boots with Haret 0.5.1.

The steps are pretty simple and follow the basic procedure as indicated by bally. However, instead of checking out the android-msm-2.6.25 branch, I did:

Code:
git checkout -b my-android-msm-htc-2.6.25 origin/android-msm-htc-2.6.25

That creates a local branch that tracks the original/android-msm-htc-2.6.26 branch in the android repository.

Then download the following patch files:

wget http://linuxtogo.org/~szsoftware/kernel/diffs/02-against_android-msm-htc-2.6.25/01-android-msm-htc-2.6.25_kaiser_20082210.diff
http://linuxtogo.org/~szsoftware/kernel/diffs/02-against_android-msm-htc-2.6.25/02-android-msm-htc-2.6.25_polaris_add-files.diff
http://linuxtogo.org/~szsoftware/kernel/diffs/02-against_android-msm-htc-2.6.25/03-android-msm-htc-2.6.25_polaris_file-changing.diff

Change into the kernel directory, and apply the patches in order:

cd kernel
patch -p1 < ../01-android-msm-htc-2.6.25_kaiser_20082210.diff
patch -p1 < ../02-android-msm-htc-2.6.25_polaris_add-files.diff
patch -p1 < ../03-android-msm-htc-2.6.25_polaris_file-changing.diff

These patches should apply cleanly, at least, that's what they did with the c092738e01ab845dc7406dc1b53589b1f9edebbc revision of the branch. Check whether you have that after the git checkout.

git log

This should start with the following:

commit c092738e01ab845dc7406dc1b53589b1f9edebbc
Author: Brian Swetland <swetland@google.com>
Date: Thu Oct 9 18:31:07 2008 -0700

trout: update msm_defconfig to match dream/G1 1.0 configuration

With a later or earlier revision the patches may fail to apply correctly.

Then build the kernel according to the procedure listed by bally. One thing to add perhaps. I'd stick in a 'make destclean' after applying the patch. I did that, as I followed the procedure described by szsoftware on the linuxtogo.org site:

http://linuxtogo.org/~szsoftware/kernel/diffs/README

This is a diff container directory.
Branch specific diffs are in their directories.
They reside their as symlinks, which point to diffs in this container.

Apply the patches in the numbered order.
They should apply cleanly against the related kernel snapshot.

Patching / compiling example:
-----------------------------

polaristester@host:~/<kernel-dir>$ patch -p1 < patchfile
polaristester@host:~/<kernel-dir>$ make distclean
polaristester@host:~/<kernel-dir>$ make htcpolaris_defconfig
polaristester@host:~/<kernel-dir>$ make menuconfig	(if needed)
polaristester@host:~/<kernel-dir>$ make zImage
polaristester@host:~/<kernel-dir>$ cp arch/arm/boot/zImage <your_polaris_sd-card>/polaris-bootkit/zImage-<kernel-version>-polaris

The branch with latest development is numbered minor.

The resulting zImage (in <kernel-dir>/arch/arm/boot/zImage) boots with Haret 0.5.1 in combination with the angstrom initrd I got from http://linuxtogo.org/~lgorris/kaiser-bootkit/angstrom-20081127.cpio.gz. For your information, the .cpio.gz format is actually the format of the initrd file needed by the kernel to mount its root file system.

The patches from szsoftware apply against the revision c092738e01ab845dc7406dc1b53589b1f9edebbc of the android-msm-htc-2.6.25 kernel, which is the one that has shipped on the G1. So that's pretty neat. The htcpolaris-defconfig does not enable everything needed though, and there is a lot of mapping work to be done. Still, nice to see a login prompt.

Oh, last thing. If you decide to replicate things, you'll find that at the login prompt you cannot type (you should type root, and login), however the onscreen keyboard does not work yet in this branch. In an older branch (in fact, the zImage that has been posted way back in the previous post on porting android 'Android is working...') combined with the angrom initrd does provide an onscreen keyboard (activate with the camera button), and you can login. Fun! :)

The next things to do are (well, as I see it):

1) get the onscreen keyboard working again

2) get the sd card driver to work properly

3) boot the kernel with haret, but with a rootfs mounted on the external sd card

4) get some sort of way working to get kernel debug messages (the VOGUE kernel has a way to log kernel messages to ram, and dump the ram after a soft-reset from Windows Mob.).