Sunday, August 16, 2009

Building Cyanogen's android source

After finished playing with the official master branch, I went on to check out Cyanogen's modified tree. After checking it out, I had to modify build/core/tasks/localize.mk to read
values_resource_files := $(-- $(foreach elem, $(all_resource_files), $(shell echo $(elem) | \
tr -s / | \
tr " " "\n" | \
grep -E "\/values[^/]*/(strings.xml|arrays.xml)$$" | \
grep -v -E -e "-[a-zA-Z]{2}[/\-]")))

because otherwise I would get an error saying too many arguments are passed to /bin/bash

Wednesday, August 5, 2009

Tackling Android's Donut Branch Part II

The building process didn't finish yesterday, so I am continuing today morning. After the SDK is built, I had to symlink some directories to their proper places (wonder why this is so), because the "android" tool said "Error parsing SDK" or something like that, indicating it was missing these directories.

ln -s ~/android/mydroid/out/host/linux-x86/sdk/android-sdk_eng.zsol_linux-x86/platforms/ out/host/linux-x86/
ln -s ~/android/mydroid/out/host/linux-x86/sdk/android-sdk_eng.zsol_linux-x86/add-ons/ out/host/linux-x86/

After this, I was finally able to create an AVD like so:
zsol@silithus:~/android/mydroid$ android create avd -n donuttest -t 1
Android Donut (Preview) is a basic Android platform.
Do you wish to create a custom hardware profile [no]
Created AVD 'donuttest' based on Android Donut (Preview), with the following hardware config:
hw.lcd.density=160

Awesome! Now I'm getting close. This command let me try the fresh build on an emulator:

zsol@silithus:~/android/mydroid$ emulator -sysdir out/target/product/generic/ -kernel ./prebuilt/android-arm/kernel/kernel-qemu @donuttest
This is what it looks like:
Hack away!

Tuesday, August 4, 2009

Tackling Android's Donut Branch

I know I should be updating the graph visualization project, but I just wasn't in the mood these days, so after getting a new layer of screen protector for my G1/Dream/ADP, I went on checking out Android's master git branch, which has seen some merges from the Donut branch.

The checkout process went on for a whole night on my sloppy "high-speed internet" connection, and grabbed a few (less than 3)Note to self: next time settle for single-core compilation, it's faster.

Now that I have a working adb tool, I can get some proprietary blobs from my phone:

zsol@silithus:~/android$ cd mydroid
zsol@silithus:~/android/mydroid$ . build/envsetup.sh
zsol@silithus:~/android/mydroid$ cd vendor/htc/dream-open/
zsol@silithus:~/android/mydroid/vendor/htc/dream-open$ ./extract-files.sh
[... output snipped off ...]
Now to configure the build for my G1:

zsol@silithus:~/android/mydroid/vendor/htc/dream-open$ lunch htc_dream-eng

============================================
PLATFORM_VERSION_CODENAME=Donut
PLATFORM_VERSION=Donut
TARGET_PRODUCT=htc_dream
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=Donut
============================================
That looks pretty promising, doesn't it.

While building I noticed something interesting with my xterm:
That's right, it supports UTF-8 properly. Take that, urxvt!


After some 20ish minutes of compiling, the process is halted with some error messages missing "camera.h", "camframe.h", "jpeg_encoder.h", and the like. A quick search leads me to this thread. The funny thing is, the solution was not posted when I found it, only now that I rechecked the link. So this is what I did:

  • patch the mentioned change with: repo download platform/vendor/htc/dream-open 10981/1
  • hack hardware/msm7k/libcamera2/Android.mk and change the "true" value
    on the first line to "false"
  • run make again
So it turns out my phone is missing /system/lib/libspeech.so (which is some proprietary library built and supplied by the vendor). I was told it should be included in the 150275 build, so now after downloading it, I copied over the corresponding file to $HOME/android/mydroid/vendor/htc/dream-open/proprietary/. Now it's building.