Instead of storing the whole recovery image in system in order to
flash it on first boot, we instead use an imgdiff patch from the boot
image to create the recovery image. This is substantially smaller
since it effectively only stores the recovery binary and UI images
(the kernel and the init binary are identical to that of the boot
image).
This change modifies the OTA-building script to create and install
these patches, and changes the calculation of the system image size in
the Makefile to reflect the new scheme.
Make some changes needed to applypatch in order to store the recovery
image in the system partition as a binary patch relative to the boot
image:
- make applypatch use shared libraries, so it's smaller. It will
need to be on the main system so it can install the recovery
image. Make an applypatch_static binary for use in recovery
packages (still needed for updating cupcake devices to donut).
- output the results of patching to an in-memory buffer and write
that to the partition; there's no convenient /tmp for us to us.
(This should be basically a no-op in recovery, since /tmp is a
ramdisk anyway.)
When I moved the building of the recovery image upwards in the file, I
moved an 'endif' surrounding it but not the matching 'if'. How did
this ever work?
There are currently two errors in the way we test the size of built
images against the size of the partition on the hardware:
- the limits in BoardConfig.mk are set with the data size only, but
images contain an extra 64 bytes per 2048-byte page. This means we
think the partition is about 1/32 smaller than it really is.
- when we deliver a build via OTA, the system partition ends up with
one more file than when it's flashed via fastboot. That file is a
copy of the recovery image. In order to be able to OTA a build, we
need to make sure the system partition has enough room for all the
system files plus the recovery image as well.
For the kila system partition, these errors are roughly the same order
of magnitude -- about 2MB, one in the "safe" direction, one in the
"unsafe" direction. This change fixes both to give us a more accurate
notion of how close we are to the limit.
Make the build emit a warning (but not fail) when the size is within
32kb of the limit.
Also, include the values of the partition size limits in an info file
in the target-files package, so post-processing tools can use them
without parsing the BoardConfig.mk file.
When building an OTA package, TARGET_RELEASETOOLS_EXTENSIONS can be
set (in BoardConfig.mk) to specify where the device-specific
releasetools code is located. (The default location is the common
directory for the device's vendor.) The TARGET_OTA_SCRIPT_MODE can be
used to override the default script mode ("auto") for a particular
device.
Non-HTC devices may have multiple files constituting their "radio
image". Generalize the INSTALLED_RADIOIMAGE_TARGET variable a bit:
initially define it as empty, then let AndroidBoard.mk files add to
it. Provide a convenience function add-radio-image for them to call
to add files. Put all those files into the target_files zip for use
in OTA and fastboot package construction.
Note that for HTC devices, this changes the name of the radio image in
the target_files zip: instead of "RADIO/image" it will be
"RADIO/radio.img". Tools that use the target_files zip will need to
be changed.
Split the details of generating script syntax into a generator class:
one for amend (whose output should be equivalent to the current
output), and one for edify.
Fix 'otatools' build rule to build imgdiff.
The ota and img building scripts contained some hardcoded 'linux-x86'
paths. Remove and replace with a slightly redefined -p option.
Modify Makefile to pass correct -p when building.
Merge commit '1a28c1a4c1ad0c4adf0c63bb36f47394e9509360'
* commit '1a28c1a4c1ad0c4adf0c63bb36f47394e9509360':
remember in the target-files package what version of the API recovery uses
Some devices define a BOARD_KERNEL_BASE argument which must be given
as an argument to mkbootimg when building a bootable image. Store the
value of this var (if any) in the target-files zip and use it when
building images.
The SDK build used to have the update package as a dependency, in
order to force various image files to be built. Now the the update
package can't be built for sdk-eng, list the individual images needed
instead.
Merge commit 'cf348b97bdb52b7ffe7be0d17318b1fda425a211'
* commit 'cf348b97bdb52b7ffe7be0d17318b1fda425a211':
use releasetools scripts to build update and OTA packages
Merge commit '0347423753fb5d7207aa1ea93a8429f59468eb41'
* commit '0347423753fb5d7207aa1ea93a8429f59468eb41':
build 'updater' binary for use in OTA packages
Add VpnServices to PRODUCT_PACKAGES.
Merge commit '8b70e8c6574e6e6e80aaa84fe1a9426995fa0a78'
* commit '8b70e8c6574e6e6e80aaa84fe1a9426995fa0a78':
use minigzip instead of system gzip in the build
Use zlib's minigzip utility, built as part of our source tree, instead of
whatever installation of GNU gzip happens to be on the user's machine.
Using zlib's deflater, which is nicely available as a library (unlike
GNU gzip's deflater) will ultimately let us do binary patches to the
boot and recovery images.
- rename the directory and zip file
- make it build to the dist directory
Original author: joeo
Merged from: //branches/cupcake/...
Automated import of CL 145850
Original change by joeo@abreu on 2009/04/06 19:54:13.
Implement SDK add-ons in the build system.
- Add an option to use the standard javadoc doclet instead
of droiddoc, since droiddocs non-sdk templates aren't
ready for prime time.
- Add the notion of a stubs for a library. It's only
implemented for java libraries, but when we do native
libraries in the NDK or sdk-addons, it will work there too.
Original author: joeo
Merged from: //branches/cupcake/...
Automated import of CL 145618