Follow this Blog!

Sep 28, 2010

f Comment

Download And Build 0xdroid On Unix

Amazon I am trying to download and build 0xlab's Android distribution on Unix but am facing many issues. Specifically I am trying to download and build from scratch 0xlab's Android on Ubuntu 10.04. 0xdroid is customized Android that runs on Beagleboard, which is a low-cost fan-less single board computer which features OMAP3530 processor that delivers laptop like performance at handheld power levels. You can find out more at http://beagleboard.org/.

Let's get down to installing 0xdroid on Unix! Keep in mind many issues you face here may occur when you download and build the original Android source. So this post may help those who are building the original Android too! Questions?

Copy the following text to /etc/apt/sources.list
deb http://tw.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://tw.archive.ubuntu.com/ubuntu/ lucid universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid universe
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://tw.archive.ubuntu.com/ubuntu/ lucid multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://cz.archive.ubuntu.com/ubuntu jaunty-updates main multiverse
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse

This sets up necessary packages for downloading and building Android from scratch. Questions?

Update 'apt' and install tools as necessary via 'apt-get'
Execute 'sudo apt-get update' to update apt since you've changed /etc/apt/sources.list. On my unix machine I needed to install 'curl' via 'sudo apt-get install curl' before moving on. If you have curl skip this step. Along the way of following this tutorial if you get a message saying "xxx command not found" then install it via 'sudo apt-get install xxx'.

Install packages to build Android source
Follow instructions on http://source.android.com/source/download.html (refer to http://www.stata.com/support/faqs/win/64bit.html to find out whether you are 32 bit or 64 bit) to install required packages to build Android source files. MAKE SURE you are following the correct instructions based on whether your Ubuntu Linux is 32-bit x86 or 64-bit x86.

Then follow instructions on http://code.google.com/p/0xdroid/wiki/Source to set up the building environment, how to download 0xdroid source code and how to build it from scratch.

The following section describes some of the errors you may get and how to solve them.

Error #1
Here's what the error looks like.

bin/bash: prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc: No such file or directory
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
host C: acp <= build/tools/acp/acp.c In file included from /usr/include/features.h:378, from /usr/include/stdlib.h:25, from build/tools/acp/acp.c:11: /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

To solve this error execute this command:

sudo apt-get install libc6-dev-i386
Error #2
Here's what the error looks like.

/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
host C: acp <= build/tools/acp/acp.c host C++: libhost <= build/libs/host/pseudolocalize.cpp host C: libhost <= build/libs/host/CopyFile.c host StaticLib: libhost (out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a) ar crs out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/CopyFile.o host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp) /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++ /usr/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] Error 1

To fix this error install libraries according to http://source.android.com/source/download.html and you should be good to go.

My error was caused by not executing "sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev"

Error #3
Here's what the error looks like.

Target system fs image (ubifs): out/target/product/beagleboard/obj/PACKAGING/systemimage_unopt_intermediates/system.img
Making ubifs
/bin/bash: .repo/repo/repo: No such file or directory
/bin/bash: .repo/repo/repo: No such file or directory
make: *** [out/target/product/beagleboard/obj/PACKAGING/systemimage_unopt_intermediates/system.img] Error 127

Here's how to solve it. Did you move your beagle source code from their original directory to another directory? for example perhaps you did "repo sync" somewhere you didn't want and realized it later, then you moved them in the correct directory which is beagle-donut/. If so make sure you copy all hidden files as well. Use this command to copy hidden files:

sudo cp -r .[a-zA-Z0-9]* beagle-donut/
Hope that resolves any issues you encounter during downloading and building Android source code. Questions? Let me know!

Happy playing with Android!
Please leave a comment here!
One Minute Information - by Michael Wen
Find Michael on Google or Facebook
ADVERTISING WITH US - Direct your advertising requests to Michael