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

Search This thread

aswerth

Senior Member
Aug 28, 2011
90
18
İstanbul

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
Last edited:
  • Like
Reactions: aswerth

dudeman1996

Senior Member
Aug 29, 2010
1,137
1,181
27
London, UK
  • Like
Reactions: aswerth

BigChillin

Senior Member
Jan 24, 2011
568
158
Wichita
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#
 

FiFUPL

Member
Jul 14, 2009
24
4
Częstochowa
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$
 
Last edited:

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
http://source.android.com/source/downloading.html

take a look :)

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



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$

Follow the last question on the FAQ and then try.

P.S. mmmmmmmm I smell my CPU frying ;)
P.P.S. Modpunk committed a keyboard fix a few minutes ago unfortunately it doesn't work with this methord of compiling and I'm waiting for modpunk to get back to me to say whats wrong :)
 
Last edited:

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
Fixed kernel and compiling issues, skip step 23 :)

EDIT: Also changed the original tutorial a lot - There is now a lot less to download and a less likly error chance.
 
Last edited:

FiFUPL

Member
Jul 14, 2009
24
4
Częstochowa
benjamingwynn, I got only 1GB RAM on my virtual machine, that was the problem. Actually i ran it with 3GB RAM and it works. I think that in ur tutorial you should put commands in [ code ], it will be more readable :)
 

FiFUPL

Member
Jul 14, 2009
24
4
Częstochowa
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo; chmod a+x ~/bin/repo

change it to:

Code:
mkdir ~/bin; curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo; chmod a+x ~/bin/repo

:)
 
  • Like
Reactions: benjamingwynn

181charan

Senior Member
Aug 14, 2011
209
119
Here in India we have hopeless Internet speeds and the connection is not reliable at all....
During the repo sync if i lose connection, even when the net is back on the process doesnt seem to resume... Is there anyway to resume it??? :)
When it stops i press Ctrl+Z to stop it and sync repo again, does it resume the download from where it stops or downloads it from start all over again??
 
Last edited:

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
Here in India we have hopeless Internet speeds and the connection is not reliable at all....
During the repo sync if i lose connection, even when the net is back on the process doesnt seem to resume... Is there anyway to resume it??? :)
When it stops i press Ctrl+Z to stop it and sync repo again, does it resume the download from where it stops or downloads it from start all over again??

I have wondered this but I think it resumes (I'm not sure though)

Stupid question, but do you have to compile it self?

Yes.
 

benjamingwynn

Inactive Recognized Developer
Nov 28, 2011
2,488
2,315
xenxier.com
Tutorial updated

Shorter
Easier
Now in
Code:
 format for easier copying and pasting
[B]Fixed kernel error
Should fix stuck at HTC screen bug because it now compiles kernel[/B]

People who have already done the tutorial follow steps 15 and on to fix the two in bold.
 

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$