12/23/2007

リナザウでAndroidが動いた

下記事のとおり。動きました。ちょっと嬉しい。OpenGLの立方体くるくるもちゃんと動く。くるくる。UIも割りとサクサク動く。欲を言えば、もう少しキビキビ感が欲しい。やはり400MHzでは馬力不足。

まだ、Android appletからネットワークに出られない(Google Mapが見えなくて寂しい)とか、タッチパネルが使えないとか、まだヘロヘロなので、今後ぽちぽちと改善していきましょうかな。

まずはネットワークだなぁ。Androidが動いている間も、sshでアクセスできるので、/dev/eth0は生きているんだけど。chrootな影響なのは間違いなさそうだけど。

下記事は元情報のeu.edgeさんに敬意を表して英語だけど、コマンド全部載せたから日本語版いらないよね?
posted by 安藤恐竜 at 14:08 | Comment(4) | TrackBack(0) | 日記

Google Android runs on Sharp Zaurus SL-C3000

Now my Zaurus C3000 becomes an Android Zaurus.

I've followed Gergely's blog Google Android runs on Sharp Zaurus SL-C760 and got pretty much the same result.

o Keyboard working
o Touch panel not working
o Network from Android applet not working

I'll play with my Android Zaurus and I'll write another entry once I get some progress --- hopefully.

Here's the step by step what I did. I'm a newbie to OpenEmbedded, so there are better way to get, I guess.

First of all, get the OpenEmbedded environment. Follow the Building Angstrom | The Angstrom Distribution instruction.
$ mkdir -p openembedded/build/conf
$ cd openembedded
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake
$ wget http://www.openembedded.org/snapshots/OE.mtn.bz2
$ bunzip2 OE.mtn.bz2
$ sudo apt-get install monotone
$ mtn --db=OE.mtn checkout --branch=org.openembedded.dev
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
$ vi build/conf/local.conf
$ diff org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
27c27
< BBFILES := "${@bb.fatal('Edit your conf/local.conf: BBFILES')}"
---
> BBFILES = "/path/to/openembedded/org.openembedded.dev/packages/*/*.bb"
60a61
> MACHINE = "spitz"
80c81
< # DISTRO = "angstrom-2007.1"
---
> DISTRO = "angstrom-2007.1"
112c113
< IMAGE_FSTYPES = "jffs2 tar"
---
> IMAGE_FSTYPES = "jffs2 tar.gz"
140c141,142
< # PARALLEL_MAKE = "-j 4"
---
> PARALLEL_MAKE = "-j 4"
> BB_NUMBER_THREADS = "2"
150d151
< REMOVE_THIS_LINE:="${@bb.fatal('Read the comments in your conf/local.conf')}"


Now prepare some tools required to build. I did these installations while I was in try and error course, some might not be required.
$ sudo apt-get install help2man diffstat texi2html cvs gawk texinfo quilt autoconf
$ sudo apt-get install gcc-3.3 subversion monotone


If you are using Ubuntu (like me), you need to install kernel build packages, too.
$ sudo apt-get install build-essential kernel-package libncurses5-dev


