Commit graph

76 commits

Author SHA1 Message Date
Doug Zongker
bd2dadc21a check entire recovery partition on startup
Checksum the entire recovery partition at boot time to see if we need
to rewrite it, rather than just the first 2kb.

Bug: 5668350
Change-Id: I777754f92e8da630ae3c09bb0d4c41884ff62f39
2011-12-02 13:55:57 -08:00
Doug Zongker
91b4f8a850 fix syntax error in OTA script
Change-Id: I3a9535acb47fc3960020a390dec8d0294a404c2e
2011-09-23 12:48:33 -07:00
Doug Zongker
afb32eaca0 change OTA tools to handle variable dev keys
The signing and OTA-building tools now understand the
default_sys_dev_certificate value which may be present in the
META/misc_info.txt file of the target-files packages.

Change-Id: I64f09ec0b77a5184b6ddb74019255518776ee773
2011-09-22 10:28:04 -07:00
Doug Zongker
e92f15a858 patch the /system/build.prop file last
Works around a problem observed on a retail device: incremental update
from build 1 to build 2 partially completed, leaving a mix of files
from the two builds.  (Why it booted into the regular system instead
of recovery to restart update installation is still a mystery.)
build.prop was one of the files updated, so the device reported itself
as having build 2.  The device hobbled along for months in this state,
until build 3 was released and the 2-to-3 incremental package
repeatedly failed (because some of the files it was trying to patch
were build 1).

This change makes updating build.prop the very last thing does by an
incremental update script, so if installation is aborted and the
regular system starts (and works at all), it will continue reporting
itself as build 1 and be sent the 1-to-2 OTA package again.

Change-Id: I1edc1dcef2bd2495b6fd96517c2f4c574b994f27
2011-08-26 13:46:40 -07:00
Ying Wang
6d38bdfc7b resolved conflicts for merge of a74a4811 to honeycomb-plus-aosp
Change-Id: I8400ac2bead6aa1a9902d44bf65906084ad353ad
2011-08-11 16:55:00 -07:00
david
cad0bb9f62 sha module is deprecated
This patch removes the deprecated warnings from the python
scripts.

Change-Id: I052a0aab3fb28dd1d78de1307edafda6b6c35e5f
2011-08-10 17:48:04 -07:00
Ying Wang
7e6d4e45d9 Close inherited PIPE before doing work
Gmake in Darwin has file descriptor leak.
In a full build, ota_from_target_files will inherits
more than 2000 open PIPEs from gmake and fails in a call to select.select().
This change fixes the build by closing the PIPEs before doing real work.

Change-Id: Ie7035d7add0b1da3afb6bf9c2009d40f8c7d29b3
2011-02-10 11:36:43 -08:00
Doug Zongker
55d932840f support use of prebuilt bootable images
img_from_target_files now, with the -z flag, will produce an output
zip with only the bootable partitions (boot and recovery).

img_ and ota_from_target_files can take, instead of a simple
"target_files.zip", a name of the form
"target_files.zip+bootable_images.zip", where the second zip contains
bootable images that should be used instead of building them from the
target_files.zip.  (This should be the zip produced by the above -z
flag, perhaps with the images messed with in some way, such as by an
unnamed OEM's extra signature wrapper for their "secure boot"
process.)

Bug: 3391371
Change-Id: Iaf96dfc8f30e806ae342dcf3241566e76ae372d4
2011-01-25 17:07:09 -08:00
Ying Wang
f9bbfb5772 Close inherited PIPE before doing work
Gmake in Darwin has file descriptor leak.
In a full build, ota_from_target_files will inherits
more than 2000 open PIPEs from gmake and fails in a call to select.select().
This change fixes the build by closing the PIPEs before doing real work.

Change-Id: Ife021382198642a97bbbf0b623e4f24f3d86b2b2
2010-12-13 16:25:36 -08:00
Doug Zongker
e1c292a06b am 8317e664: am 96a57e73: make info_dict and GetTypeAndDevice available to device extensions
Merge commit '8317e66433903badaec8ebd2b9ec2b8153f3d612'

* commit '8317e66433903badaec8ebd2b9ec2b8153f3d612':
  make info_dict and GetTypeAndDevice available to device extensions
