# Fetch msm kernel tree
git clone git://android.git.kernel.org/kernel/msm.git
cd msm
# Switch to Nexus One 2.2…
git checkout origin/android-msm-2.6.32
# …or 2.1
git checkout origin/android-msm-2.6.29-nexusone
# Get config
wget
http://sven.killig.de/android/N1/2.2/usb_host/.config# Patch (No device mode, Andrew de Quincey’s work not ported yet.)
wget
http://sven.killig.de/android/N1/2.2/usb_h..._usb-host.patchpatch -p1 < android-kernel_msm-v2.6.30-rc2-27223-g248970b_Nexus-One_usb-host.patch
# Build
make -j2 ARCH=arm CROSS_COMPILE=/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-
# Boot from RAM (till next reset)…
fastboot boot arch/arm/boot/zImage
# …or write to flash (boot.img from nandroid backup)
/getramdisk.py boot.img
/mydroid/out/host/linux-x86/bin/mkbootimg --kernel arch/arm/boot/zImage --ramdisk ramdisk.img --base 0x20000000 -o boot_usb-host.img
fastboot flash boot boot_usb-host.img
# Start ConnectBot and connect to Local
insmod drivers/usb/core/usbcore.ko
insmod drivers/usb/host/ehci-hcd.ko
insmod drivers/usb/storage/usb-storage.ko
insmod drivers/hid/usbhid/usbhid.ko
mount /dev/block/sda1 /sdcard/usbstick