Xoom with ICS 4.0.3 AOSP how to

Search This thread

winglord

Member
Dec 5, 2008
14
19
Now that the code is out, let's start hacking the Xoom.
These instructions are for Linux 64-bit Ubuntu 11.10 / Mint 12, with latest updates.

  • follow directions on source.android.com to set up your environment
  • then move to next page to set up the repo and download the code
  • make sure you use Sun/Oracle Java Development Kit 1.6.x. It WILL NOT work with OpenJDK, which comes with Ubuntu 11.10/Mint 12. (best is remove OpenJDK to avoid hard to track errors)
  • downloading the code takes ages (a good 2h even with a good connection) and requires at least 2GB of hard disk space. But for compilation, I'd recommend to have 20GB at least.
  • download proprietary drivers at: http://tinyurl.com/6rfu8rn
  • extract the drivers from Broadcom and NVidia, this will gives you 2 .sh files
  • just run these 2 .sh files and copy the created vendor/ directory into the root of your Google code repo.

There are 2 kinds of Xoom

  • Xoom Verizon LTE, codename stingray
  • Xoom wifi, codename wingray
Make some corrections in the code for GCC 4.6

  • external/mesa3d/src/glsl/linker.cpp: l.70 add: #include <cstddef>
To build the code:

  • . ./build/envsetup.sh
  • lunch full_stingray-userdebug or full_wingray-userdebug
  • make -j5

This can take 2h to compile on an average machine like my MacBook Pro with 8GB RAM (very important to have more than 4GB!!!), or even more. And having a quad-core machine (or even more cores), really saves you tons of time!
Once compilation is done, it's time to flash:

  • go to out/target/product/wingray (or stingray)
  • put your Xoom in fastboot mode: power off, then volume down + power on
  • fastboot erase cache
  • fastboot erase userdata
  • fastboot flash boot boot.img
  • fastboot flash recovery recovery.img
  • fastboot flash system system.img
  • fastboot reboot

Note: you don't need to flash recovery.img, you should instead flash ClockworkMod recovery (http://download.clockworkmod.com/recoveries/recovery-clockwork-4.0.0.4-stingray.img)

And voila, you have a Xoom with WiFi working and all goodies from AOSP. This means no Google apps like Market...

