Commit graph

2739 commits

Author SHA1 Message Date
Jeff Vander Stoep
7033819eeb Merge "Remove unused #include <selinux/android.h>" 2015-05-14 15:27:51 +00:00
Jeff Vander Stoep
80ae3084d0 Remove unused #include <selinux/android.h>
Change-Id: Iebc59784c7318edb1c1f686e040ed581259bdd5a
2015-05-13 14:24:04 -07:00
Tao Bao
2f7ae925a3 Merge "Add support for clobbered blocks" 2015-05-13 19:03:08 +00:00
Tao Bao
ff7778166b Add support for clobbered blocks
In ext4 filesystems, some blocks might be changed even being mounted
R/O, such as the superblock (block 0). We need to exclude such blocks
from integrity verification. Plus such blocks should always be
written to the target by copying instead of patching.

Bug: http://b/20939131
Change-Id: I991169ec307dfb231b2fe8908a0668595ecb2060
2015-05-13 11:19:39 -07:00
Baligh Uddin
852a5b531c Add bootsigner path as an option
Change-Id: I3d804b7937aafea8274b06edab097a6dca8f04cd
(cherry picked from commit e204868f1f)
2015-05-13 10:07:47 -07:00
Tao Bao
2ed665a033 Wrap zipfile.write(), writestr() and close()
In order to work around the zip 2GiB limit, we need to wrap the related
functions in zipfile. Calls to those functions should always be replaced
with calls to the wrappers instead.

Bug: 18015246
Change-Id: Ice494371ca6654e88ded2ae0eb680f51082effcb
2015-05-08 13:51:12 -07:00
Mohamad Ayyash
a990534e73 common.py: Add support for squashfs
Change-Id: Ia40f8c6307d0213d43207aee91c4c8a5b5ad6f1e
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-05-01 15:39:43 -07:00
Jeff Brown
9dc5808702 Add float support to binary event log.
Bug: 20664753
Change-Id: Iab232b1f172094919839d57f15644dfb2eaa1425
2015-04-28 18:21:09 -07:00
Sami Tolvanen
e09d096ed6 Check partition hash before resorting to block_image_verify
It's not necessary to call block_image_verify for the most common
case where we attempt an update for the first time and the target
partition has expected contents. It is sufficient to confirm that
the target partition is intact.

Computing a hash is much faster than simulating the update, which
means this change should make the update speed for v3 much closer
to v2 for the common case. If the update was interrupted, this is
going to make resuming somewhat slower, of course. Hopefully this
should be rather rare.

Bug: 20309033
Change-Id: I04792f3681bf2cd5d9a4e1c41eb883c7f26c6f58
2015-04-24 10:56:59 +00:00
Tao Bao
43078aa37a Add support for full radio option
Occasionally we need to include full radio image in incremental OTAs.
Adding --full_radio option to support that.

It needs matching changes in the releasetools.py in the target_files
zip, which comes from device/<vendor>/<device>/releasetools.py.

Bug: 19994922
Change-Id: Id1fb3a9cdb7e67dd9dbadd8fb6cd5fccd358820e
2015-04-21 16:54:52 -07:00
Sami Tolvanen
29f529f33e Calculate max_stashed_blocks correctly for block OTA v3
The updater automatically stashes overlapping source blocks to
make it possible to resume if the command performing the update
is interrupted. However, blockimgdiff.py does not take this into
account and therefore, max_stashed_blocks indicates only the
number of explicitly stashed blocks. Change blockimgdiff.py to
correctly calculate the maximum used stash space, including any
automatically stashed blocks.

Bug: 20309033
Change-Id: Ibf5cb1abc38c54e60a6ad3ce4cbce43556b08ac2
2015-04-17 16:28:08 +01:00
Glenn Kasten
1004eccb16 Merge "Fix bookmark title" 2015-04-16 23:12:50 +00:00
Glenn Kasten
1efbc8996e Fix bookmark title
Bug: 20299601
Change-Id: Ie57daf7b378cf370e34ff282d97fd36f2d74031a
2015-04-16 11:56:22 -07:00
Mark Salyzyn
6024069f37 build: fs_config_generate must open file in binary mode
Bug: 19908228
Change-Id: I2361b8af90b3729deb438e6a7a7179de12680b65
2015-04-16 08:43:33 -07:00
Mark Salyzyn
06b91b9bcf fs_config: Add fs_config_generate
fs_config_generate_$(TARGET_DEVICE) is built based off the content
of $(TARGET_ANDROID_FILESYSTEM_CONFIG_H). We also add the rules
fs_config_dirs and fs_config_file to utilize this command
for target contents:

