[TUT][CM9] Download and compile CM9 for the HTC Wildfire S using Ubuntu 11.10

Search This thread

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
TUTORIAL:How to build CM9 from source using Ubuntu 11.10
NOTE: I am always changing this tutorial to be more advance and easier, what you see one day may be changed the next so be careful!

1. Grab yourself a copy of 64-bit Ubuntu 11.10 - You can try and use 12.04 but it is very unstable and extra steps are needed.
2. In terminal type in the following lines to grab the required sources for donwloading the packages:
Code:
sudo add-apt-repository ppa:ferramroberto/java; sudo apt-get update
3. Type in the following into terminal, this allows ubuntu to gather the needed packages to build CM9. You will be asked for a password, if you get a question asking if you would like to install all of the packages type Y and hit enter.
Code:
sudo apt-get install git-core gnupg flex bison gperf libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev libc6-dev ia32-libs x11proto-core-dev lib32z-dev mingw32 tofrodos python-markdown python python-lunch libxml2-utils xsltproc libx11-dev:i386
4. To download a needed stack on top of git for developing CM we need to type the following command...
Code:
mkdir ~/bin; curl [url]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/url] > ~/bin/repo; chmod a+x ~/bin/repo
5. Download this: http://dl.google.com/android/android-sdk_r18-linux.tgz and this: http://dl.google.com/android/ndk/android-ndk-r7c-linux-x86.tar.bz2 - These are the NDK and SDK, native development kit and software development kit.
6. Open your file manger and make a folder inside your home folder, call it "android".
7. Make the folders "sdk" and "ndk" inside it
8. Extract all of the stuff from "android-ndk-r7c-linux-x86.tar.bz2" into NDK and all the stuff from "android-sdk_r18-linux.tgz" to SDK.
10. Type in the following line to open a text document
Code:
sudo gedit .bashrc
11. Add the following lines to the bottom of the script - this changes you "path" so you can run scrips from these places as normal linux commands anywhere else on your system
Code:
# Android Software 
export PATH=${PATH}:~/android/sdk/tools
export PATH=${PATH}:~/android/sdk/platform-tools
export PATH=${PATH}:~/android/ndk/android-ndk-r7/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
export PATH=${PATH}:~/bin
13. Save and exit, then type the following lines to make a folder and bring you into it
Code:
mkdir -p ~/cyanogenmod/system; cd ~/cyanogenmod/system
14. Now type in these next lines to set another (fallback) path and inizalize the CM repo in that folder
Code:
PATH=~/bin:$PATH; repo init -u git://github.com/CyanogenMod/android.git -b ics
15. Now enter the following command
Code:
gedit .repo/local_manifest.xml
to open up another text document, in this document - it will be empty, add these lines then save and exit
Code:
<?xml version="1.0" encoding="UTF-8"?>
  <manifest>
      <remote  name="cryptomilk"
               fetch="git://git.cryptomilk.org/" />

      <project name="CyanogenMod/android_device_htc_common" path="device/htc/common" revision="refs/heads/gingerbread" />
      <project name="projects/marvel/android_device_htc_marvel.git" path="device/htc/marvel" remote="cryptomilk" />
      <project name="projects/marvel/android_vendor_htc_proprietary.git" path="vendor/htc" remote="cryptomilk" />
      <project name="projects/marvel/kernel_htc_msm7227.git" path="kernel/htc/msm7277" remote="cryptomilk" />
      <project name="benjamingwynn/cm9-marvel-flaming-fixes" />
  </manifest>
16. If you do not wish to download pointless files for different devices then type in
Code:
gedit .repo/manifest.xml
and delete the following lines (thanks to dudeman1996 for this protip)
Code:
  <project path="device/moto/common" name="CyanogenMod/android_device_moto_common" />
  <project path="device/moto/stingray" name="CyanogenMod/android_device_moto_stingray" />
  <project path="device/moto/wingray" name="CyanogenMod/android_device_moto_wingray" />
aswell as these other lines
Code:
  <project path="device/samsung/maguro" name="CyanogenMod/android_device_samsung_maguro" />
  <project path="device/samsung/p5-common" name="CyanogenMod/android_device_samsung_p5-common" />
  <project path="device/samsung/toro" name="CyanogenMod/android_device_samsung_toro" />
  <project path="device/samsung/tuna" name="CyanogenMod/android_device_samsung_tuna" />