2010-09-26 15:17:44 -07:00
Doug Zongker
96a57e7377 make info_dict and GetTypeAndDevice available to device extensions
Change-Id: I3aa04cb6d7988fc1fdd7f179634b09ceab5749fb
2010-09-26 14:57:41 -07:00
Doug Zongker
f2ab290550 accommodate both new and old target-files when creating incrementals
(cherry-picked from gingerbread.)

Change-Id: I925bf122b0012302a85c0b6f04cca48eb694b0c4
2010-09-22 10:17:31 -07:00
Doug Zongker
780c237270 accommodate both new and old target-files when creating incrementals (do not merge)
Change-Id: Ibc211164bf1dee8275e15d10cbe81b63d666069f
2010-09-22 10:12:54 -07:00
Doug Zongker
9ce0fb6e59 support for per-partition fs_type
Include the recovery.fstab file in the recovery image.  Remove the
global fs_type and partition_type values from the target-files
key/value dict, and parse the recovery.fstab file instead to find
types for each partition.

(Cherrypicked from gingerbread w/some edits to resolve conflicts.)

Change-Id: Ic3ed85ac5672d8fe20280dacf43d5b82053311bb
2010-09-21 14:13:11 -07:00
Doug Zongker
258bf46ea6 support for per-partition fs_type (do not merge)
Include the recovery.fstab file in the recovery image.  Remove the
global fs_type and partition_type values from the target-files
key/value dict, and parse the recovery.fstab file instead to find
types for each partition.

Change-Id: I35ee2dd0989441dc2a704b63c1b32e598049acb5
2010-09-21 09:55:29 -07:00
Doug Zongker
b984ae51e5 resolved conflicts for merge of 813ad17a to master
Change-Id: I3fc84babbbcab712c5e38a0c8b815115ba89375f
2010-09-16 23:13:11 -07:00
Doug Zongker
37974731fc consolidate target_files metadata into one key-value file
Instead of separate files for recovery api version, tool extensions,
and mkyaffs2 options, put those all in the generic key-value file.

Change-Id: Ib642311632844d52e4895fd4747093fc7e86232d
2010-09-16 17:44:38 -07:00
Doug Zongker
486de126e3 only do size check for yaffs images; fix incremental info dict
Change-Id: Ic862000a23b93289604b0737bfcaf8d461f36ff8
2010-09-16 14:01:56 -07:00
Doug Zongker
f127eb709b resolved conflicts for merge of 2cb8d5eb to master
Change-Id: I3b1aec1aee7c6bfcee2e978b4755b2bae9e480c4
2010-09-16 12:38:40 -07:00
Doug Zongker
c77a9ad444 store user-visible image sizes in target-files
Do the yaffs-specific adjustments to image sizes in common.CheckSize,
instead of baking it into the image size stored in the target-files
package.  Remove the special fs_type flag and fold it into the
"info_dict" we have for saving key-value pairs from the build system.

Change-Id: I6e63f3330f6277d9a946b22e66cadeb51203ba14
2010-09-16 12:29:17 -07:00
Doug Zongker
c19a8d5590 support for ext4/EMMC in target_files and OTA generation
Move the image sizes into a more generic key-value file.  Make them
optional.  Add additional key/value pairs describing what kind of
filesystem the device uses.  Pass new fs-type-related arguments in
edify scripts when mounting and reformatting partitions.

Don't include all the init.*.rc files from the regular system in
recovery -- they aren't needed, and break recovery on some devices.

Change-Id: Ic1c651f754ed00ba1cffe8cf56c43f7f3b0ebfd7
2010-09-16 11:34:31 -07:00
Doug Zongker
d3b5916be6 resolved conflicts for merge of 8ae62ec7 to master
Change-Id: Ieb424d1a8467ca13dae43190387e1137c1e396c9
2010-09-13 14:37:20 -07:00
Doug Zongker
ea5d7a9de7 move File and Difference classes into common script
This makes them accessible from device-specific extensions (so they
can be used to send radio images as binary patches, for instance).

