CM7 for Milestone - build from source

To prepare and build:
mkdir cm4mm
cd cm4mm
repo init -u git://github.com/nadlabak/android.git -b gingerbread
repo sync
vendor/cyanogen/get-rommanager
. build/envsetup.sh && brunch umts_sholes

More detailed instruction can be found e.g here: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes (but take account of the differences in the instructions published here.)

The update-cm-7...-Milestone-signed.zip will be built in out/target/product/umts_sholes, ready to be installed via OpenRecovery/updates.

Comments

TWL5030 Drivers & Utils for OTG

Hello!
I am embedder from Russia and I need support usb otg in cyanogenmod7 for my Motorola milestone. Is it possible to include the appropriate drivers and utilities to build for normal work of usb otg or compile it into a separate module?
Thank you!

Build Successfully ?

Can I say the build is successful if the zip built in target folder?

Hi,Stop at M logo,any suggestion?

Hi, I follow list and get a upate***.zip, but when i installed it via OR, it stop at M logo. But when i install the NONO CM7 7.20 ROM, everything is ok, is there anything i forget to do?

Lock Bug / Repo Name?

Seemed to be there in 7.1.3 as well:
If I deactivate the screenlock via the Quick Settings / "Pull Down" Menu I can do that servals times (locking on, off and so on) and its still working, but after some minutes or hours of runtime, I could change that setting to "lock" and it would never ever work again, only if I reboot the phone or "hardreset" it via the real settings. Any hope in getting that fixed?

Another thing:
The compiled files are named 7.1.3, not 7.1.5 - any reason for that?

Greetings and Thanks

Just run make clobber before

Just run make clobber before building.

Build error

Got this build error:

