[G1 Android Development] farmatito:
I've been working on tweaking the 2.6.32.11 kernel to boot on my G1

and so far have a working setup that seems to be stable on cyanogenmod 4.2.15.1.

What works:

Phone

Bluetooth

Wifi

GPS

ADB

What doesn't work:

Camera: the kernel has a driver for the Video/Camera but the userspace

doesn't like it. I've tried to forwardport the old camera from

2.6.29 but I was not able to make it fully functional due to

the big differences in the code paths. So some more work of

java gurus is needed to match android camera and kernel camera

driver.

What I've used:

kernel source: android-msm-2.6.32 from http://android.git.kernel.org/?p=ke...e6e272c600d7fa3d8722351129b04b0697e608;sf=tgz

wifi driver: sta_dk_4_0_4_32 from http://android.git.kernel.org/?p=pl...aef43e0d0454b3119a5299561073700d2c7e14;sf=tgz

compcache-0.6.2: http://compcache.googlecode.com/files/compcache-0.6.2.tar.gz

BFS 313: http://www.kernel.org/pub/linux/ker...6.32/2.6.32-ck2/2.6.32-ck2-broken-out.tar.bz2

What patches I've applied:

# cd to your kernel source dir
patch -p1 -E < 001_fix_kpanic_warning.patch
# Revert net_dev_ops removal for sta_dk_4_0_4_32 driver
patch -p0 -R -E < 002_REVERT_compat_net_dev_ops.patch
patch -p1 -E < 003_2.6.32-sched-bfs-313.patch
patch -p1 -E < 004_patch-2.6.32.9-10.patch
patch -p1 -E < 005_remove_dream_staging.patch
patch -p1 -E < 006_update_sysctl_blackfin.uclinux.org.patch
patch -p1 -E < 007_sched_no_newline.patch
patch -p1 -E < 008_msm_smd_fix.patch
patch -p1 -E < 009_msm_evlog_fix.patch
patch -p1 -E < 010_export_init_task_for_wlan.patch
# For compcache with CONFIG_SWAP_FREE_NOTIFY uncommented in compat.h
patch -p1 -E < 011_swap_notify_core_support.patch
# For BFS
patch -p1 -E < 012_sched-add-above-background-load-function.patch
# No improvements in performance, rather a decrease empirically
# measured, so I removed them, maybe they could be applied after more testing
# patch -p1 -E < 013_mm-make_swappiness_really_mean_it.patch
# patch -p1 -E < 014_mm-kswapd_inherit_prio.patch
# patch -p1 -E < 015_mm-background_scan.patch
# patch -p1 -E < 016_mm-idleprio_prio.patch
# patch -p1 -E < 017_mm-lru_cache_add_lru_tail.patch
# patch -p0 -E < 018_no_bfs_vmscan_fix.patch
patch -p1 -E < 019_patch-2.6.32.10-11
patch -p0 -E < 020_2.6.32.11_rfcomm_fix.patch
patch -p0 -E < 021_fix_wakelock_warning.patch
patch -p0 -E < 022_partitions_check_warning_fix.patch

My config is: BFS enabled, compcache enabled, SLOB allocator, CFQ elevator (see attached config.txt for details).

Attached to test with Cyanogenmod 4.2.15.1 you will find zipped copies of:

new_boot.img
wlan.ko
modules.sqf
patches/

TAKE A BACKUP FIRST AND TEST IT ONLY IF YOU KNOW WHAT YOU ARE DOING!!!

To test it:

sudo adb shell
umount /system/modules/
cp /system/modules/modules.sqf /sdcard/
cp /system/lib/modules/wlan.ko /sdcard/
exit
adb remount
adb push wlan.ko /system/lib/modules/
adb push modules.sqf /system/modules/
adb shell
reboot

Enter fastboot mode

sudo fastboot boot new_boot.img

To restore your old system:

sudo adb remount
adb shell
umount /system/modules/
cp /sdcard/modules.sqf /system/modules/modules.sqf
cp /sdcard/wlan.ko /system/lib/modules/wlan.ko
reboot

This instructions are as I recall them, I hope that I didn't forget some steps...

The kernel worked fine during the last days of testing, interactivity is

good and with BFS very fluid. Probably it could be tweaked further.

The main problem is the camera not working but my java skills are not enough

to fix it.

Enjoy it and USE AT YOUR OWN RISK!

farmatito

;-)