17. Now to preform the first sync with CM type in the following.. -- This will take a long time! so don't be worried if you think it's taking a while. If for whatever reason you need to stop the sync then hit CTRL+Z on your keyboard.
Code:
repo sync
18. You must now setup the vendor, type:
Code:
./vendor/cm/get-prebuilts
19. Set up the environment by typing the following to tell ubuntu that you are going to be making CM9.
Code:
source build/envsetup.sh; lunch cm_marvel-eng
20. Type the following to prepare use the cache for stuff
Code:
export USE_CCACHE=1
21. Now, finally build CM9. To do this I always times the number of cores in your CPU by two. For example on a 4 core machine I would put 8. Once you have worked that out type the following where xx is your number.
Code:
make -jxx bacon
22. If sucessful, you will get something like this:
Code:
Package complete: /home/benjamin/cyanogenmod/system/out/target/product/marvel/update-cm-9.0.0-RC0-marvel-UNOFFICIAL-signed.zip
Go to that folder and copy and paste the zip file above to your phone, install in recovery.


FAQ
People like asking the same god damn questions over and over again.


Q. Could you please help me it says the bits
A. That doesn't make any sense. Try and copy some lines from terminal
Q. Could you help please, It says these lines when I "repo sync"
Code:
Fetching projects: 100% (249/249), done.  
Syncing work tree:  95% (237/249)  fatal: cannot create directory at 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors': No space left on device
Traceback (most recent call last):
  File "/home/benjamin/cyanogenmod/system/.repo/repo/main.py", line 385, in 
    _Main(sys.argv[1:])
  File "/home/benjamin/cyanogenmod/system/.repo/repo/main.py", line 365, in _Main
    result = repo._Run(argv) or 0
  File "/home/benjamin/cyanogenmod/system/.repo/repo/main.py", line 137, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/benjamin/cyanogenmod/system/.repo/repo/subcmds/sync.py", line 467, in Execute
    project.Sync_LocalHalf(syncbuf)
  File "/home/benjamin/cyanogenmod/system/.repo/repo/project.py", line 1027, in Sync_LocalHalf
    self._InitWorkTree()
  File "/home/benjamin/cyanogenmod/system/.repo/repo/project.py", line 1814, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
A. Your disk drive is full. Free some stuff up and try again
Q. Could you help please...
Code:
============================================
Checking build tools versions...
************************************************************
You are attempting to build with an unsupported version
of java.
 
Your version is: java version "1.6.0_24".
The correct version is: Java SE 1.6.
 
Please follow the machine setup instructions at
    http://source.android.com/source/download.html
************************************************************
grep: build/target/board/generic/recovery.fstab: No such file or directory
build/core/java.mk:20: *** dalvik/dexgen: Invalid LOCAL_SDK_VERSION '4' Choices are: current . Stop.
A. You have a slightly different version of Java for some reason, try the following...
Code:
sudo -i
[[enter password]]
apt-get remove openjdk-6-jdk
apt-get remove sun-java6-jdk
add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update
apt-get upgrade
sudo apt-get install sun-java6-jdk
sudo update-alternatives --config java
[[select the sun one]]
exit
if that doesn't work then try
Q. I downloaded Ubuntu 12.04 instead, it's not working! Do you have a quick work-around?
A. First type in
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 \
  g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown \
  libxml2-utils xsltproc zlib1g-dev:i386
to get the extra packages.
Then type "sudo gedit /usr/include/linux/usb/ch9.h" and on line 592 replace
Code:
	return __le16_to_cpu(epd->wMaxPacketSize);