Install: out/target/product/umts_sholes/system/bin/e2label
Install: out/target/product/umts_sholes/system/bin/mke2fs
Install: out/target/product/umts_sholes/system/bin/netd
packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMasAppIf.java:174: warning: unmappable character for encoding ascii
* /* Up and empty string �� cd .. Up and name - cd ../name Down and name
^
packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMasAppIf.java:174: warning: unmappable character for encoding ascii
* /* Up and empty string �� cd .. Up and name - cd ../name Down and name
^
packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMasAppIf.java:175: warning: unmappable character for encoding ascii
* - cd name Down and empty string �� cd to root
^
packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMasAppIf.java:175: warning: unmappable character for encoding ascii
* - cd name Down and empty string �� cd to root
^
Install: out/target/product/umts_sholes/system/bin/resize2fs
Install: out/target/product/umts_sholes/system/lib/libril.so
Install: out/target/product/umts_sholes/system/bin/skia_test
Install: out/target/product/umts_sholes/system/bin/tune2fs
Install: out/target/product/umts_sholes/system/bin/wlan_loader
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.AAC.decode.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.AAC.encode.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.AMR.decode.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.AMR.encode.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.JPEG.Encoder.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.Video.Decoder.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.Video.encoder.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.WBAMR.decode.so
Install: out/target/product/umts_sholes/system/lib/libOMX.TI.WBAMR.encode.so
Install: out/target/product/umts_sholes/system/lib/libdrm1_jni.so
Install: out/target/product/umts_sholes/system/lib/libsqlite_jni.so
Install: out/target/product/umts_sholes/system/xbin/daemonize
packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMasObexServer.java:1038: cannot find symbol
symbol : method noEndofBody()
location: interface javax.obex.Operation
op.noEndofBody();
^
Install: out/target/product/umts_sholes/system/xbin/sqlite3
Install: out/target/product/umts_sholes/system/xbin/su
Install: out/target/product/umts_sholes/system/xbin/timeinfo
Install: out/host/linux-x86/bin/dictTest
Install: out/host/linux-x86/bin/make_cfst
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
4 warnings
make: *** [out/target/common/obj/APPS/Bluetooth_intermediates/classes-full-debug.jar] Error 41
make: *** Waiting for unfinished jobs....

you should re-try

the error has been solved in the repository.
you should sync again and then try to build again. i successfully built 7.1.3 this morning :)

I did remove the repo and

I did remove the repo and started from scratch, exactly using the commands in the blog...
But sadly it ends like this:

Notice file: libcore/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/core.jar.txt
Notice file: frameworks/base/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/ext.jar.txt
Notice file: frameworks/base/NOTICE.cm -- out/target/product/umts_sholes/obj/NOTICE_FILES/CM/src//system/framework/ext.jar.txt
Notice file: frameworks/base/core/res/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/framework-res.apk.txt
Notice file: frameworks/base/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/framework.jar.txt
Notice file: frameworks/base/NOTICE.cm -- out/target/product/umts_sholes/obj/NOTICE_FILES/CM/src//system/framework/framework.jar.txt
Notice file: frameworks/base/cmds/ime/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/ime.jar.txt
Notice file: frameworks/base/cmds/input/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/input.jar.txt
Notice file: development/cmds/monkey/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/monkey.jar.txt
Notice file: frameworks/base/cmds/pm/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/pm.jar.txt
Notice file: libcore/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/sqlite-jdbc.jar.txt
Notice file: frameworks/base/cmds/svc/NOTICE -- out/target/product/umts_sholes/obj/NOTICE_FILES/src//system/framework/svc.jar.txt
make: *** No rule to make target `out/target/product/umts_sholes/system/lib/libgps.so', needed by `out/target/product/umts_sholes/system/lib/hw/gps.sholes.so'. Stop.
make: *** Waiting for unfinished jobs....
Notice file: hardware/gpsshim/NOTICE.cm -- out/target/product/umts_sholes/obj/NOTICE_FILES/CM/src//system/lib/hw/gps.sholes.so.txt
root@droid-virtual-machine:~/cm4mm#

Any ideas?
Its driving me nuts, I can build ICS but not gingerbread...

After yet another sync I came

After yet another sync I came to this point:

target arm C++: libGLES_android <= frameworks/base/opengl/libagl/light.cpp
frameworks/base/opengl/libagl/light.cpp: In function 'void android::validate_light_mvi(android::gl::ogles_context_t*)':
frameworks/base/opengl/libagl/light.cpp:232: warning: missing braces around initializer for 'android::gl::vec4_t::'
frameworks/base/opengl/libagl/light.cpp:232: warning: missing braces around initializer for 'android::gl::vec4_t::::'
target arm C++: libGLES_android <= frameworks/base/opengl/libagl/matrix.cpp
target arm C++: libGLES_android <= frameworks/base/opengl/libagl/mipmap.cpp
target arm C++: libGLES_android <= frameworks/base/opengl/libagl/primitives.cpp
target arm C++: libGLES_android <= frameworks/base/opengl/libagl/vertex.cpp
target thumb C++: libGLES_android <= frameworks/base/opengl/libagl/egl.cpp
frameworks/base/opengl/libagl/egl.cpp: In function 'EGLBoolean eglChooseConfig(void*, const EGLint*, void**, EGLint, EGLint*)':
frameworks/base/opengl/libagl/egl.cpp:1568: warning: comparison of unsigned expression < 0 is always false
target thumb C++: libGLES_android <= frameworks/base/opengl/libagl/state.cpp
target thumb C++: libGLES_android <= frameworks/base/opengl/libagl/texture.cpp
target thumb C++: libGLES_android <= frameworks/base/opengl/libagl/Tokenizer.cpp
frameworks/base/opengl/libagl/texture.cpp: In function 'void glCompressedTexImage2D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*)':
frameworks/base/opengl/libagl/texture.cpp:1165: warning: comparison between signed and unsigned integer expressions
target thumb C++: libGLES_android <= frameworks/base/opengl/libagl/TokenManager.cpp
target thumb C++: libGLES_android <= frameworks/base/opengl/libagl/BufferObjectManager.cpp
make: *** No rule to make target `out/target/product/umts_sholes/system/lib/libgps.so', needed by `out/target/product/umts_sholes/system/lib/hw/gps.sholes.so'. Stop.
make: *** Waiting for unfinished jobs....
target thumb C: gps.goldfish <= sdk/emulator/gps/gps_qemu.c
sdk/emulator/gps/gps_qemu.c:903: warning: initialization from incompatible pointer type
root@droid-virtual-machine:~/cm4mm#

sync again

That really did it! Thank you

That really did it!
Thank you very much for your effort and work!

Repo sync problem

I'm trying to download sources, but repo sync exit with this error:
From git://github.com/CyanogenMod/android_packages_wallpapers_MusicVisualization
* [new branch] gingerbread -> github/gingerbread
* [new branch] gingerbread-release -> github/gingerbread-release
* [new branch] ics -> github/ics
* [new tag] cm-7.1.0 -> cm-7.1.0
Fetching projects: 94% (296/314) fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: Cannot fetch CyanogenMod/android_prebuilt

I see it's downloading all phone models from CyanogeMon, it means some gigabytes of data, is it normal?

Same problem

Same problem here:

root@droid-virtual-machine:~/cm4mm# repo sync -j16
Fetching projects: 89% (280/314) fatal: The remote end hung up unexpectedly
Fetching projects: 95% (299/314) fatal: The remote end hung up unexpectedly
error: Cannot fetch CyanogenMod/android_prebuilt

I got the solution from the forum of cyanogen

replace "git"with "https:" in .repo/manifest.xml and .repo/manifest.git/config

that works, thank you!

that works, thank you!

The upper clock not showing 24hour format its lock in 12hr

When you set the clock in 24 Hour format applies in all clocks except in the upper right corner clock.

Build problem

Hello guys. I have recently stumbled upon a build problem. I have previously built a ROM but now it fails. Here is the output:

$ brunch umts_sholes
including vendor/cyanogen/vendorsetup.sh
bash: [: too many arguments
build/core/config.mk:46: /pathmap.mk: No such file or directory
build/core/config.mk:123: /envsetup.mk: No such file or directory
build/core/config.mk:136: *** No config file found for TARGET_DEVICE . Stop.
build/core/config.mk:46: /pathmap.mk: No such file or directory
build/core/config.mk:123: /envsetup.mk: No such file or directory
build/core/config.mk:136: *** No config file found for TARGET_DEVICE . Stop.
build/core/config.mk:46: /pathmap.mk: No such file or directory
build/core/config.mk:123: /envsetup.mk: No such file or directory
build/core/config.mk:136: *** No config file found for TARGET_DEVICE . Stop.
build/core/config.mk:46: /pathmap.mk: No such file or directory
build/core/config.mk:123: /envsetup.mk: No such file or directory
build/core/config.mk:136: *** No config file found for TARGET_DEVICE . Stop.
build/core/config.mk:46: /pathmap.mk: No such file or directory
build/core/config.mk:123: /envsetup.mk: No such file or directory
build/core/config.mk:136: *** No config file found for TARGET_DEVICE . Stop.
No such item in brunch menu. Try 'breakfast'

kernel.org

the above is not working since kernel.org is down at the moment - anyone has some alternative/workaround for until then? Or where can I download prebuild images for CM7 for Milestone until kernel.org is up agian


$ repo init -u git://github.com/nadlabak/android.git -b gingerbread
Getting repo ...
from git://android.git.kernel.org/tools/repo.git
fatal: Unable to look up android.git.kernel.org (port 9418) (Name or service not known)

replace that site in the method below

$ curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo"> ~/bin/repo
$ chmod a+x ~/bin/repo
$ PATH=~/bin:$PATH

下载android源码

$ mkdir WORKING_DIRECTORY
$cd WORKING_DIRECTORY
$ repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
$ repo sync

To nadlabak:how to add milestone's code into CM's galaxysmtd?

Dear nadlabak,you are my super star!
If I want to add milestone's code into CM's galaxysmtd,and compile umts_sholes on CM's galaxysmtd.What steps should I take?
In your github,I can only see two repositories about Milestone.Are they enough?
Can you give me some advice?Thanks very much!

I had add umts_sholes to CM's galaxysmtd,but can't turn on.

I had add umts_sholes to CM's galaxysmtd,and compiling was OK.But when I flashed the package into the mathine,it just show "MOTO" log,and can't enter to the normal system.
Could you tell me how to fix this problem?

how can I compile my own kernel & recovery on CM7 with milestone

how can I compile my own kernel & recovery on CM7 with milestone?
I hava download CM7 for milestone,and compile it well.But after building the whole project,I haven't got my own boot.img and recovery.img

Locked bootloader

You can't compile your own kernel because bootloader is locked and will only load kernel signed by motorola.

how did you compile the boot.img?

If the bootloader is locked,How did you and OpenRecovery build boot.img or OpenRecovery?
Did you send your img to motorola to be signed?

Still no rc12 on git

after repo sync and build the source,still no rc12 on git.
update-cm-7.1.0-RC11
And it seems the battery life is shorter than before. It's system issue or application with your experiment ?

failed to build the latest git source

after repo sync -j20,
./ build/envsetup
brunch
39

build failed:
make: *** No rule to make target `out/target/product/umts_sholes/obj/STATIC_LIBRARIES/librebootrecovery_intermediates/librebootrecovery.a', needed by `out/target/product/umts_sholes/obj/EXECUTABLES/recovery_intermediates/LINKED/recovery'. Stop.

librebootrecovery

thx,it works

thx,it works

librebootrecovery.a issue.

I am stuck at the same step. I got another issue. I previously had installed CM7 from update.zip onto my phone and now I am trying to build it myself without luck.

Before this issue my building stopped at a similar error but trying to copy "libmoto_gps.so" which was not found in my phone.

I had to change the file BoardConfigVendor.mk (vendor/motorola/sholes) and


#Original line BOARD_GPS_LIBRARIES := libmoto_gps
#libgps.so was present in my phone (not libmoto_gps.so)
BOARD_GPS_LIBRARIES := libgps

The building went on fine till the damned "librebootrecovery.a" issue:


No private recovery resources for TARGET_DEVICE sholes
Install: out/host/linux-x86/bin/mkbootfs
Install: out/host/linux-x86/bin/apriori
Install: out/host/linux-x86/bin/soslim
Install: out/host/linux-x86/bin/minigzip
Install: out/host/linux-x86/bin/mkbootimg
make: *** No hay ninguna regla para construir el objetivo «out/target/product/sholes/obj/STATIC_LIBRARIES/librebootrecovery_intermediates/librebootrecovery.a», necesario para «out/target/product/sholes/obj/EXECUTABLES/recovery_intermediates/LINKED/recovery». Alto.
make: *** Se espera a que terminen otras tareas....

I am new to Android building. Could please anybody help me out ?

droid

You're building for droid (sholes) instead of milestone (umts_sholes). Is that intentional?

Is Milestone A853 "sholes" or "umts_sholes"?

That was a doubt I had. Looking for phone codes the conclusion I had drawn the conclusion that the Milestone A853 was the "sholes" model and the Milestone XT720 was the "umts_sholes". I am sure I have a "normal" Milestone Model (the first that appeared). It was bought in UK (although used in Spain). That said, is that the "sholes" or "umts_sholes"?

Thanks for your time

umts_sholes

Well, this project has "CyanogenMod 7 for Milestone A853" in the title.
The build instructions above clearly state:
. build/envsetup.sh && brunch umts_sholes
In my github repo, there's only https://github.com/nadlabak/android_device_motorola_umts_sholes and https://github.com/nadlabak/android_vendor_motorola_umts_sholes
no "android_device_motorola_sholes", so I don't understand the doubt.
Again, Droid A855 (cdma) is "sholes", Milestone A853 (gsm/umts) is "umts_sholes".
You can check it in the build.prop of the official firmware: ro.product.device=umts_sholes
You have the same umts_sholes as me :). I also bought it from UK, in December 2009.

My doubts are gone now. Thank

My doubts are gone now. Thank you very much for the explanation. The origin of the confusion was that I followed the link with detailed instructions of the CyanogenMod Wiki explaining how to to build the "Sholes" version.

Thank you very much for your support.

By the way, after upgrading to your latest change the build successfully completed. I am going to try it on my phone right now :-)

New cyanogenmod 7.1

Hi

I'm very interesting in the new 7.1 cyanogenMod is a possibility will be port to Milestone?

Thanks

Can't use 32 bit linux system to compile?

I used 32bit ubuntu 10.04 to build this project. All other things are OK except libwebcore.so. Using my own build image, the browser can't be open. But replaced with this file in this sited release image, all are OK.
I compared my libwebcore.so and the released libwebcore.so after un-asm, there are many differences in instructions.

So whether the can ubuntu 10.04 -32bit not build the image? Or I missed somethings?

And the system log show the method contentDraw can't be found.
And from google official code, here is:
m_javaGlue->m_contentDraw = GetJMethod(env, clazz, "contentDraw", "()V");

But in github code, here is:
m_javaGlue->m_contentDraw = GetJMethod(env, clazz, "contentDraw", "(Z)V");

So which is right?

Thank you very much.

Browser not working

Hi,

I`ve tried building the sources on a 64bit Ubuntu 11.04 (Natty) with the same efect - browser and market did not start with the error you have mentioned in the logs.

A prebuild image worked well.

glibc too new?

Build fails on current gentoo ~amd64, producing (apparently) almost immediately:

glibc detected: invalid next size (fast).

Tried with gcc-4.4 and 4.3, makes no difference.

I *guess* it's glibc being too new (2.13) and apparently more strict wrt memory allocations which causes build to fail.

Judging from the many successful builds done on ububtu and others, I'm curious, is there a limitation on glibc version? Google officially says nothing. Anyone has a clue?

On gentoo stable to

I got the same error. I'm running gentoo stable (amd64), which has glibc-2.12.2. Compiler is gcc-4.4.5.

Since the latest git update I

Since the latest git update I always get this errors:
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 818, in
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 773, in main
OPTIONS.info_dict = common.LoadInfoDict(input_zip)
File "/home/pascal/Dokumente/CM7/cm1/build/tools/releasetools/common.py", line 140, in LoadInfoDict
d["fstab"] = LoadRecoveryFSTab(zip)
File "/home/pascal/Dokumente/CM7/cm1/build/tools/releasetools/common.py", line 150, in LoadRecoveryFSTab
raise ValueError("Could not find RECOVERY/RAMDISK/etc/recovery.fstab")
ValueError: Could not find RECOVERY/RAMDISK/etc/recovery.fstab
make: *** [out/target/product/umts_sholes/cyanogen_umts_sholes-ota-eng.pascal.zip] Fehler 1
hope you can help me :)

repo sync

Hi!
After i run command "repo sync", it downloads all other stuff from other devices and it takes ages to finish (low internet connection), is there anyway to load only file for milestone?
Thanks!
keunhuvac

can you please add a manual

can you please add a manual for windows user? Tortoisegit you can add the url git://github.com/nadlabak/android.git but thats not the solution to get the source complete.

Windows and Android

Hey Anonymous,

Android can't be compiled on a native Windows Platform. The only thing you can do is to install an Virtual Machine like VirtualBox and install a Linux distribution like Ubuntu on it (e.g. 10.04). If you have finished this then please have a look at the following steps:
http://source.android.com/source/initializing.html

It's not a cool way, I know, but it works...

size of *update.zip

i wonder why size of compiled update.zip on my sytem is much greater than it supposed to be, i received 140,7 MB (147519852 bytes) file

OFFICIAL 2.2 IS HERE !!!

Guys , we're lucky this time , Motorola finally kept her word instead of once again move release of 2.2 !
Prove : https://supportforums.motorola.com/community/manager/softwareupgrades

Nandlabak , hope you're quickly get us new Kernel without bugs(and i hope it's not GOT2.2.1's Kernel) , and make CM for MM as we want to see it all !

Celebrating !

official kernel buggy

official kernel is not better than GOT2.2.1.
--"google is your friend"

Build failed!

build/core/product_config.mk:194: *** _nic.PRODUCTS.[[vendor/cyanogen/products/cyanogen_buzz.mk]]: "device/htc/buzz/full_buzz.mk" does not exist. Schluss.

** Don't have a product spec for: 'cyanogen_umts_sholes'
** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'

Does anyone has an idea???

if you update repo while one

if you update repo while one of the developer still updating something your local source files will be not compiled properly. try to update the repo later and try the compile again

cant build...

build/core/product_config.mk:194: *** _nic.PRODUCTS.[[vendor/cyanogen/products/cyanogen_encore.mk]]: "device/bn/encore/device_encore.mk" does not exist. Stop.

** Don't have a product spec for: 'cyanogen_umts_sholes'
** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'

build...

... is working again.

same here...

the old way:
# lunch cyanogen_umts_sholes-eng
lunch cyanogen_umts_sholes-engbuild/core/product_config.mk:194: *** _nic.PRODUCTS.[[vendor/cyanogen/products/cyanogen_encore.mk]]: "device/bn/encore/device_encore.mk" does not exist. Schluss.

** Don't have a product spec for: 'cyanogen_umts_sholes'
** Do you have the right repo manifest?

the newer way:
# brunch umts_sholes
including vendor/cyanogen/vendorsetup.sh
build/core/product_config.mk:194: *** _nic.PRODUCTS.[[vendor/cyanogen/products/cyanogen_encore.mk]]: "device/bn/encore/device_encore.mk" does not exist. Stop.

** Don't have a product spec for: 'cyanogen_umts_sholes'
** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'