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][checked revision]
 
(17 intermediate revisions by 6 users not shown)
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>, is [http://www.mediafire.com/?1gqtzgzmdw4 available here] or Google it. 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 gingerbread and later releases, supporting OpenGL-ES version 1.1, is [http://www.mediafire.com/file/zh095lc3czburai/hw3d-20111216.zip available for download]. Place that zip 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/?marqwt53ii0 external filesharing mirror]. Save this file in the root directory of the XDAndroid source tree, under the same name.
+
Camera support requires a modified proprietary binary library, and the system will not build without this library. A zip file containing the library is available as [http://www.mediafire.com/?b2348y0pg9948p4 liboemcamera.zip]. 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. A script, located in the device/xdandroid repository of the AOSP build tree, will automatically download the currently-supported Google Apps package, then extract it and configure the build tree to use it. (BookPhone.apk is missing from gapps package and is [http://www.mediafire.com/?6d9zamxw9wwyxyy available here] or Google it then put it into vendor/xdandroid/msm/proprietary)
  
 +
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 -g # Use -g to download the Google Apps package.
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 25: Line 30:
 
$ 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''' When building a <tt>froyo</tt> image, 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.
 +
 +
Recent versions of Ubuntu (after 10.04 AFAIK) have [http://code.google.com/p/android/issues/detail?id=20795 a pitfall when building.]  Edit <tt>build/core/combo/HOST_linux-x86.mk</tt>:
 +
    -HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
 +
    +HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
  
 
==Packaging the System==
 
==Packaging the System==
Line 33: Line 44:
 
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.

Latest revision as of 05:55, 18 January 2012

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, is available here or Google it. 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 gingerbread and later releases, supporting OpenGL-ES version 1.1, is available for download. Place that zip in the root of your XDAndroid source tree and do not extract it.

Camera support requires a modified proprietary binary library, and the system will not build without this library. A zip file containing the library is available as liboemcamera.zip. 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. A script, located in the device/xdandroid repository of the AOSP build tree, will automatically download the currently-supported Google Apps package, then extract it and configure the build tree to use it. (BookPhone.apk is missing from gapps package and is available here or Google it then put it into vendor/xdandroid/msm/proprietary)

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 -g # Use -g to download the Google Apps package.

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 When building a froyo image, 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.

Recent versions of Ubuntu (after 10.04 AFAIK) have a pitfall when building. Edit build/core/combo/HOST_linux-x86.mk:

   -HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
   +HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

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.