fs_config_generate_$(TARGET_DEVICE) -D -o system/etc/fs_config_dir
fs_config_generate_$(TARGET_DEVICE) -F -o system/etc/fs_config_file

In order to use this feature, one must have the fs_config_dirs and
fs_config_files in the $(PRODUCT_PACKAGES) list defined in the
device make files in $(TARGET_DEVICE_DIR). And either an
android_filesystem_config.h file in that directory, or define a
path in TARGET_ANDROID_FILESYSTEM_CONFIG_H to point to one.

Bug: 19908228
Change-Id: Iee1543d99169f874e0915ae07962a7750ecb6342
2015-04-15 14:17:12 -07:00
Mark Salyzyn
073a9ebbbf fs_config: use libcutils and libselinux shared libraries
- move to libcutils.so and libselinux.so as shared now that
  they are in DISTTOOL.
- liblog dependency is part of libcutils, and need not be
  called out explicitly now. liblog is in DISTTOOL.
- libcutils fs_config has the right to add Android logging

Bug: 19908228
Change-Id: Iaa60ad624b42d83653840ac3c77bfa03ad8674aa
2015-04-15 14:17:07 -07:00
Tao Bao
6c55a8adc8 Dump fingerprints into recovery log
No more guessing. We should have the info for OTA issues diagnosis.

Change-Id: I0ce919434444ab16a38cc7af818e64785509b0fb
2015-04-09 17:36:05 -07:00
Mark Salyzyn
27ac7a9c1a fs_get_stats: add logging
libcutils fs_config has the right to add Android logging

Bug: 19908228
Change-Id: I75d472ed142e32959cec78bf7babbf39d2b66cd2
2015-04-07 09:19:27 -07:00
Mark Salyzyn
5f478fe3c5 fs_config: add logging
libcutils fs_config has the right to add Android logging

Bug: 19908228
Change-Id: I6d68107156962a6fec357ab99d23960c6852b026
2015-04-07 09:18:30 -07:00
Mark Salyzyn
1c5f19eabe fs_config: move fs_config to libcutils
Bug: 19908228
Change-Id: I4103ac395d0a28fd13173cc703e980aafe6c02e1
2015-04-02 13:56:00 -07:00
Mark Salyzyn
8efa6d3f0d fs_get_stats: move fs_config to libcutils
Bug: 19908228
Change-Id: I668bf8e11b09ccc9c298382e54208f531844b0c5
2015-04-02 13:55:44 -07:00
Mohamad Ayyash
6ddc360065 Merge "build_image.py: Verity support for flashing non partition spanning fs" 2015-04-02 18:18:21 +00:00
Tao Bao
d95e9fd267 Add support to sign bootable images with vboot_signer
Add vboot properties to the dictionary file, which will be packed into
the target_files zip. Add support in packaging and OTA scripts to
sign the generated bootable images (boot.img and recovery.img) when
vboot is enabled.

Change-Id: I08758ced03d173219415bca762bbdb66c464a9f5
(cherry picked from commit 5d5a3bd9e8d8b14b71d1b2105417a2958d13d3d2)
2015-04-01 09:23:08 -07:00
Mohamad Ayyash
dd063528ed build_image.py: Verity support for flashing non partition spanning fs
Change-Id: Ic5f7b256ed9a31e99ebaebdf8a8a19ba9adcced3
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-04-01 00:50:39 +00:00
Dan Albert
ebb19aa01a Fix up a few callers of GetTypeAndDevice.
Change-Id: I8f2d8d28b60715f917e9aceb8f851ad652034aa7
2015-03-27 19:11:53 -07:00
Dan Albert
99e22a57d0 Merge "Make releasetools pylint clean." 2015-03-27 18:40:02 +00:00
Ying Wang
a2292c94d1 Support to build image of root file system with /system and ramdisk combined.
Added support to build system.img that combines contents of /system and
the ramdisk, and can be mounted at the root of the file system.
To enable this feature, define BoardConfig.mk variable:
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

