Commit graph

13 commits

Author SHA1 Message Date
Doug Zongker
6c770467fb applypatch changes for patching recovery image
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.)
2009-07-22 19:15:59 -07:00
Doug Zongker
6b2bb3d96d better patching for zip files
Adds a zip mode ("-z") to imgdiff to construct efficient patches for
zip files (including jars and apks).  We identify the regions within
the zip file containing deflated data, and when a corresponding file
can be found in the source zip, a patch is generated for the
uncompressed version of the data.

The GZIP chunk type is replaced with a DEFLATE chunk type that handles
a raw deflated data stream.  This new DEFLATE chunk can be used for
both gzipped pieces (as found within boot and recovery images) and zip
files (apks, etc.)  The gzip header and footer are handled by NORMAL
chunks on either side of the main DEFLATE chunks.  (Typically these
tiny NORMAL chunks will get merged with adjacent chunks, so the number
of output chunks is unaffected.)

Add a test script that tests the generate-apply cycle on all the zips
and images within a pair of full OTA packages.
2009-07-20 14:45:29 -07:00
Doug Zongker
3b72436dbe handle identical gzip chunks better
Improve the speed of incremental OTA install by treating unchanging
gzip chunks as normal chunks, avoiding a decompress/recompress cycle.
This reduces the time needed to apply a patch to a boot image where
the kernel has not changed from ~30 seconds to ~2 seconds, on an opal.
2009-07-15 17:54:30 -07:00
Doug Zongker
6e9c1a6dd0 remove some accidentally-submitted debug logging 2009-07-01 14:18:59 -07:00
Doug Zongker
5a79087638 make applypatch into a static library
Turn the bulk of applypatch into a static library so it can be used
from the updater.  Also build it as a standalone executable for use by
the existing OTA mechanism.
2009-06-12 09:42:43 -07:00
Doug Zongker
5da317e51d support incremental updates of boot image
Modify applypatch to be able to write MTD partitions as well as read
them.  Make applypatch save a backup copy of the contents of an MTD
partition it reads in cache, to be used in case an update is
interrupted while writing back to MTD.  Modify OTA package creation
script to send boot image updates in patch form.
2009-06-02 14:09:11 -07:00
Doug Zongker
f6a8bada5f add support for reading MTD partitions to applypatch
Allow an MTD partition so serve as a source "file" in applypatch,
using a magically-formatted 'filename' that specifies the partition
name, size of data to read, and expected hash.  Build incremental OTAs
that update the recovery image via a patch.
2009-06-01 15:48:24 -07:00
Doug Zongker
02d444b07e new image diffing tool and support for image patches in applypatch
Images (like boot and recovery) consist of large sections of gzipped
data interspersed with other data.  To do effective binary patching of
these files, we need to apply patches to the gzipped parts in
'uncompressed space', that is, we decompress, apply a patch, then
recompress to obtain the desired output.

This change defines a new format with these patches, which is
basically a description of how the source and target files are to be
divided up into chunks and a bsdiff patch for each chunk.  We add a
new host executable, "imgdiff", for generating these patches from
source and target images, and add support in applypatch for
recognizing this format and applying it on the device.
2009-05-28 21:18:46 -07:00
Doug Zongker
ef85ea6086 allow separate source and target files for applypatch
Allow applypatch to use different filenames for the source and target.
(Using the same filename is still fine; in fact the target filename
can be specified as "-" to mean "same as the source file.)  This will
allow us to still use diffs in the case of files being renamed, and
will allow us to use diffs for the boot and recovery images.
2009-05-08 15:43:26 -07:00
The Android Open Source Project
88b607994a auto import from //depot/cupcake/@135843 2009-03-03 19:28:42 -08:00
The Android Open Source Project
05806d7af6 auto import from //depot/cupcake/@135843 2009-03-03 18:28:14 -08:00
The Android Open Source Project
ed18741e07 auto import from //branches/cupcake/...@127101 2009-01-20 14:03:55 -08:00
The Android Open Source Project
66339ad5ce auto import from //branches/cupcake/...@126645 2009-01-15 16:12:07 -08:00