Jump to content

1.6 ROM development


Recommended Posts

Posted (edited)

Ok, well first of all it doesn't really work. At least it boots and it's Android 1.6 but I've tested the following and none of them work:

Accelerometer

Bluetooth

Wifi (yes, even with the .config change)

Mobile network

Compass

GPS

Camera

And there are no Google apps. Oh and the acore process crashed for me when I panned the home screen.

Apart from that it's great! Clearly the best thing about this thread is that I've written *exactly* what you need to do to get this far (I hate it when people don't document things properly). It's particularly bad in android - e.g. if someone tells you to use mkbootimg it'll probably take you ages to find where it is! (answer: /out/host/linux-x86/bin)

Anyway, here's what I did. Some of it was after the fact so there may be errors. And I don't know if KERNEL_DIR does anything really... can't hurt to include it though.

How to build Android 1.6 for the Pulse (sort of)

Download Android 1.6 source code [Takes hours]

cd $ROMDIR

	   mkdir android-1.6-source

	   cd android-1.6-source

	   repo init -u git://android.git.kernel.org/platform/manifest.git -b android-1.6_r2

	   repo sync
Note you might want to make a backup of the clean source. It is 2.5 GB and the servers are quite slow so it will take a long time to download again! Download Huawei kernel souce code
cd $ROMDIR

	   wget http://support.t-mobile.co.uk/resources/sites/TMOBILE/content/live/DOCUMENTS/0/DO194/en_GB/Pulse_Open_Source_Code_11_2009.zip

	   unzip Pulse_Open_Source_Code_11_2009.zip

	   mkdir huawei-1.5-kernel-source

	   mv kernel huawei-1.5-kernel-source
Get the kernel .config
cd $ROMDIR/huawei-1.5-kernel-source

	   wget http://sites.google.com/site/tdhutt/pulse_config.txt -O .config
Modify the .config Set CONFIG_MMC_MSM_SDC2_SUPPORT=n This is the point where you can try to enable netfilter if you feel like it! I couldn't get it to work, but give it a go (although we need the radio and wifi working for this to be useful!) Build the kernel
make ARCH=arm CROSS_COMPILE=$ROMDIR/android-1.6-source/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
Build android [Takes hours]
cd $ROMDIR/android-1.6-source

	   . build/envsetup.sh

	   lunch generic-eng

	   make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi KERNEL_DIR=$ROMDIR/huawei-1.5-kernel-source/kernel
Create your new boot.img
cd $ROMDIR/android-1.6-source/out/product/target/generic

	   $ROMDIR/android-1.6-source/out/host/linux-x86/bin/mkbootimg --cmdline "mem=128M console=ttyMSM2,115200n8 androidboot.hardware=qcom console=ttyUSBCONSOLE0 androidboot.console=ttyUSBCONSOLE0" --kernel $ROMDIR/huawei-1.5-kernel-source/kernel/arch/arm/boot/zImage --ramdisk ramdisk.img -o boot.img
Flash it to your device First do a nandroid backup! Then put your phone in fastboot mode.
cd $ROMDIR/android-1.6-source/out/product/target/generic

	   [sudo] fastboot flash system system.img

	   [sudo] fastboot flash boot boot.img

	   [sudo] fastboot reboot

That's it. :-)

Edited by Timmmm
Posted

PS: Actually the wifi, RIL, and probably others not working isn't really surprising seeing as I didn't copy the libraries from the huawei image into my system.img

Guest martinbrook
Posted
PS: Actually the wifi, RIL, and probably others not working isn't really surprising seeing as I didn't copy the libraries from the huawei image into my system.img

Good work Tim.

Give everyone a goo baseline to work from for 1.6.

As well as the pulse libs we probably need to look at merging the init.rc file in the boot image, this is where a lot of the hardware stuff is started.

Martin

Posted

Terrific work. I agree about the documentation - it's surprisingly scattered and it seems almost deliberately obfuscated.

I'm finishing a build attempt of my own at the moment, which I fear is doomed to fail, but afterwards I'll give this a try. To speed up building you can add a "-jN" flag to make, where N is twice the number of processor cores your system has.

Posted
Terrific work. I agree about the documentation - it's surprisingly scattered and it seems almost deliberately obfuscated.

I'm finishing a build attempt of my own at the moment, which I fear is doomed to fail, but afterwards I'll give this a try. To speed up building you can add a "-jN" flag to make, where N is twice the number of processor cores your system has.

I read about that -jN switch somewhere that it relates to the number of cores you have ... then somewhere in the google documentation (don't know where), it said it's the 'number of jobs'.

=/

Posted (edited)

Currently building the kernel. wgetting the config didn't seem to work (the file was filled by stuff from google sites), so I downloaded and renamed appropriately.

I've also set up a fresh build environment, on a real machine this time, not a virtual one. I'm running into all the errors caused by using gcc-4.4 rather than -4.3, so I thought I'd post how to solve this.

gcc-4.4 is much stricter than gcc-4.3, and the main android sources currently will only compile with -4.3. However, removing -4.4 in ubuntu makes dpkg want to remove a whole host of packages. Rather than do that it seems better to install gcc-4.3, cpp-4.3 and g++-4.3 alongside their -4.4 counterparts and switch between them using update-alternatives. update-alternatives controls which symlinks point to which version of an installed package. The man page is pretty helpful, but I'll put brief instructions here.

Assuming you've already installed gcc-4.3, cpp-4.3 and g++-4.3 you need to run:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 10

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 8
Essentially, the format is
sudo update-alternatives --install <link> <name> <path> <priority>
where <link> is the symlink, <name> is the package name, <path> is the path to the version you require and <priority> is an integer with higher integers have higher priority in the automatic mode. You'll need to run these commands for cpp and g++ as well; included below for fans of copy/paste:
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.3 10

 sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.4 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.3 10

 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 8

Edited by jmmL
Posted
wgetting the config didn't seem to work

Oops, I gave -o as a wget option. It should have been -O.

Posted
Oops, I gave -o as a wget option. It should have been -O.

That'll teach me for copying and pasting! Thanks.

Android is building - now the wait begins.

Posted

While I'm waiting for the repo to sync (On a MAC this time) I read some documentation don't know if you saw this or even did it

in vendor/htc/dream-open/ there is a script called "extract-files.sh" that must be run (from that directory) to extract some proprietary binaries from your device (*). You only need to do this once.


* The Dream and Sapphire device software contains some proprietary files.  For contractual reasons, those cannot be redistributed to be used directly with the Android Open-Source Project, but the provided script may be used to extract these binaries from your development device or from a recovery image so that they can be correctly included in your build. Those libraries include the openGL|ES library, the Qualcomm camera library, the HTC Radio Interface Library, etc.

Source: http://source.android.com/documentation/building-for-dream

Maybe a similar thing could be done for the Pulse proprietary files?

Guest McSpoon
Posted (edited)

Great stuff. ;)

This is slightly off-topic but I'm wondering if we need to use a more hardware-specific 'product' instead of 'lunch generic-eng'. Although I have no idea how to do it. I'm just floating ideas around at the moment.

In the CodeAurora repository they've added /vendor/qcom/msm7201a_surf/ makefiles to their copy of the AOSP code.

http://www.codeaurora.org/wiki/QAEP

and in the build instructions on their wiki they've used the deprecated method of "choosecombo 1 1 msm7201a_surf eng" instead of lunch. I did briefly try using their branch of cupcake (I was trying to build that from scratch before moving to donut) but I hit linker errors due to GCC-4.4 being too strict. I might try looking into it again when I have more time.

Update: I tried it again after following jmmL's suggestion of switching to GCC-4.3 and the CodeAurora branch of cupcake compiles and installs okay but most of the hardware failed (camera, radio, accelerometer, power-button, audio, etc.) all of them were either stub modules or failed to load on the Pulse.

Note: Their /vendor/qcom/msm7201a_surf/system.props file contains "rild.libpath=/system/lib/libril-qc-1.so rild.libargs=-d /dev/smd0" so it might be worth checking out.

However if we can get a something running with "lunch generic-eng" that would be fantastic. I'm not sure what difference the product profiles actually make. Hopefully it isn't much.

Edited by McSpoon
Posted

Just spotted this in the page McSpoon linked:

You can override the TARGET_PREBUILT_KERNEL flag with your own kernel image to build android with your kernel, as follows:

$ make -j4 TARGET_PREBUILT_KERNEL="<your_kernel_tree>/arch/arm/boot/zImage"

Might this be useful? Especially seeing as the KERNEL_DIR option doesn't seem to be doing anything at present, at least to me.

Posted (edited)

Yeah I think to do this properly you need to make new targets in /build/target/... but I'm just going to do everything manually for now.

I've tried getting the radio to work. Finally got rild to run without link errors by copying the following libraries:

libril-qc-1.so liboncrpc.so libdsm.so libcm.so libmmgsdilib.so libgsdi_exp.so libgstk_exp.so libwms.so libnv.so libwmsts.so libdss.so libsnd.so libqueue.so libqmi.so

Note, readelf -d is really useful here for seeing library dependencies (it's like a crapper version of DependencyWalker).

Unfortunately it still doesn't work. Something to do with RPC.

# rild

Router Read Task Starting 

251 thread state 0x00000012

Oncrpc Start complete state 0x00001111 

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/30000016:f22ae45c

   ERR :MSG Open handle failed, unable to open program 30000016 ver f22ae45c NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306390:ARG2 -232070052:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

   ERR :MSG Failed to lookup RPC client. prog = 805306390, vers = -232070052, tout = 0  :FILE vendor/qcom-proprietary/modem/msm7201a_surf/api/libs/remote_apis/gsdi_exp/src/gsdi_exp_clnt.c:LINE 77:ARG1 805306390:ARG2 -232070052:ARG3 0:

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/30000000:959ac044

   ERR :MSG Open handle failed, unable to open program 30000000 ver 959ac044 NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306368:ARG2 -1785020348:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

   ERR :MSG Failed to lookup RPC client. prog = 805306368, vers = -1785020348, tout = 0  :FILE vendor/qcom-proprietary/modem/msm7201a_surf/api/libs/remote_apis/cm/src/cm_clnt.c:LINE 139:ARG1 805306368:ARG2 -1785020348:ARG3 0:

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/30000019:ab60a474

   ERR :MSG Open handle failed, unable to open program 30000019 ver ab60a474 NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306393:ARG2 -1419729804:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

   ERR :MSG Failed to lookup RPC client. prog = 805306393, vers = -1419729804, tout = 0  :FILE vendor/qcom-proprietary/modem/msm7201a_surf/api/libs/remote_apis/mmgsdilib/src/mmgsdilib_clnt.c:LINE 73:ARG1 805306393:ARG2 -1419729804:ARG3 0:

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/3000003c:e89364a0

   ERR :MSG Open handle failed, unable to open program 3000003c ver e89364a0 NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306428:ARG2 -392993632:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

   ERR :MSG Failed to lookup RPC client. prog = 805306428, vers = -392993632, tout = 0  :FILE vendor/qcom-proprietary/modem/msm7201a_surf/api/libs/remote_apis/gstk_exp/src/gstk_exp_clnt.c:LINE 77:ARG1 805306428:ARG2 -392993632:ARG3 0:

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/30000003:a7eed910

   ERR :MSG Open handle failed, unable to open program 30000003 ver a7eed910 NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306371:ARG2 -1477519088:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

   ERR :MSG Failed to lookup RPC client. prog = 805306371, vers = -1477519088, tout = 0  :FILE vendor/qcom-proprietary/modem/msm7201a_surf/api/libs/remote_apis/wms/src/wms_clnt.c:LINE 85:ARG1 805306371:ARG2 -1477519088:ARG3 0:

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/3000000e:d0b61921

   ERR :MSG Open handle failed, unable to open program 3000000e ver d0b61921 NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306382:ARG2 -793372383:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

   ERR :MSG Failed to lookup RPC client. prog = 805306382, vers = -793372383, tout = 0  :FILE vendor/qcom-proprietary/modem/msm7201a_surf/api/libs/remote_apis/nv/src/nv_clnt.c:LINE 59:ARG1 805306382:ARG2 -793372383:ARG3 0:

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/30000002:00020000

   ERR :MSG Open handle failed, unable to open program 30000002 ver 20002 NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306370:ARG2 131074:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

   ERR :MSG Failed to lookup RPC client. prog = 805306370, vers = 131074, tout = 0  :FILE vendor/qcom-proprietary/modem/msm7201a_surf/api/libs/remote_apis/snd/src/snd_clnt.c:LINE 89:ARG1 805306370:ARG2 131074:ARG3 0:

Unable to open router port: Permission denied

ONCRPC Opened device: /dev/oncrpc/30000000:959ac044

   ERR :MSG Open handle failed, unable to open program 30000000 ver 959ac044 NOT FOUND 

  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 231:ARG1 805306368:ARG2 -1785020348:ARG3 0:

   ERR :MSG Couldn't setup RPC call  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_cb.c:LINE 276:ARG1 0:ARG2 0:ARG3 0:

 FATAL :MSG oncrpc_lookup_dest() returned NULL!  :FILE vendor/qcom-proprietary/oncrpc/oncrpc/oncrpc_lookup.c:LINE 603:ARG1 0:ARG2 0:ARG3 0:
I guess this is because I haven't added these lines to init.rc, which I will now do:
# START HUAWEI RPC SERVICE

service oem_rpc_svc /system/bin/oem_rpc_svc

	oneshot

Edited by Timmmm
Posted

PS: Add to the list of things that don't work:

SD card

Power button (and possibly others)

The display doesn't turn off, and the brightness can change.

Button backlights.

Sound

On the plus side, the vibrator works! :-)

Posted (edited)

Okay this is a little worrying. I tried to flash the generated boot.img and system.img, which seemed to work. However, it hangs at the android loading screen and trying to do a nandroid restore says "Error: run 'nandroid-mobile.sh restore' via console". When trying to do adb shell it says "exec /system/bin/sh failed: no such file or directory".

Edit:

Bloody hell. I'm this close to not doing any more "dev" work - at some point I will break my phone!

Looks like everything's okay - used MCR 1.4.1 zip and updated from that. Then was able to restore from nandroid backup. It seems like each time I do this I break my phone in a new and interesting way!

Edited by jmmL
Guest Alien*46*UK
Posted

Well ... At leat you'll be able to sort future devs problems out as you will most likely have come across it ;) ...

Keep it up ;) ...

