Openmoko on HTC-Dream

From Openmoko

(Difference between revisions)
Jump to: navigation, search
Line 11: Line 11:
 
* USB-Ethernet
 
* USB-Ethernet
 
* Framebuffer console
 
* Framebuffer console
* Xfbdev
+
* Xorg
 
* Wifi
 
* Wifi
 
* Touchscreen
 
* Touchscreen
 
+
* Phonecalls
=== Should work, but not tested yet ===
+
* ALSA
* Phonecalls ( >_< )
+
 
+
=== Not fixed yet ===
+
* ALSA ( --> no mplayer -.- )
+
  
 
== Setup the rootfs ==
 
== Setup the rootfs ==
Line 26: Line 22:
 
**  First partition: vfat
 
**  First partition: vfat
 
** Second partition: ext2 (root)
 
** Second partition: ext2 (root)
* mount it and extract http://ftp.o2s.ch/pub/openmoko/images/shr-full-eglibc-ipk--20091106-htcdream.rootfs.tar.bz2 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.
 
+
=== Use internal memory ===
+
Start into fastboot mode
+
wget http://ftp.o2s.ch/pub/openmoko/images/shr-fso-console-image-eglibc-ipk--20091106-htcdream.rootfs.yaffs2 -O system.yaffs2
+
fastboot flash userdata system.yaffs2
+
  
 
== Bootloader ==
 
== Bootloader ==
Line 40: Line 31:
 
=== Using precompiled image ===
 
=== Using precompiled image ===
 
Download an kernel image from:
 
Download an kernel image from:
* http://ftp.o2s.ch/pub/openmoko/kernel/
+
* 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)
 
(I had to disable anonymous ftp because some people misused it to upload copyrighted movies and pr0n. Sry. -- leviathan)
 
Select -htcdream-fastboot_sd.bin for SD-card booting or -htcdream-fastboot_mtd.bin for booting from internal flash.
 
 
Rename it to openmoko-boot.img (to keep consistent with the howto ;) )
 
  
 
=== Building new kernel ===
 
=== Building new kernel ===
Line 53: Line 40:
  
 
  export HACK_DIR=`pwd`
 
  export HACK_DIR=`pwd`
  git clone git://gitorious.org/replicant/gnulinuxkernel.git
+
  git clone git://gitorious.org/htc-msm-2-6-32/leviathan-incoming.git
  cd gnulinuxkernel
+
  cd leviathan-incoming
  git checkout -b leviathan
+
  git checkout --track -b msm-gnuconform orgigin/msm-gnuconform
  git pull git://gitorious.org/replicant/gnulinuxkernel.git leviathan
+
  git pull
cp arch/arm/configs/openmoko .config
+
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-msm /mnt/foo/lib/modules/
+
  sudo mv /lib/modules/2.6.32 /mnt/foo/lib/modules/
 
  sync
 
  sync
 
  umount /mnt/foo
 
  umount /mnt/foo
Line 75: Line 62:
 
==== For SD-card rootfs ====
 
==== 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/gnulinuxkernel/arch/arm/boot/zImage \
+
  --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
  
 
==== For internal rootfs ====
 
==== For internal rootfs ====
 
  mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mtdblock5 rootfstype=yaffs2 rootdelay=2 fbcon=rotate:1 rw" \
 
  mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mtdblock5 rootfstype=yaffs2 rootdelay=2 fbcon=rotate:1 rw" \
  --kernel $HACK_DIR/gnulinuxkernel/arch/arm/boot/zImage \
+
  --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 94: Line 81:
 
  mkdir firmware
 
  mkdir firmware
 
  cd firmware
 
  cd firmware
  wget http://ftp.o2s.ch/pub/openmoko/firmware-wl12xx/wl1251-fw.bin
+
  wget http://ftp.o2s.ch/pub/openmoko/htcdream/firmware-wl12xx/wl1251-fw.bin
  wget http://ftp.o2s.ch/pub/openmoko/firmware-wl12xx/wl1251-nvs.bin
+
  wget http://ftp.o2s.ch/pub/openmoko/htcdream/firmware-wl12xx/wl1251-nvs.bin
 
  scp * root@192.168.0.202:/lib/firmware/
 
  scp * root@192.168.0.202:/lib/firmware/
 
=== Driver ===
 
==== Install package ====
 
wget http://ftp.o2s.ch/pub/openmoko/packages/compat-wireless-msmwifi_2009-10-28-.4_htcdream.ipk
 
scp compat-wireless-msmwifi_2009-10-28-.4_htcdream.ipk root@192.168.0.202:~
 
ssh root@192.168.0.202
 
<enter>
 
opkg install compat-wireless-msmwifi_2009-10-28-.4_htcdream.ipk
 
 
==== Compiling ====
 
Download http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 (broken)
 
I think now http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-old.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
 
 
* http://bobcopeland.com/android_wifi.html
 
* Look onto this section with the calibration files
 
* http://htc-linux.org/wiki/index.php?title=WL1251
 
  
 
== Screenshots ==
 
== Screenshots ==

Revision as of 10:40, 9 May 2010

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

Working

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

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

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)

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

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/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

Flashing boot.img

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

WLAN

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/

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

Working

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

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

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)

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

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/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

Flashing boot.img

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

WLAN

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/

Screenshots

Image.jpg Image2.jpg