Ideally we would just change TARGET_OUT (the path of the staging system
directory) to under TARGET_ROOT_OUT. But at this point many places in
the build system assume TARGET_OUT is independent of TARGET_ROOT_OUT and
we can't make it easily configurable.
Instead this implementation takes the least intrusive approach:
We don't change TARGET_OUT or TARGET_ROOT_OUT. We just assemble a
temporary staging directory that contains contents of both TARGET_OUT
and TARGET_ROOT_OUT, in build_image.BuildImage() of
tools/releasetools/build_image.py.
When build_image.py is directly called from the makefile, we pass in the
parameters from the global dictionary; when build_image.BuildImage() is
called from add_img_to_target_files.py, we need to override values to
point to files extracted from the target_files zip file.
We need to combine the fs_config files of both /system and ramdisk,
when fs_config is enabled.

Also this change refactored build_image.BuildImage() by moving the extra
parameters to the image property dictionary.

(cherry-picked from commit 0eabd4f2c5)

Bug:19868522
Change-Id: Iafc467a0e3427b0d6ad3b575abcc98ddcc9ea0f1
2015-03-26 10:35:00 -07:00
Dan Albert
8b72aefb5a Make releasetools pylint clean.
This caught a few bugs/syntax errors (a few character classes were not
escaped properly in regex patterns, some indentation was illegal,
etc).

Change-Id: I50637607524e68c4fb9cad7167f58a46b8d26b2c
2015-03-24 11:05:16 -07:00
Dan Albert
5d60719e42 Merge "Run ZipFile.testzip() during zipfile tests." 2015-03-24 00:07:02 +00:00
Dan Albert
d6d1beb88c Run ZipFile.testzip() during zipfile tests.
This still doesn't catch the issue that [1] fixes, but it's probably a
good idea anyway.

[1]: https://android-review.googlesource.com/#/c/143469/

Change-Id: Iaa607ec7450d605b26114bd81ea41a14c6613c0e
2015-03-23 16:54:39 -07:00
Tao Bao
eaf885b1d0 Fix the computation of basefilename
Change-Id: I156b182414ef5b33611955cbc019e208c771013a
2015-03-23 16:05:26 -07:00
Greg Hackmann
6701db8145 Allow system images larger than 2GiB, pt. 2
We need to patch zipfile during close() too, because it refers to the
ZIP64 file size threshold when writing out the central directory

Bug: 18015246
Bug: 19888174

Change-Id: I1b49d653d0831fcc2106808f86c929d7a2b22ff3
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-03-23 14:35:50 -07:00
Tao Bao
3910ebf468 Fix the syntax error in the edify script generator
file_getprop() always expects two arguments.

Bug: 19881931
Change-Id: Icf5577ad34188991c03f68c1217642d3adc4201c
2015-03-22 14:20:48 -07:00
Tao Bao
b8c8717191 Make the generated OTAs repeatable
The generated OTAs are supposed to be repeatable. The use of dict in
blockimgdiff.py breaks the assumption for block-based OTAs. Fixed by
using OrderedDict instead.

Change-Id: I945bdc879912ba174ca330c152b1f8fc7ed211ac
2015-03-19 19:42:12 -07:00
Dan Albert
8e0178d41b Allow system images larger than 2GiB.
Python 2.7's zipfile implementation wrongly thinks that zip64 is
required for files larger than 2GiB. We can work around this by
adjusting their limit. Note that `zipfile.writestr()` will not work
for strings larger than 2GiB. The Python interpreter sometimes rejects
strings that large (though it isn't clear to me exactly what
circumstances cause this). `zipfile.write()` must be used directly to
work around this.

This mess can be avoided if we port to python3.

The bug (b/19364241) in original commit has been fixed.

Bug: 18015246
Bug: 19364241
Bug: 19839468

(cherry picked from commit cd082d4bfe)

Change-Id: I7b5cc310e0a9ba894533b53cb998afd5ce96d8c6
2015-03-19 13:59:01 -07:00
Tao Bao
dd2a5892e5 Restrict the verification in block-based incremental OTAs
BlockImageDiff has three versions. Only the incremental OTAs generated
with the latest version (3) can be re-applied to the system that's
already on the target build. Otherwise, operations like move will make
unconditional changes and damage the system. During the verification
phase, abort the OTA update if BlockImageDiff is less than 3 and it
doesn't match the checksum of the source build.

Change-Id: Ic630346eab2a993a84d0aeaacd7167ef62cc24f6
(cherry picked from commit daebaa6ed3)
2015-03-13 17:57:15 -07:00
Michael Runge
910b005f18 Do not use block_verify on target-files where feature is missing.
This will only be used when the block file format is at least
version 3.  For V1/V2 (L, L MR1) block versions, fall back to
the old range_sha1 check.