Posted

Could someone please provide instructions on what's needed to upgrade an initial install of ubunto to the state where it can compile the kernel? WHich bits of the Android SDK we need, toolchains etc etc?

Thanks

Posted (edited)
Could someone please provide instructions on what's needed to upgrade an initial install of ubunto to the state where it can compile the kernel? WHich bits of the Android SDK we need, toolchains etc etc?

Thanks

It's all here: http://source.android.com/download

Something I would like to know is do we have a list of all the proprietary files we need to add to the source to get Donut working?

If anyone know's how to contact the correct people at Huawei, maybe they could possibly upload a proprietary files archive much like HTC have done for the Dream & Sapphire dev phones, it's a long shot, but given the amount of bug's in the official build maybe they would welcome some community development, Who know's maybe a custom MCR build could one day be Huawei's release ROM, after all this is supposed to be an 'open' platform isn't it?

Edited by klutsh
Posted
It's all here: http://source.android.com/download

Something I would like to know is do we have a list of all the proprietary files we need to add to the source to get Donut working?

If anyone know's how to contact the correct people at Huawei, maybe they could possibly upload a proprietary files archive much like HTC have done for the Dream & Sapphire dev phones, it's a long shot, but given the amount of bug's in the official build maybe they would welcome some community development, Who know's maybe a custom MCR build could one day be Huawei's release ROM, after all this is supposed to be an 'open' platform isn't it?