To install Google Apps:
  • download this zip file [http://www.mediafire.com/?1l4ravroiwt4ybw[/url]
  • unzip it and go inside the folder
  • boot your device normally
  • rm system/app/Nfc*
  • adb push system /system
  • adb reboot

There are some errors with exchange service but Market, GMail, Maps work correctly. From there, go update your apps from Market :D

Enjoy!

Update 1: Android 4.0.1 issues back in 4.0.3?
Some people noted some compilation errors I didn't get on 4.0.3 but on 4.0.1. Here are solutions for 4.0.1 (emulator) that may work for you:

build/core/combo/HOST_linux-x86.mk:61 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
build/core/combo/javac.mk:15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
frameworks/base/libs/util/Android.mk: 63 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
libcore/luni/src/main/java/java/lang/Enum.java: 128 return ordinal - o.ordinal ();
external/gtest/include/gtest/internal/gtest-param-util.h:40 #include <cstddef> (after #include <vector>)
 
Last edited:

Kippui

Senior Member
Jan 1, 2011
595
37
How much space just to tinker with ICS/gingerbread?

I have a 1.5 mbps DSL connection and 200gb would take me 8 day/24 hour of downloading and I cant do that.
 

Ianas

Senior Member
Nov 8, 2008
50
13
Salt Lake City
How much space just to tinker with ICS/gingerbread?

I have a 1.5 mbps DSL connection and 200gb would take me 8 day/24 hour of downloading and I cant do that.

I do my building in a VM and the virtual disk image that has ubuntu and AOSP has grown to 45 GB after a compile.

Also, question for OP... why don't we see people using "make -j(n) otapackage" to create CWM compatible ROMs? Just make sure it doesn't have a recovery in it (or it will torch your existing recovery). I torched my recovery the first time I did it, but I think I fixed it (haven't reflashed to find out).
 

RMerlin

Senior Member
Jan 26, 2011
187
63
Montreal
asuswrt.lostrealm.ca
It builds just fine with 3 GB of RAM in my VM here. Takes around 1 hour for me, with 6 CPU threads assigned to the VM, and using -j6. I just wish I could make sure it doesn't waste time compiling the various demos and tests.

I'm also using ccache to speed up (re)building. Google has instructions on how to set it up (it's really easy). Copied from their page (http://source.android.com/source/initializing.html):

You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.

Put the following in your .bashrc or equivalent.

export USE_CCACHE=1

By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.

export CCACHE_DIR=<path-to-your-cache-directory>

The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code.

prebuilt/linux-x86/ccache/ccache -M 50G

This setting is stored in the CCACHE_DIR and is persistent.

I have it set to only 10 GB here, but if you intend to do a lot of rebuilding, 20-40 GB might be a better idea.
 
  • Like
Reactions: zacharias.maladroit

winglord

Member
Dec 5, 2008
14
19
The full AOSP tree + out directory takes 24G on my machine using du -sh.
The OTA package is 90MB, including the recovery, which you probably want to remove.

Indeed, I forgot to mention using USE_CCACHE, it really speeds up your builds. Make sure your cache dir is the top of your AOSP tree, it's even better.
 
Last edited:

AlEsC

Senior Member
Dec 28, 2007
107
32
Paris
Samsung Galaxy Note Pro 12.2
Hi,

Huge thanks for those usefull instructions.
Just a hint for Gentoo builders (and maybe others distrib), if you're having this error after the "lunch" command :

Code:
AOSP> lunch full_wingray-userdebug
build/core/config.mk:268: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com.  Stop.

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

just export env ANDROID_JAVA_HOME with full jdk path :

Code:
export ANDROID_JAVA_HOME=/opt/sun-jdk-1.6.0.29/
 
  • Like
Reactions: zacharias.maladroit

ydaraishy

Senior Member
Jun 27, 2010
204
53
There are 2 kinds of Xoom

  • Xoom Verizon LTE, codename stingray
  • Xoom wifi, codename wingray

There's three kinds of Xoom, the GSM MZ601 as well (Moto's codename everest). This is not supported by Google, but hopefully the hardware is close enough to stingray that the port shouldn't be overly difficult. At worst, the port to everest might have issues with vendor_ril?
 

popokrew

Senior Member
Oct 9, 2010
214
39
Ft Lauderdale
Not sure what I am doing wrong:

Code:
/ICS_SOURCE# make -j4 otapackage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=full_wingray
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================
build/core/main.mk:324: implicitly installing apns-conf_sdk.xml
No private recovery resources for TARGET_DEVICE wingray
host C++: llvm-rs-cc <= frameworks/compile/slang/llvm-rs-cc.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_ast_replace.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_context.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]

<built-in>:0:0: note: this is the location of the previous definition
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/llvm-rs-cc.o] Error 1
make: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_ast_replace.o] Error 1
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_context.o] Error 1
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs.o] Error 1
root@VirtualBox:~/ICS_SOURCE#

Im using this guide as it has more details: http://www.freeyourandroid.com/guide/compile-ics

Any guidance someone could offer would be great.
 

winglord

Member
Dec 5, 2008
14
19
you can use wingray or stingray on everest. Of course, if you use wingray on everest, you won't have phone app and other phone only features.
 

winglord

Member
Dec 5, 2008
14
19
Not sure what I am doing wrong:

Code:
/ICS_SOURCE# make -j4 otapackage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=full_wingray
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================
build/core/main.mk:324: implicitly installing apns-conf_sdk.xml
No private recovery resources for TARGET_DEVICE wingray
host C++: llvm-rs-cc <= frameworks/compile/slang/llvm-rs-cc.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_ast_replace.cpp
host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_context.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]

<built-in>:0:0: note: this is the location of the previous definition
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/llvm-rs-cc.o] Error 1
make: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_ast_replace.o] Error 1
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_context.o] Error 1
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs.o] Error 1
root@VirtualBox:~/ICS_SOURCE#

Im using this guide as it has more details: http://www.freeyourandroid.com/guide/compile-ics

Any guidance someone could offer would be great.
You are not doing anything wrong, this is a GCC 4.6 restriction.
Weird I didn't see it with ics 4.0.3 but with 4.0.1 before.