Change-Id: I2f2174b93b4265abf9400f9e5a0982caca0771e9
2010-09-12 15:26:16 -07:00
Doug Zongker
c60c1bafa0 resolved conflicts for merge of a4a50996 to master
Change-Id: I52c617ff43aaf9e86b8fb7a2e9c305127566971a
2010-09-03 13:22:38 -07:00
Doug Zongker
c637db16d8 remove remaining amend support
Remove the remaining (unused and untested) support for generating
amend scripts.  This means that you won't be able to OTA directly from
cupcake to gingerbread.

Change-Id: Iaf5295db92a42b336960d05295f48b67cb729337
2010-09-03 11:58:31 -07:00
Hristo Bojinov
dafb042755 Turn on ASLR by default. The "-a" option now takes an argument (on/off).
Change-Id: I4ddc70f2087c23586fc6aaaff3bb862f83d9779d
2010-08-26 14:37:42 -07:00
Hristo Bojinov
96be7205dc Working ASLR implementation.
ASLR for shared libraries is controlled by "-a" in ota_from_target_files.
Binary files are self-contained (supported by apriori/soslim).

Signed-off-by: Hristo Bojinov <hristo@google.com>
Change-Id: I500e325bf4a70a8d69a2ab9b2938e83dadb4e65d
2010-08-02 14:25:01 -07:00
Doug Zongker
67369983cf generate pseudofilenames for EMMC partitions
Change-Id: Ibe77f4338fed5745c7c650270dcef24988ebfdda
2010-07-07 14:34:59 -07:00
Doug Zongker
b4c7d32cba support for ext4/EMMC in target_files and OTA generation
Move the image sizes into a more generic key-value file.  Make them
optional.  Add additional key/value pairs describing what kind of
filesystem the device uses.  Pass new fs-type-related arguments in
edify scripts when mounting and reformatting partitions.

Don't include all the init.*.rc files from the regular system in
recovery -- they aren't needed, and break recovery on some devices.

Change-Id: I40e49e65f0d76f735259e4b4fef882322cd739da
2010-07-01 15:30:11 -07:00
Doug Zongker
5a3ba25fbf am c58e4f42: am 06acf91f: am 3b85269c: include build timestamp in OTA metadata
Merge commit 'c58e4f42ec27f81cd72d3e5872fd65e13a8e4213'

* commit 'c58e4f42ec27f81cd72d3e5872fd65e13a8e4213':
  include build timestamp in OTA metadata
2010-06-23 10:18:21 -07:00
Doug Zongker
3b85269cfe include build timestamp in OTA metadata
Change-Id: I44292c6346db3356dfafbd044027e37a9b467cfe
2010-06-21 15:31:39 -07:00
Doug Zongker
027dcb47de am 5324cb81: am ed661dd6: am 1d37a0da: am 2ea21065: add metadata to OTA package in easily-parsed form 2010-05-02 16:15:40 -07:00
Doug Zongker
2ea21065b6 add metadata to OTA package in easily-parsed form
This is only for use by the tools that manipulate OTA packages; it
doesn't touch device code.

Change-Id: I1e21b24b86340d8f86c9d15b2aeb79c461f75d18
2010-04-28 16:05:51 -07:00
Doug Zongker
9ce2ebf5d3 remove remaining amend support
Remove the remaining (unused and untested) support for generating
amend scripts.  This means that you won't be able to OTA directly from
cupcake to gingerbread.

Change-Id: Ie7179a5f2e5ca0d2c0305000344ac39b1dd7385f
2010-04-21 14:17:21 -07:00
Doug Zongker
3475d362a7 fix typo (leftover from some debugging code)
Change-Id: I29a42820ccf8567508f1aeefcc89c2462e9ad43c
2010-03-17 16:39:30 -07:00
Doug Zongker
283e2a1e1b store filesystem config info in target files at build time
Store a dump of the desired uid/gid/mode for every system file in the
target_files zip.  Modify ota_from_target_files to use this stored
information when it is available, instead of running fs_config from
the current client (which might be out of sync from the one where the
target_files zip was built).

b/2516887 - New android_filesystem_config.h needed

Change-Id: I8409a0265d1d50daad9c2bc033c99b74b8931b20
2010-03-15 18:04:15 -07:00
Doug Zongker
c8d446bcde pass blobs to applypatch in incremental OTAs
applypatch now takes patches as blob-valued arguments instead of just
filenames, eliminating the need to unpack all patches to /tmp before
starting to apply them.