Bug: 19357591
Change-Id: I7cb178b70d48ec3c98cdb88ed1c94cf7797a01d0
(cherry picked from commit cad78c12fb)
2015-03-13 11:36:14 -07:00
Jesse Zhao
7b985f6aed Fix the error that free_string is not defined.
Change-Id: I7490a91ea930daaf194dad0c8b3a3357558b4770
Bug:19573713
(cherry picked from commit 7ca20d1a1c)
2015-03-11 17:22:43 +00:00
Sami Tolvanen
dd67a295cc Change transfer list format to include block hashes
Add source and target block hashes as parameters to transfer list
commands that copy or patch data to a partition. This allows the
updater to verify the status of each command in the transfer list
and makes resuming block based OTAs possible. Due to the changes,
update the transfer list version to 3.

Needs matching changes from
  I1e752464134aeb2d396946348e6041acabe13942

Bug: 18262110
Change-Id: Ia5c56379f570047f10f0aa7373a1025439495c98
(cherry picked from commit cac671a9d1)
2015-03-11 17:22:06 +00:00
Ying Wang
fafe5ac819 Merge "Signapk.java: hide the password" 2015-03-11 16:46:00 +00:00
Mohamad Ayyash
9b19382f0e resolved conflicts for merge of fc759204 to stage-aosp-master
Change-Id: Icf58e881286a66cb3ca4cb122fa8c11ec217fbab
2015-03-04 15:43:45 -08:00
Mohamad Ayyash
b97746ef09 Allow flashing a squashfs system image
Change-Id: Ic51d11274784a8d2e9d57d5f0b821ebc89680e5a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-03-03 18:54:50 -08:00
Narayan Kamath
2479a0987d am 30b5ed7b: Merge "Fix zipalign README file and usage strings."
* commit '30b5ed7b1e8c67c816d64ad1b7c9bde3c3b5019c':
  Fix zipalign README file and usage strings.
2015-02-27 17:26:49 +00:00
Narayan Kamath
e0b8d19f31 Fix zipalign README file and usage strings.
Addresses comments from change 13e5965306.

Change-Id: I0a2c0048781858d3aa06347a77220547cfcdcebe
2015-02-27 14:17:17 +00:00
Narayan Kamath
e886392c37 am 37a44faa: Merge "Store native libs aligned to PAGE_SIZE"
* commit '37a44faa7266c8a7e0cc5077a4c028d6f5bfa7f7':
  Store native libs aligned to PAGE_SIZE
2015-02-26 12:45:34 +00:00
Dmitriy Ivanov
13e5965306 Store native libs aligned to PAGE_SIZE
- Add a new flag to zipalign (-p) that page aligns shared
  libraries (zip entries ending with ".so") in the archive.

- Add a new build variable LOCAL_PAGE_ALIGN_SHARED_LIBRARIES
  to turn on this behaviour in zipalign.

- Add a new LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS to control
  zip behaviour.

Bug: 8076853
Bug: 19330157

Co-Authored-By: Simon Baldwin <simonb@google.com>
Co-Authored-By: Dimitry Ivanov <dimitry@google.com>
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-02-26 12:31:40 +00:00
Justin Harrison
b89ec38113 am 070eea05: am ffd4fee9: Merge "Revert "Allow system images larger than 2GiB."" into lmp-mr1-dev
* commit '070eea05f2f2d47aa873fd1e79160eb8529a0eb8':
  Revert "Allow system images larger than 2GiB."
2015-02-13 20:37:10 +00:00
Justin Harrison
ffd4fee911 Merge "Revert "Allow system images larger than 2GiB."" into lmp-mr1-dev 2015-02-13 18:48:17 +00:00
Justin Harrison
2de68bbbf4 Revert "Allow system images larger than 2GiB."
This reverts commit cd082d4bfe.

Change-Id: Ie63e1ba70d907d2849164871bc7ec71c245f7af9
2015-02-13 18:47:51 +00:00
smain@google.com
1cd422cd3d am 19b8c2f7: am 8cde3e71: am cf80e847: am d162be5b: change video analytics to distinguish between start and resume events. also scrub out any additional parameters from the videoId before passing to analytics
* commit '19b8c2f776036288dfad8983e38419c3d4316fc9':
  change video analytics to distinguish between start and resume events. also scrub out any additional parameters from the videoId before passing to analytics
2015-02-10 23:21:02 +00:00