Openmoko on HTC-Dream

From Openmoko

Revision as of 15:18, 3 October 2009 by Leviathan (Talk | contribs)

Jump to: navigation, search

Contents

Introduction

HTC-Dream is a android based phone. Android is running on top of a Linux kernel. So we have basically no work to do using this kernel to boot an Openmoko user space. This work is done. I booted an Openmoko user space. The way to do it on your own is described below.

Working

  • USB-Ethernet
  • Framebuffer console
  • Xfbdev

Setup the rootfs

  • In this example setup I used a SD-Card as root partition.
  • In order to follow this guide format a SD-Card (just like installing Openmoko on Neo Freerunner).
    • First partition: vfat
    • Second partition: ext2 (root)
  • mount it and extract http://ftp.o2s.ch/pub/fso-console-image-htcdream.tar.gz to it.

Use internal memory

Type root into the login screen and for password just type enter then

ifup usb0

Then connect to your htcdream over usb+ssh:

ifconfig usb0 192.168.0.200
scp fso-console-image-htcdream.tar.gz root@192.168.0.202:~
ssh root@192.168.0.202
gunzip fso-console-image-htcdream.tar.gz

Then mount the internal memory with the biggest space make it clean and install your openmoko:

mkdir /mnt/foo
mount /dev/mtdblock5 /mnt/foo -o noatime -t yaffs2
rm -rf /mnt/foo/*
tar xvf fso-console-image-htcdream.tar -C /mnt/foo

Bootloader

You need to install fastboot. In order to do this, you will have need to have "root" on the existing Android device or already have a developer version of the bootloader installed.

Kernel

Building new kernel

Use the kernel from the replicants. Fetch the kernel sourcecode from http://gitorious.org/replicant/gnulinuxkernel And configure it as you whish.

export HACK_DIR=`pwd`
git clone git://gitorious.org/replicant/gnulinuxkernel.git
cd gnulinuxkernel
wget http://wiki.openmoko.org/images/1/1e/Replicant_config.txt -O .config
wget http://bobcopeland.com/srcs/android/msm_wifi.patch
patch -p1 < ./msm_wifi.patch
make CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ ARCH=arm
sudo make CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ ARCH=arm modules_install
sudo mv /lib/modules/2.6-29-openmoko-msm /mnt/foo/lib/modules/
sync
umount /mnt/foo

Building boot.img

mkdir $HACK_DIR/mk_boot_img
cd $HACK_DIR/mk_boot_img
wget http://wiki.openmoko.org/images/9/92/Mkbootimg.bin
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mv Newramdisk.cpio.gz newramdisk.cpio.gz
sudo cp Mkbootimg.bin /usr/bin/mkbootimg

For SD-card rootfs

mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p2 rootdelay=2 fbcon=rotate:1" \
--kernel $HACK_DIR/gnulinuxkernel/arch/arm/boot/zImage \
--ramdisk ./newramdisk.cpio.gz -o openmoko-boot.img

For internal rootfs

mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mtdblock5 rootfstype=yaffs2 rootdelay=2 fbcon=rotate:1" \
--kernel $HACK_DIR/gnulinuxkernel/arch/arm/boot/zImage \
--ramdisk ./newramdisk.cpio.gz -o openmoko-boot.img

Flashing boot.img

  • Start into fastboot
  • execute
fastboot flash boot openmoko-boot.img
  • restart then handy
fastboot reboot

WLAN

Download http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 Unpack it. Change into the folder.

make ARCH=arm CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ KLIB=$HACK_DIR/gnulinuxkernel KLIB_BUILD=$HACK_DIR/gnulinuxkernel "$@"

Change up

cd ..

Run following script

#!/bin/sh
compat=compat-wireless-2009-09-30/
mkdir modules/
for i in $compat/net/mac80211/mac80211.ko \
           $compat/net/wireless/cfg80211.ko \
           $compat/net/wireless/lib80211.ko \
           $compat/net/wireless/lib80211_crypt_wep.ko \
           $compat/net/wireless/lib80211_crypt_ccmp.ko \
           $compat/net/wireless/lib80211_crypt_tkip.ko \
           $compat/drivers/net/wireless/wl12xx/wl1251_sdio.ko \
           $compat/net/rfkill/rfkill_backport.ko \
           $compat/drivers/net/wireless/wl12xx/wl1251.ko; do
           cp $i modules/
done

Copy it onto your device

scp -r modules root@192.168.0.202:~

Connect to your device and start the networking:

insmod rfkill_backport.ko
insmod cfg80211.ko
insmod mac80211.ko
insmod lib80211.ko
insmod lib80211_crypt_tkip.ko
insmod lib80211_crypt_wep.ko
insmod lib80211_crypt_ccmp.ko
insmod wl1251.ko
insmod wl1251_sdio.ko

Screenshots

Image.jpg Image2.jpg

Personal tools

Introduction

HTC-Dream is a android based phone. Android is running on top of a Linux kernel. So we have basically no work to do using this kernel to boot an Openmoko user space. This work is done. I booted an Openmoko user space. The way to do it on your own is described below.

Working

  • USB-Ethernet
  • Framebuffer console
  • Xfbdev

Setup the rootfs

  • In this example setup I used a SD-Card as root partition.
  • In order to follow this guide format a SD-Card (just like installing Openmoko on Neo Freerunner).
    • First partition: vfat
    • Second partition: ext2 (root)
  • mount it and extract http://ftp.o2s.ch/pub/fso-console-image-htcdream.tar.gz to it.

Use internal memory

Type root into the login screen and for password just type enter then

ifup usb0

Then connect to your htcdream over usb+ssh:

ifconfig usb0 192.168.0.200
scp fso-console-image-htcdream.tar.gz root@192.168.0.202:~
ssh root@192.168.0.202
gunzip fso-console-image-htcdream.tar.gz

Then mount the internal memory with the biggest space make it clean and install your openmoko:

mkdir /mnt/foo
mount /dev/mtdblock5 /mnt/foo -o noatime -t yaffs2
rm -rf /mnt/foo/*
tar xvf fso-console-image-htcdream.tar -C /mnt/foo

Bootloader

You need to install fastboot. In order to do this, you will have need to have "root" on the existing Android device or already have a developer version of the bootloader installed.

Kernel

Building new kernel

Use the kernel from the replicants. Fetch the kernel sourcecode from http://gitorious.org/replicant/gnulinuxkernel And configure it as you whish.

export HACK_DIR=`pwd`
git clone git://gitorious.org/replicant/gnulinuxkernel.git
cd gnulinuxkernel
wget http://wiki.openmoko.org/images/1/1e/Replicant_config.txt -O .config
wget http://bobcopeland.com/srcs/android/msm_wifi.patch
patch -p1 < ./msm_wifi.patch
make CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ ARCH=arm
sudo make CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ ARCH=arm modules_install
sudo mv /lib/modules/2.6-29-openmoko-msm /mnt/foo/lib/modules/
sync
umount /mnt/foo

Building boot.img

mkdir $HACK_DIR/mk_boot_img
cd $HACK_DIR/mk_boot_img
wget http://wiki.openmoko.org/images/9/92/Mkbootimg.bin
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mv Newramdisk.cpio.gz newramdisk.cpio.gz
sudo cp Mkbootimg.bin /usr/bin/mkbootimg

For SD-card rootfs

mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p2 rootdelay=2 fbcon=rotate:1" \
--kernel $HACK_DIR/gnulinuxkernel/arch/arm/boot/zImage \
--ramdisk ./newramdisk.cpio.gz -o openmoko-boot.img

For internal rootfs

mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mtdblock5 rootfstype=yaffs2 rootdelay=2 fbcon=rotate:1" \
--kernel $HACK_DIR/gnulinuxkernel/arch/arm/boot/zImage \
--ramdisk ./newramdisk.cpio.gz -o openmoko-boot.img

Flashing boot.img

  • Start into fastboot
  • execute
fastboot flash boot openmoko-boot.img
  • restart then handy
fastboot reboot

WLAN

Download http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 Unpack it. Change into the folder.

make ARCH=arm CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ KLIB=$HACK_DIR/gnulinuxkernel KLIB_BUILD=$HACK_DIR/gnulinuxkernel "$@"

Change up

cd ..

Run following script

#!/bin/sh
compat=compat-wireless-2009-09-30/
mkdir modules/
for i in $compat/net/mac80211/mac80211.ko \
           $compat/net/wireless/cfg80211.ko \
           $compat/net/wireless/lib80211.ko \
           $compat/net/wireless/lib80211_crypt_wep.ko \
           $compat/net/wireless/lib80211_crypt_ccmp.ko \
           $compat/net/wireless/lib80211_crypt_tkip.ko \
           $compat/drivers/net/wireless/wl12xx/wl1251_sdio.ko \
           $compat/net/rfkill/rfkill_backport.ko \
           $compat/drivers/net/wireless/wl12xx/wl1251.ko; do
           cp $i modules/
done

Copy it onto your device

scp -r modules root@192.168.0.202:~

Connect to your device and start the networking:

insmod rfkill_backport.ko
insmod cfg80211.ko
insmod mac80211.ko
insmod lib80211.ko
insmod lib80211_crypt_tkip.ko
insmod lib80211_crypt_wep.ko
insmod lib80211_crypt_ccmp.ko
insmod wl1251.ko
insmod wl1251_sdio.ko

Screenshots

Image.jpg Image2.jpg