The XDAndroid Project is no longer active.
This site provides archived information from while the project was under development. Some links may no longer function.

Difference between revisions of "Getting the Source"

From The XDAndroid Project
Jump to navigation Jump to search
[unchecked revision][checked revision]
(Add github link.)
 
(18 intermediate revisions by 8 users not shown)
Line 1: Line 1:
----
+
XDAndroid is based on the Android open-source project (AOSP). AOSP is separated into many individual repositories for Android programs, frameworks and utilities. The AOSP source tree also includes third-party open-source libraries and programs, used by the Android system to perform various tasks. For all of these repositories, a utility called <tt>repo</tt> manages the logistics of checking out, updating and modifying the sources.
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://odygobyciqi.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 
----
 
=[http://odygobyciqi.co.cc CLICK HERE]=
 
----
 
</div>
 
XDAndroid is based on the Android open-source project (AOSP). AOSP is separated into many individual repositories for Android programs, frameworks and utilities. The AOSP source tree also includes third-party open-source libraries and programs, used by the Android system to perform various tasks. For all of these repositories, a utility called &lt;tt>repo&lt;/tt> manages the logistics of checking out, updating and modifying the sources.
 
  
 
The following documentation is based highly on the standard [http://source.android.com/source/download.html AOSP source checkout procedures].
 
The following documentation is based highly on the standard [http://source.android.com/source/download.html AOSP source checkout procedures].
  
 
==Prerequisites==
 
==Prerequisites==
Building an AOSP source tree requires that several programs and development packages already be installed on the build host. Please check that your system has all of the following packages installed. The procedures for installing required packages varies based on the Linux distribution used on the build host.
+
Building an AOSP source tree requires a Linux build environment. Currently, there is a dependency on glibc 2.11 which also requires a recent distribution such as Ubuntu 10.04 or newer (Ubuntu 11.10 may require addtional steps).
 +
 
 +
In addition, a number of programs and development packages need to be already installed on the build host. Please check that your system has all of the following packages installed. The procedures for installing required packages varies based on the Linux distribution used on the build host.
  
 
* Git (revision control system), version 1.5.4 or higher
 
* Git (revision control system), version 1.5.4 or higher
 
* Common source-building utilities: automake, GCC, etc. (the build-essential package on Debian/Ubuntu)
 
* Common source-building utilities: automake, GCC, etc. (the build-essential package on Debian/Ubuntu)
 
* GNU Privacy Guard (gnupg or gpg)
 
* GNU Privacy Guard (gnupg or gpg)
* Java Development Kit (JDK) 5.0 series, update 12 or higher. JDK 6.0 and higher is not yet supported
+
* Java Development Kit (JDK) 6.0 series (Froyo and earlier require Java Development Kit (JDK) 5.0 series, update 12 or higher.)
 
* flex, a lexical analyzer
 
* flex, a lexical analyzer
 
* bison, a parser generator
 
* bison, a parser generator
Line 27: Line 21:
 
* curl, an HTTP (and others) client and library
 
* curl, an HTTP (and others) client and library
  
If multiple versions of Java JREs or JDKs are available, the system must be configured to use JDK-5 by default. On Debian/Ubuntu systems, this can be done via &lt;tt>sudo update-java-alternatives -s java-1.5.0-sun&lt;/tt>.
 
  
The build host will also need at least 1.5GiB of RAM and 10GiB of disk space for the Android build. The initial checkout of the source tree will require up to 2GiB of disk space.
+
An example of installing these packages on Ubuntu/Debian:
 +
 
 +
<tt>
 +
$ sudo apt-get install git-core build-essential gnupg flex bison gperf libsdl-dev esound zip curl libwxgtk2.6-0 libc6-dev-i386 g++-multilib lib32z1-dev lib32ncurses5-dev java-common openjdk-6-jdk
 +
</tt>
 +
 
 +
 
 +
If multiple versions of Java JREs or JDKs are available, the system must be configured to use JDK-6 by default. On Debian/Ubuntu systems, this can be done via <tt>sudo update-java-alternatives -s java-6-openjdk</tt>.
 +
 
 +
If you need Sun's (Oracle's) Java, [https://github.com/flexiondotorg/oab-java6 see here.]
  
&lt;div class="warning">Ubuntu Lucid (10.04) no longer supports Java 5. Please see the following procedure for adding the needed packages and repositories to your Ubuntu Lucid system...&lt;/div>
+
<div class="warning">'''Froyo and Earlier Builds:''' Ubuntu Lucid (10.04) no longer supports Java 5. Please see the following procedure for adding the needed packages and repositories to your Ubuntu Lucid system...
  
As root, create a new file in &lt;tt>/etc/apt/sources.list.d/&lt;/tt> named &lt;tt>jaunty.list&lt;/tt>. Inside the file, add the following two lines:
+
As root, create a new file in <tt>/etc/apt/sources.list.d/</tt> named <tt>hardy.list</tt>. Inside the file, add the following two lines:
&lt;syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash">
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
+
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
+
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
&lt;/syntaxhighlight>
+
</syntaxhighlight>
  
 
These sources may also be added via the user interface program, under System -> Administration -> Software Sources.
 
These sources may also be added via the user interface program, under System -> Administration -> Software Sources.
Line 43: Line 45:
 
After that, update your local packages list and install the package:
 
After that, update your local packages list and install the package:
  
&lt;syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash">
 
$ sudo apt-get update
 
$ sudo apt-get update
 
$ sudo apt-get install sun-java5-jdk
 
$ sudo apt-get install sun-java5-jdk
&lt;/syntaxhighlight>
+
</syntaxhighlight>
 +
</div>
 +
 
 +
The build host will also need at least 1.5GiB of RAM and 10GiB of disk space for the Android build. The initial checkout of the source tree will require up to 2GiB of disk space.
  
 
==Installing repo==
 
==Installing repo==
It is recommended that repo be installed in a normal user's &lt;tt>~/bin&lt;/tt> directory.
+
It is recommended that repo be installed in a normal user's <tt>~/bin</tt> directory.
  
&lt;syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash">
 
$ mkdir ~/bin
 
$ mkdir ~/bin
$ curl http://android.git.kernel.org/repo >~/bin/repo
+
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
 
$ chmod +x ~/bin/repo
 
$ chmod +x ~/bin/repo
$ export PATH="${PATH}:~/bin"
+
$ PATH=~/bin:$PATH
&lt;/syntaxhighlight>
+
</syntaxhighlight>
  
 
==Initialize repo And Check Out the Source==
 
==Initialize repo And Check Out the Source==
 
The XDAndroid project maintains its own manifest for the repo program. This manifest contains a list of all repositories that repo must clone. The XDAndroid manifest directs repo to download variants of certain pieces of AOSP that require modifications for our devices.
 
The XDAndroid project maintains its own manifest for the repo program. This manifest contains a list of all repositories that repo must clone. The XDAndroid manifest directs repo to download variants of certain pieces of AOSP that require modifications for our devices.
  
The following examples assume you will be checking out the source tree into the directory &lt;tt>~/xdandroid&lt;/tt>.
+
The following examples assume you will be checking out the source tree into the directory <tt>~/xdandroid</tt>.
  
&lt;syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash">
 
$ mkdir ~/xdandroid
 
$ mkdir ~/xdandroid
 
$ cd ~/xdandroid
 
$ cd ~/xdandroid
$ repo init -u git://gitorious.org/xdandroid-eclair/manifest.git -b froyo
+
$ repo init -u git://gitorious.org/xdandroid/manifest.git -b gingerbread
$ repo sync&lt;/syntaxhighlight>
+
$ repo sync</syntaxhighlight>
 +
 
 +
<div class="warning">'''WARNING''' Our source code was kept on gitorious, which is now defunct. However, the code has been mirrored and may still be browsed or checked out on [https://github.com/xdandroid github].</div>
  
Your tree can be initialized to track a specific branch by adding &lt;tt>-b &lt;branch_name>&lt;/tt> to the end of the &lt;tt>repo init&lt;/tt> command. For example, to grab the eclair source tree, which will then not be forwarded to froyo (and any subsequent releases), the following &lt;tt>repo init&lt;/tt> command would be used:
+
Your tree can be initialized to track a specific branch by adding <tt>-b <branch_name></tt> to the end of the <tt>repo init</tt> command. For example, to grab the froyo source tree, which will then not be forwarded to gingerbread (and any subsequent releases), the following <tt>repo init</tt> command would be used:
  
&lt;syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash">
$ repo init -u git://gitorious.org/xdandroid-eclair/manifest.git -b eclair
+
$ repo init -u git://gitorious.org/xdandroid/manifest.git -b froyo
&lt;/syntaxhighlight>
+
</syntaxhighlight>
  
&lt;div class="warning">'''WARNING''' The &lt;tt>master&lt;/tt> branch is currently broken. Please use a named release branch, such as &lt;tt>froyo&lt;/tt> or &lt;tt>eclair&lt;/tt>.&lt;/div>
+
<div class="warning">'''WARNING''' The <tt>master</tt> branch is currently broken. Please use a named release branch, such as <tt>gingerbread</tt> or <tt>froyo</tt>.</div>
  
Without a &lt;tt>-b &lt;branch_name>&lt;/tt> argument, the repositories will track the HEAD branch (master for most of the repositories), which will always be the latest released AOSP tree, with live development.
+
Without a <tt>-b <branch_name></tt> argument, the repositories will track the HEAD branch (master for most of the repositories), which will always be the latest released AOSP tree, with live development.
  
Wait quite a while and your XDAndroid source tree will be checked out. This will download up to 2GiB of data, so it may take a long time depending on your Internet connection's capacity, or traffic to the source repository servers, etc.
+
Wait quite a while and your XDAndroid source tree will be checked out. This will download up to 2GiB of data, so it may take a long time depending on your Internet connection's capacity, or traffic to the source repository servers, etc.  
  
 
After the conclusion of this process, the build tree may be configured. See [[Build Configuration]].
 
After the conclusion of this process, the build tree may be configured. See [[Build Configuration]].

Latest revision as of 21:34, 6 April 2020

XDAndroid is based on the Android open-source project (AOSP). AOSP is separated into many individual repositories for Android programs, frameworks and utilities. The AOSP source tree also includes third-party open-source libraries and programs, used by the Android system to perform various tasks. For all of these repositories, a utility called repo manages the logistics of checking out, updating and modifying the sources.

The following documentation is based highly on the standard AOSP source checkout procedures.

Prerequisites

Building an AOSP source tree requires a Linux build environment. Currently, there is a dependency on glibc 2.11 which also requires a recent distribution such as Ubuntu 10.04 or newer (Ubuntu 11.10 may require addtional steps).

In addition, a number of programs and development packages need to be already installed on the build host. Please check that your system has all of the following packages installed. The procedures for installing required packages varies based on the Linux distribution used on the build host.

  • Git (revision control system), version 1.5.4 or higher
  • Common source-building utilities: automake, GCC, etc. (the build-essential package on Debian/Ubuntu)
  • GNU Privacy Guard (gnupg or gpg)
  • Java Development Kit (JDK) 6.0 series (Froyo and earlier require Java Development Kit (JDK) 5.0 series, update 12 or higher.)
  • flex, a lexical analyzer
  • bison, a parser generator
  • gperf, a hash function generator
  • libsdl and its development files
  • esound (libesd0) and its development files
  • WxWidgets GTK 2.6 (libwxgtk2.6) and its development files
  • zip, a Zip-archive program
  • curl, an HTTP (and others) client and library


An example of installing these packages on Ubuntu/Debian:

$ sudo apt-get install git-core build-essential gnupg flex bison gperf libsdl-dev esound zip curl libwxgtk2.6-0 libc6-dev-i386 g++-multilib lib32z1-dev lib32ncurses5-dev java-common openjdk-6-jdk


If multiple versions of Java JREs or JDKs are available, the system must be configured to use JDK-6 by default. On Debian/Ubuntu systems, this can be done via sudo update-java-alternatives -s java-6-openjdk.

If you need Sun's (Oracle's) Java, see here.

Froyo and Earlier Builds: Ubuntu Lucid (10.04) no longer supports Java 5. Please see the following procedure for adding the needed packages and repositories to your Ubuntu Lucid system...

As root, create a new file in /etc/apt/sources.list.d/ named hardy.list. Inside the file, add the following two lines:

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse

These sources may also be added via the user interface program, under System -> Administration -> Software Sources.

After that, update your local packages list and install the package:

$ sudo apt-get update
$ sudo apt-get install sun-java5-jdk

The build host will also need at least 1.5GiB of RAM and 10GiB of disk space for the Android build. The initial checkout of the source tree will require up to 2GiB of disk space.

Installing repo

It is recommended that repo be installed in a normal user's ~/bin directory.

$ mkdir ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod +x ~/bin/repo
$ PATH=~/bin:$PATH

Initialize repo And Check Out the Source

The XDAndroid project maintains its own manifest for the repo program. This manifest contains a list of all repositories that repo must clone. The XDAndroid manifest directs repo to download variants of certain pieces of AOSP that require modifications for our devices.

The following examples assume you will be checking out the source tree into the directory ~/xdandroid.

$ mkdir ~/xdandroid
$ cd ~/xdandroid
$ repo init -u git://gitorious.org/xdandroid/manifest.git -b gingerbread
$ repo sync
WARNING Our source code was kept on gitorious, which is now defunct. However, the code has been mirrored and may still be browsed or checked out on github.

Your tree can be initialized to track a specific branch by adding -b <branch_name> to the end of the repo init command. For example, to grab the froyo source tree, which will then not be forwarded to gingerbread (and any subsequent releases), the following repo init command would be used:

$ repo init -u git://gitorious.org/xdandroid/manifest.git -b froyo
WARNING The master branch is currently broken. Please use a named release branch, such as gingerbread or froyo.

Without a -b <branch_name> argument, the repositories will track the HEAD branch (master for most of the repositories), which will always be the latest released AOSP tree, with live development.

Wait quite a while and your XDAndroid source tree will be checked out. This will download up to 2GiB of data, so it may take a long time depending on your Internet connection's capacity, or traffic to the source repository servers, etc.

After the conclusion of this process, the build tree may be configured. See Build Configuration.