• Login:

Welcome to the Toshiba Thrive Forum.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Results 1 to 10 of 10
Like Tree14Likes
  • 8 Post By pio_masaki
  • 5 Post By pio_masaki
  • 1 Post By pio_masaki

Thread: Building CM10 on Ubuntu 12.10 for your 10" Thrive

  1. #1
    Developer

    Member #
    18359
    Join Date
    Sep 2012
    Location
    Surprise, Az (that's a real place)
    Posts
    3,783
    Liked
    1904 times
    Twitter
    piomasaki

    Building CM10 on Ubuntu 12.10 for your 10" Thrive

    This will attempt to help you figure out how to get building Jellybean ROMs for the Thrive should you feel the need to. This will cover CM10, however can be adapted to any given Jellybean source, with some modifications.



    I'll also attempt to keep this pretty straight forward and complete, with a simple copy and paste approach, namely you can just copy the line, then ctrl+v it into the terminal and hit enter to do it.


    This is a long process, taking no less then 2 hours, a lot of which can be unattended while you do something better with your time, like making a sandwich or reloading that beer from last night.


    This is based on the fresh install I just had to do, I chose to go updated and just load up 12.10, I had previously been building on 10. something.

    Part 1: Getting the goods!


    First purge existing OpenJava stuff, it doesn't do well with building Android.

    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

    Adding the repo to get the good Java stuff

    Code:
    sudo add-apt-repository ppa:webupd8team/java


    Bringing in the good Java stuff

    Code:
    sudo apt-get update && sudo apt-get install oracle-java6-installer

    Check that your OpenJava is gone and you are running the good stuff

    Code:
    java -version
    Should see something similar to:
    java version "1.6.0_37"
    Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)


    Now, bring in all the extra stuff needed to build

    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
    I personally had a problem with libc6-dev, if you do then use this line instead

    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
    This takes a bit depending on your connection and PC specs.


    Next we make some symlinks

    Code:
    sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

    Next we make ~/bin and get the respo stuff

    Code:
    mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo
    This sometimes doesn't work well for whatever reason, but doing it individually does, so this is what you do if you have issues with repo commands later:

    Code:
    chmod a+x ~/bin/repo

    Next we set the path to ~/bin so the system can use it from anywhere (like your android source directory)

    Code:
    sudo nano ~/.bashrc
    This opens an editor, basic one at that. At the bottom add

    Code:
    export PATH=~/bin:$PATH
    Then use CTRL+o and then enter to save, then CTRL+x to exit nano


    You can now restart bash:

    Code:
    source ~/.bashrc
    or just close the terminal then open a new terminal.


    Now we make the directory you'll use for your sources, this is your choice, for this I'll use android

    Code:
    mkdir ~/android
    then change terminal to it:

    Code:
    cd ~/android

    Next we initialize the repo



    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b jellybean
    Remember, if you have issues with repo not being found or installed, see the alternate method for installing repo.


    After that we need to pull in the actual source, for this we use

    Code:
    repo sync
    you can add a -j# flag to speed it up, depending on your connection. I run a 22Mbps down so I usually do

    Code:
    repo sync -j3
    or if I feel froggy a j6.

    This takes hours usually, so go take a break and watch a movie or two. After this completes, you'll have the basics to build an Android ROM on Ubuntu 12.10.

    Next we will cover getting the parts needed for the Thrive, and how to begin building!
    danvee, dandroid7, alanh and 5 others like this.
    JB/ICS OC Kernels | My ROMs section | TWRP Recovery for Thrive
    CM10 General Thread | Jelly Bean Guide
    Donations, always appreciated!
    Need a rollback or reflash? Just send a PM!

  2. Ads


  3. #2
    Developer

    Member #
    18359
    Join Date
    Sep 2012
    Location
    Surprise, Az (that's a real place)
    Posts
    3,783
    Liked
    1904 times
    Twitter
    piomasaki
    Part 2: Getting the...gooder goods...?

    Ok so now the BIG stuff is done, the OS is mostly prepped for building, but we still need a couple things, namely the kernel source, the device and vendor trees for the Thrive, otherwise it will never build for it.

    For this we play with a new command, git. This was installed back in Part 1 in that loooong slew of commands no one actually reads and just pasted into the terminal and got a snack.

    The big one, the kernel, is about 500MB, the rest are pretty small. First lets make a new folder to hold our stuff in:

    Code:
    mkdir ~/android/thrive
    Then let's move into it

    Code:
    cd ~/android/thrive
    Then let's start downloading the source for the kernel:

    Code:
    git clone https://github.com/pio-masaki/at100-kernel.git
    This will take a bit usually.

    Once that completes (or if you're impatient and opened another terminal already) lets get the device tree:

    Code:
    git clone https://bitbucket.org/pio_masaki/tostab03_device_cm10.git
    Next we'll need the vendor tree:

    Code:
    git clone https://bitbucket.org/pio_masaki/tostab03_vendor_cm10.git
    Some of you may have already visited the repo and read the instructions for building and moving files around, but for this I'll assume you haven't.

    The next big step (assuming the kernel is done downloading now) is to move the stuff you just downloaded into the proper locations for CM10 to use and build from:

    Need to make a few more directories, again.

    Code:
    mkdir ~/android/devices/toshiba
    Code:
    mkdir ~/android/vendor/toshiba
    Code:
    mkdir ~/android/kernel/toshiba
    Once those are all made we need to get the stuff there!

    This part *most* will prefer using some form of explorer, so for example, in Ubuntu 12.10 on the left side there's the side stage thing, clicking on the folder icon will open an explorer for you, you can use this to copy the files over vs manually doing it in a terminal.

    Otherwise it's gonna get crazy right here:

    Code:
    mv ~/android/thrive/tostab03_device_cm10 ~/android/device/toshiba/tostab03
    Code:
    mv ~/android/thrive/tostab03_vendor_cm10 ~/android/vendor/toshiba/tostab03
    Code:
    mv ~/android/thrive/at100-kernel ~/android/kernel/toshiba/tostab03
    If you opted to use the explorer way, make sure these files go into /toshiba/tostab03, not just in /toshiba, look at the commands given to understand what I mean. Once done you should see something like this in the directory:

    ~/android/device/toshiba/tostab03/Android.mk
    And a bunch of folders and files. Not something like this:
    ~/android/device/toshiba/Android.mk
    OR
    ~/android/device/toshiba/tostab03/tostab03/Android.mk

    Got it?

    Once that is all done, and you're pretty convinced you're awesome at terminal work, we can begin the actual build process!

    NOTE
    This is severely machine limited, meaning lesser machines takes multiples of time longer then a machine with plenty of specs. Guidelines:

    Quad core CPU, preferably something ABOVE a Core Quad, and ABOVE 8GB of RAM will net you a first build under 3 hours, usually.

    The more RAM and CPU you have, the faster it builds, of course. Ideally you'll have an i7 and 32GB of RAM, though 16GB is quite sufficient. SSD will also help a bit.

    GET OVER IT AND GET ME BUILDING!


    First, we need to set up the build environment, luckily theres a script that does that for us. Make sure your terminal is in ~/android for this.

    Code:
    . build/envsetup.sh
    the . is not a typo, this tells it to run a script

    Next up, the lunch menu!

    Code:
    lunch
    Choose the number next to the cm_tostab03-userdebug entry. This varies per setup, though it remains the same unless you add more devices to your source. This takes a minute or two while it checks for obvious errors in the mk files or files that are missing.

    Once that finishes, we can begin the build!

    Code:
    make -j8 otapackage
    This is where it gets a little tricky, theres various ways to build with CM, and the -j8 flag also has variations. I'll break them down below:

    Ways to build your awesome sauce ROM

    There's a few ways to build your ROM with CM, the above method which is the manual method that ALSO works with AOSP source, like JBSourcery, I use it for this reason, the other is the shortcut method, brunch, which skips a bunch of stuff to get going, and just immediatly jumps into building the rom. Example usage of brunch:

    Code:
    . build/envsetup.sh
    Code:
    brunch cm_tostab03-userdebug -j8
    And its already building, it skips the lunch menu and no need to tell it to build a zip package, its all in the brunch command already.

    What's that -j stuff about?

    it tells how many threads to use while building, depending on the machine this changes. If you have anything less then an i5/i7 then do cores+1, i5 can do up to 16, though I'd stick with 8, and i7 should comfortably fit a -j16. You should do no less then -j3 as time increases quite a bit, and you should be running at least a Core Duo (or AMD equivilant). As AMD has some odd core numbers, like 6, adjust accordingly.

    Ok, it's been 9 hours, where's my ROM?!

    It'll be spit out in ~/android/out/product/target/tostab03

    If all went well and no errors came up, it'll be a nice named CM10-date-unofficial-device.zip type file. Other devices will be named after themselves and will be in their named folders, so instead of tostab03 it might be grouper, or maguro, or whatever you built for.
    Last edited by pio_masaki; 02-25-2013 at 07:30 PM.
    JB/ICS OC Kernels | My ROMs section | TWRP Recovery for Thrive
    CM10 General Thread | Jelly Bean Guide
    Donations, always appreciated!
    Need a rollback or reflash? Just send a PM!

  4. #3
    Developer

    Member #
    18359
    Join Date
    Sep 2012
    Location
    Surprise, Az (that's a real place)
    Posts
    3,783
    Liked
    1904 times
    Twitter
    piomasaki
    Part 3: I hate CM, what about other stuff?

    Holder for porting the trees to other sources
    dandroid7 likes this.
    JB/ICS OC Kernels | My ROMs section | TWRP Recovery for Thrive
    CM10 General Thread | Jelly Bean Guide
    Donations, always appreciated!
    Need a rollback or reflash? Just send a PM!

  5. #4
    Thrive Lurker
    Member #
    21187
    Join Date
    Jan 2013
    Posts
    18
    Liked
    7 times
    Hi pio and thank you very much for this guide

    I think that the

    mv ~/android/thrive/tostab03_device_cm10 ~/android/devices/toshiba/tostab03

    must be

    mv ~/android/thrive/tostab03_device_cm10 ~/android/device/toshiba/tostab03

    And also who ever has this problem:
    make: *** No rule to make target `vendor/cm/proprietary/Term.apk', needed by `/build/cyanogenmod/out/target/product/otter/system/app/Term.apk'. Stop.
    Run this in the root of your android folder:
    vendor/cm/get-prebuilts

  6. #5
    Developer

    Member #
    18359
    Join Date
    Sep 2012
    Location
    Surprise, Az (that's a real place)
    Posts
    3,783
    Liked
    1904 times
    Twitter
    piomasaki

    Re: Building CM10 on Ubuntu 12.10 for your 10" Thrive

    Quote Originally Posted by rodos15 View Post
    Hi pio and thank you very much for this guide

    I think that the

    mv ~/android/thrive/tostab03_device_cm10 ~/android/devices/toshiba/tostab03

    must be

    mv ~/android/thrive/tostab03_device_cm10 ~/android/device/toshiba/tostab03

    And also who ever has this problem:
    make: *** No rule to make target `vendor/cm/proprietary/Term.apk', needed by `/build/cyanogenmod/out/target/product/otter/system/app/Term.apk'. Stop.
    Run this in the root of your android folder:
    vendor/cm/get-prebuilts
    Yup good catch I haven't had a chance to read back over it for those little errors :thumbup:

    Tapatalked from my HTC DNA
    JB/ICS OC Kernels | My ROMs section | TWRP Recovery for Thrive
    CM10 General Thread | Jelly Bean Guide
    Donations, always appreciated!
    Need a rollback or reflash? Just send a PM!

  7. #6
    Thrive Operative
    Member #
    7273
    Join Date
    Dec 2011
    Location
    Sedro Woolley, WA
    Posts
    198
    Liked
    35 times
    Twitter
    kg7hq
    Hello Pio,

    Thank you for having a knowledge share. I find this extremeley interesting in that I might be able to provide myself a JB ROM with one additional enhancement. After getting the source, is there a means to compile in a USB to Serial driver for the PL2203 chipsetsets?
    My thoughts are that with this and maybe a minicom style application, I could interface my communications equipement with the Thrive in support of emergency communications.
    I hadn't asked for anyone to work this as it is highly specialized so this is my first opportunity to approach. The full size USB ports on the Thrive wallow for some pretty imagnative interfacing which many other tablets don't have.
    So after obtaining the source for the ROM, and hopefully find the source for the USB2Serial driver, do you have any recommnedations on apporach?

    Michael
    Thank you,

    All the Best from the Great Northwest...


    Phonefreedom

  8. #7
    Developer

    Member #
    18359
    Join Date
    Sep 2012
    Location
    Surprise, Az (that's a real place)
    Posts
    3,783
    Liked
    1904 times
    Twitter
    piomasaki

    Re: Building CM10 on Ubuntu 12.10 for your 10" Thrive

    Quote Originally Posted by phonefreedom View Post
    Hello Pio,

    Thank you for having a knowledge share. I find this extremeley interesting in that I might be able to provide myself a JB ROM with one additional enhancement. After getting the source, is there a means to compile in a USB to Serial driver for the PL2203 chipsetsets?
    My thoughts are that with this and maybe a minicom style application, I could interface my communications equipement with the Thrive in support of emergency communications.
    I hadn't asked for anyone to work this as it is highly specialized so this is my first opportunity to approach. The full size USB ports on the Thrive wallow for some pretty imagnative interfacing which many other tablets don't have.
    So after obtaining the source for the ROM, and hopefully find the source for the USB2Serial driver, do you have any recommnedations on apporach?

    Michael
    It'll be on the kernel side, if its possible, there may not be any linux source available for it, let alone for an arm platform. My best guess is Google it and start reading git commits concerning it, maybe you get lucky. Assuming younger a driver built that functions you'll still likely need an app that uses it, as with tv tuner deals, support is built into the kernels, have been for quite awhile, but no software so we can't use them.

    Tapatalked from my HTC DNA
    JB/ICS OC Kernels | My ROMs section | TWRP Recovery for Thrive
    CM10 General Thread | Jelly Bean Guide
    Donations, always appreciated!
    Need a rollback or reflash? Just send a PM!

  9. #8
    Thrive Lurker
    Member #
    10155
    Join Date
    Jan 2012
    Location
    Connecticut
    Posts
    15
    Liked
    3 times
    @pio - Thanks for all of the good info and for taking the time to document all of it. You're really good with documentation for a devloper ;-) Now two dumb questions. BB is my favorite ROM so far. How much change is involved to build BB instead of CM 10? Now the REALLY dumb question. How about building either ROM for a different tablet/processor, eg. Snapdragon. Please go easy on me. I'm an old, retired S/W developer with some free time.

  10. #9
    Developer

    Member #
    18359
    Join Date
    Sep 2012
    Location
    Surprise, Az (that's a real place)
    Posts
    3,783
    Liked
    1904 times
    Twitter
    piomasaki

    Re: Building CM10 on Ubuntu 12.10 for your 10" Thrive

    Quote Originally Posted by ArnieM View Post
    @pio - Thanks for all of the good info and for taking the time to document all of it. You're really good with documentation for a devloper ;-) Now two dumb questions. BB is my favorite ROM so far. How much change is involved to build BB instead of CM 10? Now the REALLY dumb question. How about building either ROM for a different tablet/processor, eg. Snapdragon. Please go easy on me. I'm an old, retired S/W developer with some free time.
    I can cover that stuff in the porting portion, but generally speaking black bean is on 4.2 and 4.1 sources are broken, the main reason I don't build their Rom anymore.

    You can, in theory, build any Rom for any device as long as you have a proper working device tree, a proper working kernel and proper working proprietary libraries. Anything supported by CM, Google AOSP or AOKP will have these available. Changes need to be made in a few places but it will eventually work.

    I'm not going to cover building trees from scratch, I've done it twice, I'm not reliving that nightmare again.

    Tapatalked from my HTC DNA
    JB/ICS OC Kernels | My ROMs section | TWRP Recovery for Thrive
    CM10 General Thread | Jelly Bean Guide
    Donations, always appreciated!
    Need a rollback or reflash? Just send a PM!

  11. #10
    Thrive Informant
    Member #
    18281
    Join Date
    Sep 2012
    Location
    Louisville, KY
    Posts
    55
    Liked
    11 times
    Twitter
    4ptiv4

    Re: Building CM10 on Ubuntu 12.10 for your 10" Thrive

    Hey pio I run AMD to build roms and kernels. Since HT is different with AMD vs Intel the recommended thread flag for AMD is cores x2.

    In my case with a Phenom II x6 (hex core) @ 3.2GHz with 16 GB ram it would be -j12 and that usually results in ~90 minutes for the first build on a SATA3 6GB/s HD (non ssd). If I want an hour or less I can use -j24 and get it done but the comp is pretty much unusable until it's finished or cancelled.

    Sent from my CM10.1 Cricket SGS3
    Last edited by Aptiva; 03-04-2013 at 08:17 AM.
    Tablet: Toshiba Thrive 10.1" (CM10 thanks tybar, pio, and jbettcher)
    Phone: Cricket GS3 AOKP 4/15/13 @ 1.89GHz / Retired & Working LG Optimus C (CM7.2 - BobZhome) & Motorola Droid X (CM9 on .621 OTA)


 


Remove Ads

Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

android kernel build environment ubuntu 12.10
,
android link ln-s cm10
,
buid android ubuntu 12.10
,
build ubuntu ported cm10
,
building android from ubuntu
,
cm 10 term
,

compile jb on ubuntu 12.10

,

compiling cm10 in ubuntu 12.10

,
cyanogenmod/build/target/product
,
git-core is already the newest version cm10.1
,

how to make ubuntu driver using cm10

,
metallic kernel cm10
,
no rule to make target `vendor/cm/proprietary/term.apk'
,
toshiba thrive build cm10
,
ubuntu 12.10 thrive
Click on a term to search our site for related topics.