Revert the last change I made where sha1_check(read_file(...)) was
substituted for apply_patch_check(...).  apply_patch_check() knows to
check /cache/saved.file if the original source file is missing or has
a bad checksum, which is important if the device loses power or
otherwise restarts during patching.

Change-Id: Ia5b761474b0f809a5a5eed29455b1b145145699e
2010-02-22 15:41:53 -08:00
Doug Zongker
5a48209541 relocate applypatch; check patch integrity
- Delete the applypatch code (it's being moved to bootable/recovery).

- Change the OTA script generator to verify the sha1sum of all the
  patch files after they are unpacked into /tmp.

b/2361316 - VZW Issue PP628: Continuous reset to Droid logo:
            framework-res.apk update failed (CR LIBtt59130)

Change-Id: I5858d48f10127f72e708d50d3de844569d1aff27
2010-02-19 12:14:53 -08:00
Doug Zongker
42265390d9 change incremental OTA file install order
(Cherry-pick from donut.)

Delete the old recovery-from-boot patch before patching system files,
then install the new one at the end of the process.  Also fix an issue
with applypatch returning the wrong status.

Change-Id: I614fce39f307eded696ba792912b863f9fb0580b
2010-02-12 12:20:49 -08:00
Doug Zongker
14833605d2 add UnmountAll function to OTA script; support radio images w/path
Three unrelated changes:

- change the add-radio-file makefile function to support adding files
  with paths.  (The path part of the pathname is stripped off.)

- add an UnmountAll function to the OTA script generation code, so
  that we can explicitly unmount everything we've mounted (in addition
  to doing it automatically at the end of the script).

- add the updater API version to the info object passed to
  device-specific code.

Change-Id: Ia62b15403c1cc8fce8d9910f291450c8077e49f4
2010-02-03 09:21:22 -08:00
Doug Zongker
f2b32f2a4b resolved conflicts for merge of cfd7db6d to eclair 2009-10-07 17:05:36 -07:00
Doug Zongker
cfd7db6d84 move recovery image to the top of the OTA package
Make the recovery image be the first thing installed in system/ in the
OTA package, so it will get installed even if the system partition
fills during OTA installation.
2009-10-07 16:26:00 -07:00
Doug Zongker
c18736b1a7 remember device-specific releasetools extensions in target-files
Store the location of the releasetools extensions in the target-files
zip, and make ota_from_target_files use that stored location by
default (though it can still be overridden with -s if desired).
2009-09-30 09:20:32 -07:00
Doug Zongker
481c4e650f fix python syntax error 2009-09-28 10:07:13 -07:00
Doug Zongker
761e642d54 parallellize computation of binary patches
Change ota_from_target_files to compute binary patches for all the
changed files in the OTA package in parallel.  On a recent test build
this cuts incremental construction time roughly in half (6 min to 2
min 40 sec).
2009-09-25 12:35:11 -07:00
Doug Zongker
881dd40ffb improve the OTA progress bar
Make the OTA progress bar advance a bit more smoothly by reallocating
how much is dedicated to various phases of incremental OTA
installation, based on some crude measurements of how long each phase
takes.
2009-09-20 14:03:55 -07:00
Doug Zongker
15604b84e2 use imgdiff -z to diff zipfiles
imgdiff now understands the zip file format and can produce smaller
patches by doing the patching in uncompressed space.  Start taking
advantage of this for .zip, .apk, and .jar files.
2009-09-01 17:53:34 -07:00
Doug Zongker
f76b9c87b1 remove bootloader assertions
These should be done by the device-specific module where necessary;
they aren't appropriate for all devices.
2009-08-27 16:12:00 -07:00
Doug Zongker
2f78b8ba12 am 8fead691: Merge change 22448 into donut
Merge commit '8fead6912ed3f04867974631935435a887ed889d' into eclair

* commit '8fead6912ed3f04867974631935435a887ed889d':
  incremental OTAs should remove /system/recovery.img
2009-08-24 13:39:30 -07:00
Doug Zongker
3b949f0725 incremental OTAs should remove /system/recovery.img
This file has been replaced by the recovery_from_boot.p patch file,
but needs to be removed from existing devices if it exists.
2009-08-24 10:24:32 -07:00