have a look in the ramdisk image from an original tmobile boot.img (or say, the MCK one ... but that has added stuff) and you can see what it links to.

Posted (edited)

by the way, i'm working on the rom. I have the brightness/backlit buttons and sd card working, maybe more.

EDIT: Going through the init.rc file and it freezes on startup when I hit the first line of this:

# HUAWEI MODIFY

chmod 0666 /dev/accel

chmod 0666 /dev/akm8973_aot

chmod 0666 /dev/akm8973_dev

---------------------------------------------these 1st 3 freeze the system if included-------------------------------------------------

chmod 0666 /dev/input/event0

---------------------This one (without the 1st 3) gives a restart----------------------------

chmod 0666 /sys/kernel/logger/log_main/enable

chmod 0666 /sys/kernel/logger/log_main/priority

chmod 0666 /sys/kernel/logger/log_events/enable

chmod 0666 /sys/kernel/logger/log_events/priority

chmod 0666 /sys/kernel/logger/log_radio/enable

chmod 0666 /sys/kernel/logger/log_radio/priority

chmod 0666 /data/HWUserData/logcat.log

It can't handle it =/

Edited by xangma
Posted
It's all here: http://source.android.com/download

Something I would like to know is do we have a list of all the proprietary files we need to add to the source to get Donut working?