with
Code:
# return le16_to_cpu(epd->wMaxPacketSize);
return __le16_to_cpu(epd->wMaxPacketSize);
Q. I get this error
Code:
benjamin@benjamin-Sienna-510:~/cyanogenmod/system$ lunch cm_marvel-eng
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/marvel/cm.mk]]: "device/*/marvel/cm.mk" does not exist. Stop.
Device marvel not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for marvel not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/marvel/cm.mk]]: "device/*/marvel/cm.mk" does not exist. Stop.
A. Make sure you followed the instructions correctly, this is probably a misconfiguration of an XML :(
Q. I have a problem, do you have a fix? The following happens:
Code:
xml.parsers.expat.ExpatError: XML or text declaration not at start of entity: line 1, column 2
A. I had that problem (in fact I have had all of these faq problems when building CM but I solved em') - type "sudo gedit .repo/local_manifest.xml" into terminal and change the first line to "" without spaces at the start
Q. I get
Code:
** Don't have a product spec for: 'cm_marvel'
** Do you have the right repo manifest?
do you have a fix
A. Redo the instructions from step 20
Q. I get this very annoying error: "build/core/java.mk:20: *** dalvik/dexgen: Invalid LOCAL_SDK_VERSION '4' Choices are: current . Stop"
A. Type "rm -rf prebuilt; repo sync -l prebuilt" - credit to dudeman1996 for this find in Chinese - Credit to me for translating it into usable words from Google Translate :D
Q. I get a strange kernel error about cm9 prebuilt kernels
A. Use aswerth's temp patch
Temp solution: Do not build the latest one. :)

First, delete "device/htc/marvel" folder. And then download this file and unzip it to "device/htc/marvel" BTW, Wifi works on this build too. :rolleyes:

http://git.cryptomilk.org/projects/...s&id=673d27e36a83ec957672e336d8168f8d8196070a
This is the last commit before CM9 gave this error.

Q. Upon installation of packages it says that Java has no installation candiate
A. Run the following command: sudo add-apt-repository ppa:ferramroberto/java; sudo apt-get update
 
Last edited:

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
Compile CM afterwards

Mini tutorial: How to build CM9 after syncing, etc.

There is only two steps needed for compiling CM9 after rebooting or being away from your PC because I have formed the first into a quick load of commands:

Code:
cd ~/cyanogenmod/system; repo sync; source build/envsetup.sh; lunch cm_marvel-eng; export USE_CCACHE=1

This will do all the required steps before build but will only work if you have completed the tutorial above and succedded in a build. repo sync doesn't take long at all because all the files are already on your machine, and repo just grabs the changed ones.

Type make -jxx bacon (the same way you did in the first tutorial) to make CM9 again.

If you wish to know if CM has changed before re-building then see this link: http://git.cryptomilk.org/projects/marvel/android_device_htc_marvel.git/log/?h=ics
 
Last edited:

bobdamnit

Senior Member
Jan 8, 2012
501
207
Fort Wayne, Indiana
Thanks Ben! Which README did you use, may I ask?

Going to try this later tonight, as I just cant make it work. Always end with no compiling, or CPU errors half way through compiling.
 

*se-nsei.

Senior Member
Sep 28, 2011
884
467
London
I get this error on first steps:

Code:
....only available from another source

Package lib32z1-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'sun-java6-jdk' has no installation candidate
E: Package 'lib32z1-dev' has no installation candidate
E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'lib32readline-gplv2-dev' has no installation candidate
E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'ia32-libs' has no installation candidate
E: Unable to locate package lib32z-dev

Is this because I'm running Xubuntu?
 

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
I get this error on first steps:

Code:
....only available from another source

Package lib32z1-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'sun-java6-jdk' has no installation candidate
E: Package 'lib32z1-dev' has no installation candidate
E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'lib32readline-gplv2-dev' has no installation candidate
E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'ia32-libs' has no installation candidate
E: Unable to locate package lib32z-dev

Is this because I'm running Xubuntu?

Probably mate :(
 

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
Anybody who followed my guide before Tuesday 17 April at 19:56 GMT+1 must do the following command

sudo apt-get install python-lunch

however this is now updated in the original post.
 

FiFUPL

Member
Jul 14, 2009
24
4
Częstochowa
Got some problems:
Code:
fif@abuse:~/cyanogenmod/system$ make -j4 bacon
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=cm_marvel
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv6-vfp
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76D
============================================
system/core/toolbox/Android.mk:98: warning: overriding commands for target `out/target/product/marvel/system/bin/lsof'
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/marvel/system/bin/lsof'
build/core/Makefile:36: warning: overriding commands for target `out/target/product/marvel/system/etc/mkshrc'
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/marvel/system/etc/mkshrc'
build/core/Makefile:36: warning: overriding commands for target `out/target/product/marvel/system/lib/egl/libGLES_android.so'
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/marvel/system/lib/egl/libGLES_android.so'
build/core/tasks/kernel.mk:26: ***************************************************************
build/core/tasks/kernel.mk:27: * Using prebuilt kernel binary instead of source              *
build/core/tasks/kernel.mk:28: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED                *
build/core/tasks/kernel.mk:29: * Please configure your device to download the kernel         *
build/core/tasks/kernel.mk:30: * source repository to kernel/htc/msm7227
build/core/tasks/kernel.mk:31: * See http://wiki.cyanogenmod.com/wiki/Integrated_kernel_building
build/core/tasks/kernel.mk:32: * for more information                                        *
build/core/tasks/kernel.mk:33: ***************************************************************
make: *** No rule to make target `device/htc/marvel/prebuilt/kernel', needed by `out/target/product/marvel/kernel'.  Stop.
make: *** Waiting for unfinished jobs....
host StaticLib: libmincrypt (out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/libmincrypt.a)
host StaticLib: libhost (out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)

what should I do to fix it? ;)
 

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
Got some problems:
Code:
fif@abuse:~/cyanogenmod/system$ make -j4 bacon
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=cm_marvel
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv6-vfp
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76D
============================================
system/core/toolbox/Android.mk:98: warning: overriding commands for target `out/target/product/marvel/system/bin/lsof'
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/marvel/system/bin/lsof'
build/core/Makefile:36: warning: overriding commands for target `out/target/product/marvel/system/etc/mkshrc'
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/marvel/system/etc/mkshrc'
build/core/Makefile:36: warning: overriding commands for target `out/target/product/marvel/system/lib/egl/libGLES_android.so'
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/marvel/system/lib/egl/libGLES_android.so'
build/core/tasks/kernel.mk:26: ***************************************************************
build/core/tasks/kernel.mk:27: * Using prebuilt kernel binary instead of source              *
build/core/tasks/kernel.mk:28: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED                *
build/core/tasks/kernel.mk:29: * Please configure your device to download the kernel         *
build/core/tasks/kernel.mk:30: * source repository to kernel/htc/msm7227
build/core/tasks/kernel.mk:31: * See http://wiki.cyanogenmod.com/wiki/Integrated_kernel_building
build/core/tasks/kernel.mk:32: * for more information                                        *
build/core/tasks/kernel.mk:33: ***************************************************************
make: *** No rule to make target `device/htc/marvel/prebuilt/kernel', needed by `out/target/product/marvel/kernel'.  Stop.
make: *** Waiting for unfinished jobs....
host StaticLib: libmincrypt (out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/libmincrypt.a)
host StaticLib: libhost (out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)

what should I do to fix it? ;)

