Openmoko on HTC-Dream

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Current status)
 
(65 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 +
= Current status =
 +
* <span style="background:green"> '''The HTC Dream support has been merged in the SHR distribution.'''</span>
 +
* [http://trac.shr-project.org/trac/wiki/Devices/HTCDream/InstallGuide An Installation guide] is available on the SHR wiki
 +
 +
== Headline text ==
 +
 +
= History =
 +
 +
<span style="background:red">The following page is kept for historical reasons only</span>
 +
 
== Introduction ==
 
== Introduction ==
 +
 
HTC-Dream is a android based phone.
 
HTC-Dream is a android based phone.
Android is running on top of a linux kernel.
+
Android is running on top of a Linux kernel.
So we have basically no work to do using this kernel to boot an OpenMoko userspace.
+
So we have basically no work to do using this kernel to boot an Openmoko user space.
 
This work is done.
 
This work is done.
I booted an OpenMoko userspace.
+
I booted an Openmoko user space.
 
The way to do it on your own is described below.
 
The way to do it on your own is described below.
 +
For questions ask leviathan and GNUtoo in irc://irc.freenode.net/#htc-linux
 +
 +
''If leviathan doesn't answer, he might be smoking ATM or be working elsewhere.''
 +
''In this case, try to contact him on jabber, or leave him an offline message: leviathan@xmpp.ccczh.ch''
 +
 +
'''If links are down, just try the overlay'n directory. The site is outdated very fast!'''
 +
 +
 +
=== Working ===
 +
* USB-Ethernet
 +
* Framebuffer console
 +
* Xorg
 +
* Wifi
 +
* Touchscreen
 +
* Phonecalls
 +
* ALSA
  
 
== Setup the rootfs ==
 
== Setup the rootfs ==
 
* In this example setup I used a SD-Card as root partition.
 
* 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 NeoFreerunner).
+
* In order to follow this guide format a SD-Card (just like installing Openmoko on Neo Freerunner).
 
**  First partition: vfat
 
**  First partition: vfat
** Second partition: ext2 (root)
+
** Second partition: ext3 (root)
* mount it and extract http://downloads.openmoko.org/distro/releases/Om2008.12/Om2008.12-om-gta02.rootfs.tar.gz to it
+
* mount it and extract http://ftp.o2s.ch/pub/openmoko/htcdream/repo/images/htcdream/shr-full-eglibc-ipk--20100509-htcdream.rootfs.tar.bz2 to it.
  
 
== Bootloader ==
 
== Bootloader ==
 
You need to install fastboot.
 
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.
+
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 ==
 
== Kernel ==
 +
=== Using precompiled image ===
 +
Download an kernel image from:
 +
* http://ftp.o2s.ch/pub/openmoko/htcdream/repo/images/htcdream/zImage-2.6.32%2br17%2bgitr636fa4daf243826ef6cebb64dd0509f3b079fcb5-r17-htcdream.bin
 +
(I had to disable anonymous ftp because some people misused it to upload copyrighted movies and pr0n. Sry. -- leviathan)
 +
 
=== Building new kernel ===
 
=== Building new kernel ===
Use 2.6.29 from android.git.kernel.org. 2.6.27 rebooted after a few minutes without any reason.
+
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`
 
  export HACK_DIR=`pwd`
  git clone git://android.git.kernel.org/kernel/msm.git
+
  git clone git://gitorious.org/htc-msm-2-6-32/leviathan-incoming.git
  wget http://wiki.openmoko.org/images/3/3b/Openmoko-htc-dream-kernel-config.txt
+
cd leviathan-incoming
cp Openmoko-htc-dream-kernel-config.txt msm/.config
+
git checkout --track -b msm-gnuconform orgigin/msm-gnuconform
cd msm
+
git pull
 +
  wget http://ftp.o2s.ch/defconfig_OE3 -O .config
 
  make CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ ARCH=arm
 
  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 make CROSS_COMPILE=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/ ARCH=arm modules_install
  sudo mv /lib/modules/2.6-29-openmoko-htc-dream /mnt/foo/lib/modules/
+
  sudo mv /lib/modules/2.6.32 /mnt/foo/lib/modules/
 
  sync
 
  sync
 
  umount /mnt/foo
 
  umount /mnt/foo
  
 
=== Building boot.img ===
 
=== Building boot.img ===
 +
 
  mkdir $HACK_DIR/mk_boot_img
 
  mkdir $HACK_DIR/mk_boot_img
 
  cd $HACK_DIR/mk_boot_img
 
  cd $HACK_DIR/mk_boot_img
  wget http://wiki.openmoko.org/images/9/92/Mkbootimg.bin
+
  <nowiki>wget http://wiki.openmoko.org/images/9/92/Mkbootimg.bin</nowiki>
  wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
+
  <nowiki>wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz</nowiki>
 
  mv Newramdisk.cpio.gz newramdisk.cpio.gz
 
  mv Newramdisk.cpio.gz newramdisk.cpio.gz
 
  sudo cp Mkbootimg.bin /usr/bin/mkbootimg
 
  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" \
 
  mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p2 rootdelay=2 fbcon=rotate:1" \
  --kernel $HACK_DIR/msm/arch/arm/boot/zImage \
+
  --kernel $HACK_DIR/leviathan-incoming/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 rw" \
 +
--kernel $HACK_DIR/leviathan-incoming/arch/arm/boot/zImage \
 
  --ramdisk ./newramdisk.cpio.gz -o openmoko-boot.img
 
  --ramdisk ./newramdisk.cpio.gz -o openmoko-boot.img
  
Line 48: Line 91:
 
* execute
 
* execute
 
  fastboot flash boot openmoko-boot.img
 
  fastboot flash boot openmoko-boot.img
* restart then handy
+
* restart the phone
 
  fastboot reboot
 
  fastboot reboot
 
  
 
== WLAN ==
 
== WLAN ==
=== Driver ===
 
First we have to get running the kernel part with:
 
mkdir $HACK_DIR/wlan_git
 
cd $HACK_DIR/wlan_git
 
git clone git://android.git.kernel.org/platform/system/wlan/ti.git
 
wget http://www.o2s.ch/pub/wireless_2.6.29.patch
 
patch -p1 < ../wireless_2.6.29.patch
 
cd ti/sta_dk_4_0_4_32
 
export KERNEL_DIR=$HACK_DIR/msm
 
make
 
sudo ifconfig usb0 192.168.0.200
 
scp wlan.ko root@192.168.0.202:~
 
ssh root@192.168.0.202
 
    Password: <just press enter>
 
insmod wlan.ko
 
iwconfig
 
root@om-gta02:~# iwconfig
 
lo        no wireless extensions.
 
dummy0    no wireless extensions.
 
rmnet0    no wireless extensions.
 
rmnet1    no wireless extensions.
 
rmnet2    no wireless extensions.
 
usb0      no wireless extensions.
 
tiwlan0  no wireless extensions.
 
exit
 
 
 
=== Firmware ===
 
=== Firmware ===
  cd CUDK/tiwlan_loader
+
  mkdir firmware
  make
+
  cd firmware
  scp tiwlan_loader.bin root@192.168.0.202:~
+
  wget http://ftp.o2s.ch/pub/openmoko/htcdream/firmware-wl12xx/wl1251-fw.bin
  ssh root@192.168.0.202
+
wget http://ftp.o2s.ch/pub/openmoko/htcdream/firmware-wl12xx/wl1251-nvs.bin
    Password: <just press enter>
+
  scp * root@192.168.0.202:/lib/firmware/
root@om-gta02:~# ./tiwlan_loader.bin --help
+
 
Usage: ./wlan_loader [driver_name] [options]
+
== Screenshots ==
  -e <filename>  - eeprom image file name. default=./nvs_map.bin
+
[[Image:Image.jpg]]
  -i <filename>  - init file name. default=tiwlan.ini
+
[[Image:Image2.jpg]]
  -f <filename>  - firmware image file name. default=firmware.bin
+
 
 +
[[Category:Openmoko distributions]]

Latest revision as of 19:23, 30 April 2011

Contents

[edit] Current status

  • The HTC Dream support has been merged in the SHR distribution.
  • An Installation guide is available on the SHR wiki

[edit] Headline text

[edit] History

The following page is kept for historical reasons only

[edit] 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. For questions ask leviathan and GNUtoo in irc://irc.freenode.net/#htc-linux

If leviathan doesn't answer, he might be smoking ATM or be working elsewhere. In this case, try to contact him on jabber, or leave him an offline message: leviathan@xmpp.ccczh.ch

If links are down, just try the overlay'n directory. The site is outdated very fast!


[edit] Working

  • USB-Ethernet
  • Framebuffer console
  • Xorg
  • Wifi
  • Touchscreen
  • Phonecalls
  • ALSA

[edit] Setup the rootfs

[edit] 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.

[edit] Kernel

[edit] Using precompiled image

Download an kernel image from:

(I had to disable anonymous ftp because some people misused it to upload copyrighted movies and pr0n. Sry. -- leviathan)

[edit] 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/htc-msm-2-6-32/leviathan-incoming.git
cd leviathan-incoming
git checkout --track -b msm-gnuconform orgigin/msm-gnuconform
git pull
wget http://ftp.o2s.ch/defconfig_OE3 -O .config
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.32 /mnt/foo/lib/modules/
sync
umount /mnt/foo

[edit] 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

[edit] For SD-card rootfs

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

[edit] For internal rootfs

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

[edit] Flashing boot.img

  • Start into fastboot
  • execute
fastboot flash boot openmoko-boot.img
  • restart the phone
fastboot reboot

[edit] WLAN

[edit] Firmware

mkdir firmware
cd firmware
wget http://ftp.o2s.ch/pub/openmoko/htcdream/firmware-wl12xx/wl1251-fw.bin
wget http://ftp.o2s.ch/pub/openmoko/htcdream/firmware-wl12xx/wl1251-nvs.bin
scp * root@192.168.0.202:/lib/firmware/

[edit] Screenshots

Image.jpg Image2.jpg

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 userspace. This work is done. I booted an OpenMoko userspace. The way to do it on your own is described below.

Setup the rootfs

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 2.6.29 from android.git.kernel.org. 2.6.27 rebooted after a few minutes without any reason.

export HACK_DIR=`pwd`
git clone git://android.git.kernel.org/kernel/msm.git
wget http://wiki.openmoko.org/images/3/3b/Openmoko-htc-dream-kernel-config.txt
cp Openmoko-htc-dream-kernel-config.txt msm/.config
cd msm
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-htc-dream /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
mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p2 rootdelay=2 fbcon=rotate:1" \
--kernel $HACK_DIR/msm/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

Driver

First we have to get running the kernel part with:

mkdir $HACK_DIR/wlan_git
cd $HACK_DIR/wlan_git
git clone git://android.git.kernel.org/platform/system/wlan/ti.git
wget http://www.o2s.ch/pub/wireless_2.6.29.patch
patch -p1 < ../wireless_2.6.29.patch
cd ti/sta_dk_4_0_4_32
export KERNEL_DIR=$HACK_DIR/msm
make
sudo ifconfig usb0 192.168.0.200
scp wlan.ko root@192.168.0.202:~
ssh root@192.168.0.202
   Password: <just press enter>
insmod wlan.ko
iwconfig
root@om-gta02:~# iwconfig
lo        no wireless extensions.
dummy0    no wireless extensions.
rmnet0    no wireless extensions.
rmnet1    no wireless extensions.
rmnet2    no wireless extensions.
usb0      no wireless extensions.
tiwlan0   no wireless extensions.
exit

Firmware

cd CUDK/tiwlan_loader
make
scp tiwlan_loader.bin root@192.168.0.202:~
ssh root@192.168.0.202
   Password: <just press enter>
root@om-gta02:~# ./tiwlan_loader.bin --help
Usage: ./wlan_loader [driver_name] [options]
  -e <filename>  - eeprom image file name. default=./nvs_map.bin
  -i <filename>  - init file name. default=tiwlan.ini
  -f <filename>  - firmware image file name. default=firmware.bin