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
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
Merge commit '9314823c06d4434bf18d589c2fdea490428becf8'
* commit '9314823c06d4434bf18d589c2fdea490428becf8':
return to using subprocess for running commands
Reverts Ic4f1c747 and fixes the problem by splitting the extra_flags
argument (it wasn't working before because it was getting one argument
"-c 4096 -s 128" instead of four arguments "-c", "4096", "-s", "128"
and mkyaffs2image apparently just ignores that bogus argument?)
Change-Id: Ib1e08d634aa68bfab0f7e09680d407f2cee0797d
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
Merge commit '485bd44d0d78f9f612075e17db1adb281741c84f'
* commit '485bd44d0d78f9f612075e17db1adb281741c84f':
Fix mkyaffs2image extra flags in the release tools.
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
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
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
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
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
- 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
(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
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
Apply the same changes to tags to ro.build.tags that we do for the
tags in the fingerprint (ro.build.fingerprint) and the description
(ro.build.description).
Change-Id: Ie5a057d8f04cbc32d849f91e1f9d2ea7832e81f6
http://b/2363735 - release-key user builds ship with property ro.build.tags == test-keys
Setting LOCAL_CERTIFICATE to "EXTERNAL" now marks an apk (either a
prebuilt or otherwise) as needing the default test key within the
system, but one that should be signed after the target_files is
produced but before sign_target_files_apks does the rest of the
signing. (We use this to ship apps on the system that are signed by
third parties, like Facebook.)
The check_target_files_signatures determines what key was used to sign
every .apk in a given target_files. It can compare that signature to
that of another target_files (eg, the previous release for that
device) and flag any problems such as .apks signed with a different
key.
Merge commit '8bec09ee7264160e4e08973a0efcc6bd2c898925' into eclair-mr2
* commit '8bec09ee7264160e4e08973a0efcc6bd2c898925':
add 'extras' mechanism to OTA and signing tools
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.
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).
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).
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.
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.
When unzipping a target-files which has been signed with OTA key
replacement, you'll get "overwrite this file?" prompts because the key
files appear in the zip files twice. Suppress these prompts.
Many developer phone products don't define PRODUCT_OTA_PUBLIC_KEYS, so
add a default key.
This change doesn't affect device code.
Merge commit 'b6153173952895441e55d0ff6be332bb7c7605e2'
* commit 'b6153173952895441e55d0ff6be332bb7c7605e2':
use the max image sizes from the target files zip
For some time now the build system has included all the max image
sizes in a file in the META directory. Use these instead of needing
to parse the BoardConfig.mk file for the device at the time of
building an image or OTA package.
Merge commit '828bbfb18838f04b93ffbed0d7d3b597beaa534c'
* commit '828bbfb18838f04b93ffbed0d7d3b597beaa534c':
in amend, remove symlink targets before creating them
amend's symlink command isn't idempotent, so if you restart after the
symlinks have been completed then the second installation attempt will
fail. Work around this by deleting all symlink targets before
creating symlinks.
Bug: 2020011
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.)
Interpret a "*" in the "require version-bootloader" line as "don't
require any specific bootloader". Sholes OTAs include the bootloader
and the main system in the same package.
Merge commit '030614740c1a22e51c6513058852f9ab368fdf5d'
* commit '030614740c1a22e51c6513058852f9ab368fdf5d':
in auto mode, generate both edify and amend scripts for full OTAs
If we fail to load the device-specific releasetools module (ie, if -s
is specified but the file is missing), issue an error message but
continue without any device-specific code.
If the source target-files zip omits files needed to build the
recovery and/or boot images, leave them out instead of dying with an
error. This lets build like "generic-userdebug" work.
Merge commit '55766e47aaf4fe72a2b5cdd8aa60d14781c01e94'
* commit '55766e47aaf4fe72a2b5cdd8aa60d14781c01e94':
don't fail if no required bootloaders are defined
Generic targets don't have a list of defined bootloaders. Instead of
failing to build an OTA package, just omit the constraint.
Fix bad references to ExternalError.
Replace the installation of the "radio image", which is an
HTC-specific notion, with calls to device-specific python modules that
can add whatever additional OTA script commands are necessary. Add
the -s flag to specify the location of the device-specific script
(replacing the unused -s flag in sign_target_files_apks).
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.
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.
Make the following things optional:
- kernel command lines for bootable images
- radio images
- bootloader assertions
These are not all (yet?) defined for some new devices.
In python 2.5 and earlier, ZipFile.writestr(filename, data) results in
the file being added to the archive with permissions 000. (See
http://svn.python.org/view?view=rev&revision=65235.) Work around this
by creating a ZipInfo object and setting the permissions explicitly.
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.
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.
Use minigzip (from the zlib distribution, built in the android tree)
to compress images rather than the system install of gzip. This will
let us send useful patches for images since we can make zlib available
in the applypatch program.
Allow the user to set ANDROID_PW_FILE to the name of a file for
storing password keys. When the tools need additional passwords, they
will rewrite this file and invoke the user's editor for the new
passwords to be added. This allows passwords to be reused across
invocations of the signing tools, without making the user reenter them
every time.
Paranoid users can use a file stored in a ramdisk, or not use this
feature at all (the code will prompt for passwords in the ordinary way
when ANDROID_PW_FILE is not set).
All APKs that want to share a given user id must be signed with the
same key. Look inside each APK for what (if any) shared user id it
requests, and error out if any with the same shared user are being
signed with different keys.
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.
To support devphone and holiday builds we need more control over the
build fingerprint tags; generalize the -t option so we can arbitrarily
add and remove tags.
Adds the -t option to sign_target_files_apks, which lets the user
specify extra tags that should be added to the build fingerprint
during the signing process.
through the key map. Clarify the help for the -e option to
make clear this should happen.
(This change doesn't affect device code.)
Original author: dougz
Merged from: //branches/cupcake/...
Automated import of CL 146194
The build system now (in donut) produces builds that use the testkey
cert for OTA package verification. Change the app-signing script to
also optionally substitute the "real" cert in both the recovery and
system images. Also fix bug where the build fingerprint and
description were not getting properly updated in the recovery
partition.
building images & OTA packages out of vendor/google.
No device code is touched by this change.
Original author: dougz
Merged from: //branches/cupcake/...
Automated import of CL 144270