Looks like it's running fine mate.... are you sure thats the error?
 

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
There isn't "prebuilt" folder on "device/htc/marvel" in modpunk's latest kernel update. I'm having the same issue. Maybe we need to build kernel too. Are you sure that tutorial worked on you ben?

No this has been recently causing a problem... Working on a fix now...

Sent from my HTC Wildfire S using xda premium
 

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
EDIT: This doesn't work.

Fix, made. On my phone too!

Re-Follow step 20 and onwards but add the following lines into your file that is open in gedit:



Make sure you put this in the correct place. I will be adding into the OP tomorrow.

Sent from my HTC Wildfire S using xda premium
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 22
    TUTORIAL:How to build CM9 from source using Ubuntu 11.10
    NOTE: I am always changing this tutorial to be more advance and easier, what you see one day may be changed the next so be careful!

    1. Grab yourself a copy of 64-bit Ubuntu 11.10 - You can try and use 12.04 but it is very unstable and extra steps are needed.
    2. In terminal type in the following lines to grab the required sources for donwloading the packages:
    Code:
    sudo add-apt-repository ppa:ferramroberto/java; sudo apt-get update
    3. Type in the following into terminal, this allows ubuntu to gather the needed packages to build CM9. You will be asked for a password, if you get a question asking if you would like to install all of the packages type Y and hit enter.
    Code:
    sudo apt-get install git-core gnupg flex bison gperf libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev libc6-dev ia32-libs x11proto-core-dev lib32z-dev mingw32 tofrodos python-markdown python python-lunch libxml2-utils xsltproc libx11-dev:i386
    4. To download a needed stack on top of git for developing CM we need to type the following command...
    Code:
    mkdir ~/bin; curl [url]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/url] > ~/bin/repo; chmod a+x ~/bin/repo
    5. Download this: http://dl.google.com/android/android-sdk_r18-linux.tgz and this: http://dl.google.com/android/ndk/android-ndk-r7c-linux-x86.tar.bz2 - These are the NDK and SDK, native development kit and software development kit.
    6. Open your file manger and make a folder inside your home folder, call it "android".
    7. Make the folders "sdk" and "ndk" inside it
    8. Extract all of the stuff from "android-ndk-r7c-linux-x86.tar.bz2" into NDK and all the stuff from "android-sdk_r18-linux.tgz" to SDK.
    10. Type in the following line to open a text document
    Code:
    sudo gedit .bashrc
    11. Add the following lines to the bottom of the script - this changes you "path" so you can run scrips from these places as normal linux commands anywhere else on your system
    Code:
    # Android Software 
    export PATH=${PATH}:~/android/sdk/tools
    export PATH=${PATH}:~/android/sdk/platform-tools
    export PATH=${PATH}:~/android/ndk/android-ndk-r7/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
    export PATH=${PATH}:~/bin
    13. Save and exit, then type the following lines to make a folder and bring you into it
    Code:
    mkdir -p ~/cyanogenmod/system; cd ~/cyanogenmod/system
    14. Now type in these next lines to set another (fallback) path and inizalize the CM repo in that folder
    Code:
    PATH=~/bin:$PATH; repo init -u git://github.com/CyanogenMod/android.git -b ics
    15. Now enter the following command
    Code:
    gedit .repo/local_manifest.xml
    to open up another text document, in this document - it will be empty, add these lines then save and exit
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
      <manifest>
          <remote  name="cryptomilk"
                   fetch="git://git.cryptomilk.org/" />
    
          <project name="CyanogenMod/android_device_htc_common" path="device/htc/common" revision="refs/heads/gingerbread" />
          <project name="projects/marvel/android_device_htc_marvel.git" path="device/htc/marvel" remote="cryptomilk" />
          <project name="projects/marvel/android_vendor_htc_proprietary.git" path="vendor/htc" remote="cryptomilk" />
          <project name="projects/marvel/kernel_htc_msm7227.git" path="kernel/htc/msm7277" remote="cryptomilk" />
          <project name="benjamingwynn/cm9-marvel-flaming-fixes" />
      </manifest>
    16. If you do not wish to download pointless files for different devices then type in
    Code:
    gedit .repo/manifest.xml
    and delete the following lines (thanks to dudeman1996 for this protip)
    Code:
      <project path="device/moto/common" name="CyanogenMod/android_device_moto_common" />
      <project path="device/moto/stingray" name="CyanogenMod/android_device_moto_stingray" />
      <project path="device/moto/wingray" name="CyanogenMod/android_device_moto_wingray" />
    aswell as these other lines
    Code:
      <project path="device/samsung/maguro" name="CyanogenMod/android_device_samsung_maguro" />
      <project path="device/samsung/p5-common" name="CyanogenMod/android_device_samsung_p5-common" />
      <project path="device/samsung/toro" name="CyanogenMod/android_device_samsung_toro" />
      <project path="device/samsung/tuna" name="CyanogenMod/android_device_samsung_tuna" />
    17. Now to preform the first sync with CM type in the following.. -- This will take a long time! so don't be worried if you think it's taking a while. If for whatever reason you need to stop the sync then hit CTRL+Z on your keyboard.
    Code:
    repo sync
    18. You must now setup the vendor, type:
    Code:
    ./vendor/cm/get-prebuilts
    19. Set up the environment by typing the following to tell ubuntu that you are going to be making CM9.
    Code:
    source build/envsetup.sh; lunch cm_marvel-eng
    20. Type the following to prepare use the cache for stuff
    Code:
    export USE_CCACHE=1
    21. Now, finally build CM9. To do this I always times the number of cores in your CPU by two. For example on a 4 core machine I would put 8. Once you have worked that out type the following where xx is your number.
    Code:
    make -jxx bacon
    22. If sucessful, you will get something like this:
    Code:
    Package complete: /home/benjamin/cyanogenmod/system/out/target/product/marvel/update-cm-9.0.0-RC0-marvel-UNOFFICIAL-signed.zip
    Go to that folder and copy and paste the zip file above to your phone, install in recovery.


    FAQ
    People like asking the same god damn questions over and over again.


    Q. Could you please help me it says the bits
    A. That doesn't make any sense. Try and copy some lines from terminal
    Q. Could you help please, It says these lines when I "repo sync"
    Code:
    Fetching projects: 100% (249/249), done.  
    Syncing work tree:  95% (237/249)  fatal: cannot create directory at 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors': No space left on device
    Traceback (most recent call last):
      File "/home/benjamin/cyanogenmod/system/.repo/repo/main.py", line 385, in 
        _Main(sys.argv[1:])
      File "/home/benjamin/cyanogenmod/system/.repo/repo/main.py", line 365, in _Main
        result = repo._Run(argv) or 0
      File "/home/benjamin/cyanogenmod/system/.repo/repo/main.py", line 137, in _Run
        result = cmd.Execute(copts, cargs)
      File "/home/benjamin/cyanogenmod/system/.repo/repo/subcmds/sync.py", line 467, in Execute
        project.Sync_LocalHalf(syncbuf)
      File "/home/benjamin/cyanogenmod/system/.repo/repo/project.py", line 1027, in Sync_LocalHalf
        self._InitWorkTree()
      File "/home/benjamin/cyanogenmod/system/.repo/repo/project.py", line 1814, in _InitWorkTree
        raise GitError("cannot initialize work tree")
    error.GitError: cannot initialize work tree
    A. Your disk drive is full. Free some stuff up and try again
    Q. Could you help please...
    Code:
    ============================================
    Checking build tools versions...
    ************************************************************
    You are attempting to build with an unsupported version
    of java.
     
    Your version is: java version "1.6.0_24".
    The correct version is: Java SE 1.6.
     
    Please follow the machine setup instructions at
        http://source.android.com/source/download.html
    ************************************************************
    grep: build/target/board/generic/recovery.fstab: No such file or directory
    build/core/java.mk:20: *** dalvik/dexgen: Invalid LOCAL_SDK_VERSION '4' Choices are: current . Stop.
    A. You have a slightly different version of Java for some reason, try the following...
    Code:
    sudo -i
    [[enter password]]
    apt-get remove openjdk-6-jdk
    apt-get remove sun-java6-jdk
    add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    apt-get update
    apt-get upgrade
    sudo apt-get install sun-java6-jdk
    sudo update-alternatives --config java
    [[select the sun one]]
    exit
    if that doesn't work then try
    Q. I downloaded Ubuntu 12.04 instead, it's not working! Do you have a quick work-around?
    A. First type in
    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential \
      zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
      libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 \
      g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown \
      libxml2-utils xsltproc zlib1g-dev:i386
    to get the extra packages.
    Then type "sudo gedit /usr/include/linux/usb/ch9.h" and on line 592 replace
    Code:
    	return __le16_to_cpu(epd->wMaxPacketSize);
    with
    Code:
    # return le16_to_cpu(epd->wMaxPacketSize);
    return __le16_to_cpu(epd->wMaxPacketSize);
    Q. I get this error
    Code:
    benjamin@benjamin-Sienna-510:~/cyanogenmod/system$ lunch cm_marvel-eng
    build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/marvel/cm.mk]]: "device/*/marvel/cm.mk" does not exist. Stop.
    Device marvel not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
    Repository for marvel not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
    build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/marvel/cm.mk]]: "device/*/marvel/cm.mk" does not exist. Stop.
    A. Make sure you followed the instructions correctly, this is probably a misconfiguration of an XML :(
    Q. I have a problem, do you have a fix? The following happens:
    Code:
    xml.parsers.expat.ExpatError: XML or text declaration not at start of entity: line 1, column 2
    A. I had that problem (in fact I have had all of these faq problems when building CM but I solved em') - type "sudo gedit .repo/local_manifest.xml" into terminal and change the first line to "" without spaces at the start
    Q. I get
    Code:
    ** Don't have a product spec for: 'cm_marvel'
    ** Do you have the right repo manifest?
    do you have a fix
    A. Redo the instructions from step 20
    Q. I get this very annoying error: "build/core/java.mk:20: *** dalvik/dexgen: Invalid LOCAL_SDK_VERSION '4' Choices are: current . Stop"
    A. Type "rm -rf prebuilt; repo sync -l prebuilt" - credit to dudeman1996 for this find in Chinese - Credit to me for translating it into usable words from Google Translate :D
    Q. I get a strange kernel error about cm9 prebuilt kernels
    A. Use aswerth's temp patch
    Temp solution: Do not build the latest one. :)

    First, delete "device/htc/marvel" folder. And then download this file and unzip it to "device/htc/marvel" BTW, Wifi works on this build too. :rolleyes:

    http://git.cryptomilk.org/projects/...s&id=673d27e36a83ec957672e336d8168f8d8196070a
    This is the last commit before CM9 gave this error.

    Q. Upon installation of packages it says that Java has no installation candiate
    A. Run the following command: sudo add-apt-repository ppa:ferramroberto/java; sudo apt-get update
    3
    Compile CM afterwards

    Mini tutorial: How to build CM9 after syncing, etc.

    There is only two steps needed for compiling CM9 after rebooting or being away from your PC because I have formed the first into a quick load of commands:

    Code:
    cd ~/cyanogenmod/system; repo sync; source build/envsetup.sh; lunch cm_marvel-eng; export USE_CCACHE=1

    This will do all the required steps before build but will only work if you have completed the tutorial above and succedded in a build. repo sync doesn't take long at all because all the files are already on your machine, and repo just grabs the changed ones.

    Type make -jxx bacon (the same way you did in the first tutorial) to make CM9 again.

    If you wish to know if CM has changed before re-building then see this link: http://git.cryptomilk.org/projects/marvel/android_device_htc_marvel.git/log/?h=ics
    3
    No this has been recently causing a problem... Working on a fix now...

    Sent from my HTC Wildfire S using xda premium

    Temp solution: Do not build the latest one. :)

    First, delete "device/htc/marvel" folder. And then download this file and unzip it to "device/htc/marvel" BTW, Wifi works on this build too. :rolleyes:

    http://git.cryptomilk.org/projects/...s&id=673d27e36a83ec957672e336d8168f8d8196070a

    Edit: I guess, benjamin already found a fix.
    2
    dude, flash my thing rom, and rest for a while. everything works, Ill upload some screenshots for ya, wait a min.

    Umm

    1. I have my own ROM - it works fine.
    2. This is not based on ICS, it is Sense 2.1 (GB)
    3. I know what I want and what I don't - I want CM9 and not Sense 2.1 thats themed.
    2
    I hate to be this guy but...

    Code:
    root@catalin-ubuntu:~# sudo gedit .bashrc
    
    (gedit:13182): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.QPCHCW': No such file or directory
    
    (gedit:13182): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
    
    (gedit:13182): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.02GPCW': No such file or directory
    
    (gedit:13182): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
    
    (gedit:13182): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.RS5RCW': No such file or directory
    
    (gedit:13182): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
    root@catalin-ubuntu:~# mkdir -p ~/cyanogenmod/system; cd ~/cyanogenmod/system
    root@catalin-ubuntu:~/cyanogenmod/system# repo init -u git://github.com/CyanogenMod/android.git -b ics
    No command 'repo' found, did you mean:
     Command 'rep' from package 'rep' (universe)
     Command 'repl' from package 'nmh' (universe)
     Command 'repl' from package 'mailutils-mh' (universe)
    repo: command not found
    root@catalin-ubuntu:~/cyanogenmod/system#

    http://source.android.com/source/downloading.html

    take a look :)

    ---------- Post added at 08:30 AM ---------- Previous post was at 08:17 AM ----------

    Temp solution: Do not build the latest one. :)

    First, delete "device/htc/marvel" folder. And then download this file and unzip it to "device/htc/marvel" BTW, Wifi works on this build too. :rolleyes:

    http://git.cryptomilk.org/projects/...s&id=673d27e36a83ec957672e336d8168f8d8196070a

    Edit: I guess, benjamin already found a fix.

    Thanks, that works! :)
    also thanks to benjamingwynn for tutorial, it was very helpful.

    got problems...
    Code:
    make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/noproguard.classes-with-local.dex] Killed
    make: *** Waiting for unfinished jobs....
    fif@abuse:~/cyanogenmod/system$