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 "Building and Packaging"

From The XDAndroid Project
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Line 1: Line 1:
 
With a configured source tree, building and packaging is a somewhat painless process. There are a couple of preliminary steps to do for optional portions of the system (such as Google apps). However, most of the time spent with the build process is waiting for compilation.
 
With a configured source tree, building and packaging is a somewhat painless process. There are a couple of preliminary steps to do for optional portions of the system (such as Google apps). However, most of the time spent with the build process is waiting for compilation.
 +
 +
<div class="warning">'''NOTE''' The following build procedures are for the <tt>froyo</tt> branch and newer. For <tt>eclair</tt> build procedures, please see [[Building and Packaging Eclair]].</div>
  
 
Before commencing with the complete build, it may be necessary to provide dependencies for the system.
 
Before commencing with the complete build, it may be necessary to provide dependencies for the system.
  
 
==Build Dependencies==
 
==Build Dependencies==
It will most likely be necessary to provide certain proprietary drivers and libraries to the build system. For XDAndroid project target devices, this will require the HTC Dream (Android Dev Phone) system image, from which those bits will be extracted. The Android Dev Phone is reference hardware, and so the system image is provided by HTC for download. The image can be downloaded from the [http://developer.htc.com/adp.html HTC Developer Center website], via the <tt>signed-dream_devphone_userdebug-ota-14721.zip</tt> link. The zip file should be saved, with the same name, in the root directory of the XDAndroid source tree. This can be skipped only if the build system has been configured to generate a kitchen base image.
+
XDAndroid runs on hardware similar to the HTC G1 and Android Dev Phone. As a result, XDAndroid takes advantage of the similarities by using certain proprietary libraries as provided by the reference system for the Dev Phone. Before building the system, download the Dev Phone system image, <tt>signed-dream_devphone_userdebug-ota-14721.zip</tt>, from [http://developer.htc.com/adp.html HTC Developer Center]. Place the zip file in the root of your XDAndroid source tree and '''do not extract it'''.
  
If, while configuring the build system via <tt>buildspec.mk</tt>, installation of the Google apps was enabled, it is necessary to provide those binaries to the build system. These binaries can be extracted from a running Android Eclair system via ADB, or in lieu of such a device, a bundle of apps can be downloaded from an [http://www.mediafire.com/?hy2yj42my3i external filesharing mirror]. Save this file in the root directory of the XDAndroid source tree, under the same name.
+
Hardware-accelerated 3D graphics are also available using a proprietary driver originally developed for the HTC Dream. A new driver compatible with eclair and froyo is [http://www.mediafire.com/?2axgzmimtj5 available for download]. Place that zip in the root of your XDAndroid source tree and '''do not extract it'''.
  
Finally, the needed files must be extracted from those archives. There is a script in the XDAndroid-specific portion of the source tree which can accomplish this. To do this, perform the following from the root of the XDAndroid source tree...
+
Additionally, XDAndroid optionally allows installation of Google's proprietary programs. These programs provide the most popular common features of Android systems. It is usually recommended to install these. The latest Google Apps package, which works with hardware supported by the XDAndroid project, is [http://kanged.net/mirror/gapps/gapps-mdpi-FRF91-3-signed.zip available for download]. Place the zip file in the root of your XDAndroid source tree and, as usual, '''do not extract it'''.
  
 +
Finally, with the needed packages stored in the XDAndroid root, run a script to automatically extract the files and configure the build system:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ cd vendor/xdandroid/msm
+
$ cd device/xdandroid/msm
 
$ ./unzip-files.sh
 
$ ./unzip-files.sh
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 25: Line 28:
 
$ make -j4 # A -jX argument based on the number of CPUs available, plus one, is recommended.
 
$ make -j4 # A -jX argument based on the number of CPUs available, plus one, is recommended.
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
<div class="warning">'''NOTE''' It may be necessary to add /sbin to your PATH, if building ext2 filesystem images. If so, use the following command instead: <tt>PATH="${PATH}:/sbin" make -j4</tt></div>
  
 
After several weeks, the build will be complete and the system is ready for packaging.
 
After several weeks, the build will be complete and the system is ready for packaging.
Line 33: Line 38:
 
Until development of the system has progressed to the point where the system can be flashed to the phone's integrated flash storage, most of the generated images are of no concern. The most interesting image is <tt>system.img</tt>, which contains the binaries generated by the compilation process.
 
Until development of the system has progressed to the point where the system can be flashed to the phone's integrated flash storage, most of the generated images are of no concern. The most interesting image is <tt>system.img</tt>, which contains the binaries generated by the compilation process.
  
If the recommendations given in [[Build Configuration]] have been followed, the filesystem images will be ext2. This is usable as-is with the current initramfs that the XDAndroid project uses, and it can be renamed <tt>system.ext2</tt> and placed in the user's <tt>andboot</tt> directory for a successful boot.
+
If the recommendations given in [[Build Configuration]] have been followed, the filesystem images will be ext2. This is usable as-is with the current boot process that the XDAndroid project uses, and it can be renamed <tt>system.ext2</tt> and placed in the user's <tt>andboot</tt> directory for a successful boot.
  
 
Optionally, the system image can be repacked as a SquashFS file system, for smaller size. Instructions on completing this step will follow shortly.
 
Optionally, the system image can be repacked as a SquashFS file system, for smaller size. Instructions on completing this step will follow shortly.

Revision as of 02:51, 14 July 2010

With a configured source tree, building and packaging is a somewhat painless process. There are a couple of preliminary steps to do for optional portions of the system (such as Google apps). However, most of the time spent with the build process is waiting for compilation.

NOTE The following build procedures are for the froyo branch and newer. For eclair build procedures, please see Building and Packaging Eclair.

Before commencing with the complete build, it may be necessary to provide dependencies for the system.

Build Dependencies

XDAndroid runs on hardware similar to the HTC G1 and Android Dev Phone. As a result, XDAndroid takes advantage of the similarities by using certain proprietary libraries as provided by the reference system for the Dev Phone. Before building the system, download the Dev Phone system image, signed-dream_devphone_userdebug-ota-14721.zip, from HTC Developer Center. Place the zip file in the root of your XDAndroid source tree and do not extract it.

Hardware-accelerated 3D graphics are also available using a proprietary driver originally developed for the HTC Dream. A new driver compatible with eclair and froyo is available for download. Place that zip in the root of your XDAndroid source tree and do not extract it.

Additionally, XDAndroid optionally allows installation of Google's proprietary programs. These programs provide the most popular common features of Android systems. It is usually recommended to install these. The latest Google Apps package, which works with hardware supported by the XDAndroid project, is available for download. Place the zip file in the root of your XDAndroid source tree and, as usual, do not extract it.

Finally, with the needed packages stored in the XDAndroid root, run a script to automatically extract the files and configure the build system:

$ cd device/xdandroid/msm
$ ./unzip-files.sh

The files will be extracted and available to the build system.

Building the System

This highly convoluted step will eventually spit out a number of filesystem images, including one containing the XDAndroid system.

To build the system, execute the following extremely complicated command from the root directory of the XDAndroid source tree...

$ make -j4 # A -jX argument based on the number of CPUs available, plus one, is recommended.
NOTE It may be necessary to add /sbin to your PATH, if building ext2 filesystem images. If so, use the following command instead: PATH="${PATH}:/sbin" make -j4

After several weeks, the build will be complete and the system is ready for packaging.

Packaging the System

The Android build system, which hopefully went off without a hitch, will have generated a number of filesystem images in out/target/product/msm under the root directory of the source tree.

Until development of the system has progressed to the point where the system can be flashed to the phone's integrated flash storage, most of the generated images are of no concern. The most interesting image is system.img, which contains the binaries generated by the compilation process.

If the recommendations given in Build Configuration have been followed, the filesystem images will be ext2. This is usable as-is with the current boot process that the XDAndroid project uses, and it can be renamed system.ext2 and placed in the user's andboot directory for a successful boot.

Optionally, the system image can be repacked as a SquashFS file system, for smaller size. Instructions on completing this step will follow shortly.