Here is what you need to do for 4.0.1:
build/core/combo/HOST_linux-x86.mk:61 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
build/core/combo/javac.mk:15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
frameworks/base/libs/util/Android.mk: 63 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
libcore/luni/src/main/java/java/lang/Enum.java: 128 return ordinal - o.ordinal ();
external/gtest/include/gtest/internal/gtest-param-util.h:40 #include <cstddef> (after #include <vector>)
 

popokrew

Senior Member
Oct 9, 2010
214
39
Ft Lauderdale
You are not doing anything wrong, this is a GCC 4.6 restriction.
Weird I didn't see it with ics 4.0.3 but with 4.0.1 before.

Here is what you need to do for 4.0.1:
build/core/combo/HOST_linux-x86.mk:61 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
build/core/combo/javac.mk:15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
frameworks/base/libs/util/Android.mk: 63 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
libcore/luni/src/main/java/java/lang/Enum.java: 128 return ordinal - o.ordinal ();
external/gtest/include/gtest/internal/gtest-param-util.h:40 #include <cstddef> (after #include <vector>)

winglord, I was able to get it to build with the guide aceman posted. I believe its because of the modified make: make CC=gcc-4.4 CXX=g++-4.4

Where would I find a log for the entire build? A lot of stuff scrolls by while building.

Now I just need to get the recovery image out (guessing just delete it out of the ota .zip?) and try it out. My Xoom isnt with me right now.
 

AlEsC

Senior Member
Dec 28, 2007
107
32
Paris
Samsung Galaxy Note Pro 12.2
When running lunch you have to chose one of the emulator builds (full_eng if my memory's right). You can't run a build compiled for a specific device.

Thanks :)
This means I'll have to rebuild all !!


Another question, I've made a successfully build, then I've made some modification in the sources, so I've deleted all *.img thinking that "make" will rebuild them... but "make" only rebuild "system.img", "ramdisk.img" and "userdata.img".

Is there a "make boot" or something like that ? (real question is how do I rebuild my boot.img :))

Thanks
 

aceman118

Member
Nov 2, 2010
28
4
I'm using Ubuntu 11.10 64bit and GCC 4.6.
Keep in mind to add '#include <cstddef>' in headers where you have compile errors like indexOf() not found.

I tried that and it didn't seem to work for me. Once I used GCC 4.4 it worked. I couldn't tell you why, though.

So I finally got a build up and running - is there something special that has to be done with the vendor binaries? I know I have seen this in other builds too but the kernel is still showing 2.x and the camera, mic and gps are not working. Is that because work needs to be done to the kernel before it is 100% with ICS? This is my first time messing with an android build so forgive me if this is a dumb question.
 

jonman364

Senior Member
Dec 14, 2010
82
22
Lansing, MI
Thanks :)
This means I'll have to rebuild all !!


Another question, I've made a successfully build, then I've made some modification in the sources, so I've deleted all *.img thinking that "make" will rebuild them... but "make" only rebuild "system.img", "ramdisk.img" and "userdata.img".

Is there a "make boot" or something like that ? (real question is how do I rebuild my boot.img :))

