[Android Software/Hacking General [Developers Only]] aorth:
Helping with the CM7 port

Setting up CM7 for porting to the U8150​

Wanna help move this port along? Get yourself familiar with building Android from scratch, the CyanogenMod way. It's only once you've submersed yourself in git, bash, and bacon that you will know whether you have what it takes to help tilal and marcnvidic with the U8150 CM7 port. You'll also need time, so people with day jobs and or families can really only afford to be cheerleaders. ;)

Preparation:​

You need to set up your computer so it can build Android. See, for example, the Galaxy S page on the CyanogenMod wiki. Pay specific attention to getting adb, repo, installing necessary OS packages with apt-get and cloning/initializing the actual repository. It's ~8 gigs, so don't try this on dialup! Not for the faint of heart...

Here we go:​

Edit vendor/cyanogen/vendorsetup.sh to add a lunch "combo" for the U8150:

add_lunch_combo cyanogen_u8150-eng

Android's build system uses a "lunch menu" to choose what you want to build. There's also brunch and breakfast, but they're all used for other things.

Add a makefile for the u8150:

cp vendor/cyanogen/products/cyanogen_u8220.mk vendor/cyanogen/products/cyanogen_u8150.mk

I used the makefile for the Huawei U8220 because it's a Huawei... not sure how much this will help us but I figure the closer to the U8150 the better.

Edit vendor/cyanogen/products/cyanogen_u8150.mk, replacing occurances of "u8220" with "u8150".

Use common sense. Basically, tailor the new makefile to be U8150 specific. Pay specific attention to the paths to makefiles and such, as they need more intelligence than just a search/replace...

Edit vendor/cyanogen/products/AndroidProducts.mk to add the following line:

$(LOCAL_DIR)/cyanogen_u8150.mk \

This tells the build system where to find the device's makefile.

Check out a copy of tilal's U8150 Android device tree:

cd device/huawei
git clone https://github.com/tilal6991/android_device_huawei_u8150.git u8150

If you fancy, you can even fork his repo and then clone your own. All U8150-specific stuff will go in here, so if you find yourself getting into it and hacking quite a bit, I'd recommend forking tilal's (I have).

Copy proprietary files:

Make sure your phone is plugged in, adb is working, and you're running a stock Huawei ROM.

./extract-files.sh

This grabs a handful of pre-compiled proprietary drivers and libraries from your device so CM can use them. I also had to manually copy a few from one of tilal's nightly zips (I'm not sure where they come from, as they weren't on my device...?). Put the following files in vendor/huawei/u8150/proprietary/lib/hw/:

lights.ideos.so
gps.ideos.so
sensors.ideos.so

And the following in vendor/huawei/u8150/proprietary/lib/:

libril-qcril-hook-oem.so

Set up the build environment:

. build/envsetup.sh
lunch cyanogen_u8150-eng

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.5
TARGET_PRODUCT=cyanogen_u8150
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================

If yours looks like this then you've succeeded in setting up the environment for building CyanogenMod (technically it's AOSP, but there's a hefty amount of CM sauce all up in there).

Compile!

make -j4

It will probably fail. Now go fix it! If you're lucky you'll see text fly by for like three hours, and then you'll see something like this:

Package complete: /home/aorth/android/system/out/target/product/u8150/update-cm-7.1.0-RC1-U8150-KANG-signed.zip
ebad7aed34adc86d478873115527edee update-cm-7.1.0-RC1-U8150-KANG-signed.zip

Flash it from ClockworkMod Recovery, and you just might get lucky... mine went all the way to the CM7 boot animation (skating blue Android logo) ;). For some reason it didn't get further than that, though I could adb shell into it.

Hopefully this will help some other devs involved... we need help! Adios!