To apply benno's android.diff in bitbaking time, modify the linux-rp_2.6.23.bb file. Also, linux-2.6.23.tar.bz2 in www.kernel.org already branched to some minor versions and not there anymore. So change the source to angstrom-distribution.org.
$ cd openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23
$ wget http://benno.id.au/android/android.diff
$ cd ..
$ cp linux-rp_2.6.23.bb linux-rp_2.6.23.bb.kernel.org
$ vi linux-rp_2.6.23.bb
$ diff linux-rp_2.6.23.bb.kernel.org linux-rp_2.6.23.bb
20c20
< SRC_URI = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2 \
---
> SRC_URI = "http://www.angstrom-distribution.org/unstable/sources/linux-2.6.23.tar.bz2 \
69a70
> file://android.diff;patch=1 \
$ cd openembedded/org.openembedded.dev/conf
$ cp checksums.ini checksums.ini.org
$ vi checksums.ini
$ diff checksums.ini.org checksums.ini
12888a12889,12891
> [http://www.angstrom-distribution.org/unstable/sources/linux-2.6.23.tar.bz2]
> md5=2cc2fd4d521dc5d7cfce0d8a9d1b3472
> sha256=d4e67c0935ffb2a4158234bff92cc791b83177866009fc9b2214104e0038dbdb


I came across a few errors while applying android.diff pacth, so I modified android.diff a little. Here's my version of android.diff. androidzaurus.tar

Start building toolchain. It takes very long. Telling you, veeerrrry looooong. With my Athlon 3500, I takes well half a day.
$ export PATH=~/openembedded/bitbake/bin:$PATH
$ export BBPATH=~/openembedded/build:~/openembedded/org.openembedded.dev
$ bitbake task-sdk


If fails, try some googles and bitbake task-sdk again.

To check the toolchain, try to build a minimal-image.
$ bitbake minimal-image
$ ls tmp/deploy/glibc/images/spitz/


Now I got kernel source tree. Try to retreive .config as defconfig-spitz. Also, turn Android specific configurations on. Here's my current defconfig-spitz. androidzaurus.tar
$ cd openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23
$ cp defconfig-spitz defconfig-spitz.org
$ cd tmp/work/spitz-angstrom-linux-gnueabi/linux-rp-2.6.23-r10/linux-2.6.23
$ make oldconfig
$ make menuconfig
$ cp .config /path/to/openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23/defconfig-spitz
$ diff ../defconfig-spitz .config
1384a1392,1400
> # Android
> #
> # CONFIG_ANDROID_GADGET is not set
> # CONFIG_ANDROID_RAM_CONSOLE is not set
> CONFIG_ANDROID_POWER=y
> CONFIG_ANDROID_POWER_STAT=y
> CONFIG_ANDROID_LOGGER=y
>
> #


Let's build an Android-configured-Angstrom-kernel and console image.
$ bitbake linux-rp -c rebuild
$ bitbake console-image


Now ready to make Zaurus to Angstrom Zaurus. If you are new to altanative ROM (like me), first backup everything from your Zaurus. It is possible to make your Zaurus to a dead brick.

Copy the fresh baked image to Zaurus. Note that commands with $ prompt are on the host PC. Lines with # prompt are on Zaurus.
$ cd tmp/deploy/glibc/images/spitz/
$ scp Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit.tgz root@zaurus:/home/root
$ ssh root@zaurus
# gunzip Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit.tgz
# tar xvf Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit
# mv Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit /your/sdcard/root
# poweroff


I forgot to take a memo of the default mount point. Please check with mount command.

Time to burn the Angstrom image. Angstrom installation on Spitz | The Angstrom Distribution shows how to flash very well.
1) Shutdown Zaurus with poweroff command.
2) Flip Zaurus and unlock the battery switch. Open the battery cover.
3) Push the reset switch. It's a small rectangle black one.
4) Put the battery cover back and the lock switch on.
5) While pressing OK key in the center of cursor key, press On/Off switch.
6) Select "Update" and press OK key.
7) Select "SD Card" and press OK key.
8) Say Yes to the warning.
9) Cross your fingers and hold your breath.


Play with new Angstrom Zaurus and make sure you have ssh access to it. It would be better to modify /etc/network/interfaces to get rid of usb0 as default route. Just delete the gateway lines in usb sections.
$ ssh root@zaurus
# route del default
# vi /etc/network/interfaces


Now Android stuff. It's well explained in Google Android runs on Sharp Zaurus SL-C760. You also need Android SDK and unzip it.
$ cp /path/to/android-sdk/tools/lib/images/ramdisk.img ramdisk.img.gz
$ wget http://benno.id.au/android/system.tar.gz
$ wget http://benno.id.au/android/data.tar.gz
$ scp ramdisk.img.gz system.tar.gz data.tar.gz root@zaurus:/home/root
$ ssh root@zaurus
# gunzip ramdisk.img.gz
# gunzip system.tar.gz
# gunzip data.tar.gz
# mkdir android-root
# cd android-root
# cpio -iv < ../rammdisk.img
# tar xvf ../system.tar
# tar xvf ../data.tar
# vi a.sh
# cat a.sh

#!/system/bin/sh

export PATH=/sbin:/system/sbin:/system/bin:$PATH
export LD_LIBRARY_PATH=/system/lib
export ANDROID_ROOT=/system
export ANDROID_ASSETS=/system/app
export ANDROID_DATA=/data
export EXTERNAL_STORAGE=/sdcard
export DRM_CONTENT=/data/drm/content

mount -t proc proc /proc
mount -t sysfs sysfs /sys

/system/bin/app_process -Xzygote /system/bin --zygote &
/system/bin/dbus-daemon --system &
runtime


a.sh should be same as Google Android runs on Sharp Zaurus SL-C760.

Copy all of the device files to android-root. Then chmod the binder to 666. If you don't change the binder access mode, you will end up looking at red cylon forever.
# cd /dev
# tar cvf /home/root/dev.tar .
# cd /home/root/android-root/dev
# tar xvf /home/root/dev.tar
# chmod 666 binder


Final moment. Start Android.
# rm -f android-root/tmp/*
# umask 000
# chroot /home/root/android-root /a.sh


This could be a shell script as in Google Android runs on Sharp Zaurus SL-C760.

Have fun.

Todo is;
o Bring network up for Android applet.
o Keycode in android-root/etc/init.rc.
o Hack touch pannel driver to generate Android event.
o Vertical/Horizontal view style.
o Localization. I want my Japanese font and IM :-)
posted by 安藤恐竜 at 13:55 | Comment(25) | TrackBack(0) | 日記

広告


この広告は60日以上更新がないブログに表示がされております。

以下のいずれかの方法で非表示にすることが可能です。

・記事の投稿、編集をおこなう
・マイブログの【設定】 > 【広告設定】 より、「60日間更新が無い場合」 の 「広告を表示しない」にチェックを入れて保存する。


×

この広告は1年以上新しい記事の投稿がないブログに表示されております。