If anyone know's how to contact the correct people at Huawei, maybe they could possibly upload a proprietary files archive much like HTC have done for the Dream & Sapphire dev phones, it's a long shot, but given the amount of bug's in the official build maybe they would welcome some community development, Who know's maybe a custom MCR build could one day be Huawei's release ROM, after all this is supposed to be an 'open' platform isn't it?

Thanks, I've done all that as far as I can see but when executing Pauls build-main.sh script get the following error

/bin/sh: /home/rob/1.6r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc: not found

make[1]: *** [kernel/bounds.s] Error 127

make: *** [prepare0] Error 2

Posted
Something I would like to know is do we have a list of all the proprietary files we need to add to the source to get Donut working?

It's not too hard to work out ourselves. So far I have got the button backlights, hardware opengl, and USB mass storage to work, although I still can't access the SD card from the actual phone.

Having some issues with the accelerometer. The phone start start if you add "chown 0666 /dev/accel" to init.rc. Weird.

Posted
Thanks, I've done all that as far as I can see but when executing Pauls build-main.sh script get the following error

/bin/sh: /home/rob/1.6r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc: not found

make[1]: *** [kernel/bounds.s] Error 127

make: *** [prepare0] Error 2

Well obvious first step is to check whether that file exists. It should do since you get it from the android source download.