Thanks
Make is usually smart enough to know when something you changed will not result in a different output. It is possible that the changes you made would result in an identical boot.img, therefore it is not rebuilding it.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    Now that the code is out, let's start hacking the Xoom.
    These instructions are for Linux 64-bit Ubuntu 11.10 / Mint 12, with latest updates.

    • follow directions on source.android.com to set up your environment
    • then move to next page to set up the repo and download the code
    • make sure you use Sun/Oracle Java Development Kit 1.6.x. It WILL NOT work with OpenJDK, which comes with Ubuntu 11.10/Mint 12. (best is remove OpenJDK to avoid hard to track errors)
    • downloading the code takes ages (a good 2h even with a good connection) and requires at least 2GB of hard disk space. But for compilation, I'd recommend to have 20GB at least.
    • download proprietary drivers at: http://tinyurl.com/6rfu8rn
    • extract the drivers from Broadcom and NVidia, this will gives you 2 .sh files
    • just run these 2 .sh files and copy the created vendor/ directory into the root of your Google code repo.

    There are 2 kinds of Xoom

    • Xoom Verizon LTE, codename stingray
    • Xoom wifi, codename wingray
    Make some corrections in the code for GCC 4.6

    • external/mesa3d/src/glsl/linker.cpp: l.70 add: #include <cstddef>
    To build the code:

    • . ./build/envsetup.sh
    • lunch full_stingray-userdebug or full_wingray-userdebug
    • make -j5

    This can take 2h to compile on an average machine like my MacBook Pro with 8GB RAM (very important to have more than 4GB!!!), or even more. And having a quad-core machine (or even more cores), really saves you tons of time!
    Once compilation is done, it's time to flash:

    • go to out/target/product/wingray (or stingray)
    • put your Xoom in fastboot mode: power off, then volume down + power on
    • fastboot erase cache
    • fastboot erase userdata
    • fastboot flash boot boot.img
    • fastboot flash recovery recovery.img
    • fastboot flash system system.img
    • fastboot reboot

    Note: you don't need to flash recovery.img, you should instead flash ClockworkMod recovery (http://download.clockworkmod.com/recoveries/recovery-clockwork-4.0.0.4-stingray.img)

    And voila, you have a Xoom with WiFi working and all goodies from AOSP. This means no Google apps like Market...

    To install Google Apps:
    • download this zip file [http://www.mediafire.com/?1l4ravroiwt4ybw[/url]
    • unzip it and go inside the folder
    • boot your device normally
    • rm system/app/Nfc*
    • adb push system /system
    • adb reboot

    There are some errors with exchange service but Market, GMail, Maps work correctly. From there, go update your apps from Market :D

    Enjoy!

    Update 1: Android 4.0.1 issues back in 4.0.3?
    Some people noted some compilation errors I didn't get on 4.0.3 but on 4.0.1. Here are solutions for 4.0.1 (emulator) that may work for you:

    build/core/combo/HOST_linux-x86.mk:61 HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
    build/core/combo/javac.mk:15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
    frameworks/base/libs/util/Android.mk: 63 LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
    libcore/luni/src/main/java/java/lang/Enum.java: 128 return ordinal - o.ordinal ();
    external/gtest/include/gtest/internal/gtest-param-util.h:40 #include <cstddef> (after #include <vector>)
    2
    Are you in ubuntu 11.10? I was having issues also. Check out this site...

    http://www.android-dev.ro/2011/12/13/building-android-4-0-on-ubuntu-11-10/
    1
    It builds just fine with 3 GB of RAM in my VM here. Takes around 1 hour for me, with 6 CPU threads assigned to the VM, and using -j6. I just wish I could make sure it doesn't waste time compiling the various demos and tests.

    I'm also using ccache to speed up (re)building. Google has instructions on how to set it up (it's really easy). Copied from their page (http://source.android.com/source/initializing.html):

    You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.

    Put the following in your .bashrc or equivalent.

    export USE_CCACHE=1

    By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.

    export CCACHE_DIR=<path-to-your-cache-directory>

    The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code.

    prebuilt/linux-x86/ccache/ccache -M 50G

    This setting is stored in the CCACHE_DIR and is persistent.

    I have it set to only 10 GB here, but if you intend to do a lot of rebuilding, 20-40 GB might be a better idea.
    1
    Hi,

    Huge thanks for those usefull instructions.
    Just a hint for Gentoo builders (and maybe others distrib), if you're having this error after the "lunch" command :

    Code:
    AOSP> lunch full_wingray-userdebug
    build/core/config.mk:268: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com.  Stop.
    
    ** Don't have a product spec for: 'full_wingray'
    ** Do you have the right repo manifest?

    just export env ANDROID_JAVA_HOME with full jdk path :

    Code:
    export ANDROID_JAVA_HOME=/opt/sun-jdk-1.6.0.29/
    1
    I tried that and it didn't seem to work for me. Once I used GCC 4.4 it worked. I couldn't tell you why, though.

    So I finally got a build up and running - is there something special that has to be done with the vendor binaries? I know I have seen this in other builds too but the kernel is still showing 2.x and the camera, mic and gps are not working. Is that because work needs to be done to the kernel before it is 100% with ICS? This is my first time messing with an android build so forgive me if this is a dumb question.
    Yes the kernel used is 2.6.39.4. Drivers for camera, gps... don't seem to be released yet.