Posted (edited)
It's not too hard to work out ourselves. So far I have got the button backlights, hardware opengl, and USB mass storage to work, although I still can't access the SD card from the actual phone.

Having some issues with the accelerometer. The phone start start if you add "chown 0666 /dev/accel" to init.rc. Weird.

I'm at EXACTLY the same point as you. I'm thinking the directory doesn't exist ... where ever it's supposed to be =/

EDIT:

These give a freeze or restart:

# HUAWEI MODIFY

chmod 0666 /dev/accel

chmod 0666 /dev/akm8973_aot

chmod 0666 /dev/akm8973_dev

chmod 0666 /dev/input/event0

...

#HUAWEI DIAG SWITCH

chmod 0666 /sys/devices/platform/msm_hsusb_periphera/func_enable

Edited by xangma
Posted
Well obvious first step is to check whether that file exists. It should do since you get it from the android source download.

For some reason the NDK I downloaded is slightly older than the one Paul was using, so the command was found in a different place as below.

~/pulse/android-ndk-1.6_r1/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin

Posted
These give a freeze or restart:

# HUAWEI MODIFY

chmod 0666 /dev/accel

chmod 0666 /dev/akm8973_aot

chmod 0666 /dev/akm8973_dev

chmod 0666 /dev/input/event0

#HUAWEI DIAG SWITCH

chmod 0666 /sys/devices/platform/msm_hsusb_periphera/func_enable

Only /dev/accel causes a freeze for me. At least on startup. I suppose the others could be the cause of restarting when the sensors are accessed. Is that what you meant?

/dev/accel definitely exists. Must be the code that accesses it that crashes the phone, but it just gives up if it doesn't have permissions.

Still can't get rild to work, and I now have most of the huawei stuff running, including qmuxd and port-bridge (no idea what they do). The error seems to be something to do with the oncrpc service. I'm kind of stuck though because all the files it mentions are present and readable and I have no idea what "Unable to open router port: Permission denied" is refering to. :-\

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.