Commit graph

551 commits

Author SHA1 Message Date
Tao Bao
2a410587e8 Fix the permission in common.ZipWriteStr().
common.ZipWriteStr() should set a default file permission to 0o100644
instead of 0o644.

Change-Id: I8c89d8442b095b56ad3a0d47afdfa73ce55ad0c8
2015-07-10 17:45:09 -07:00
Tao Bao
e7a4b429d2 am 03125de6: am c8812493: Merge "Pack file_contexts into target_files zip."
* commit '03125de6b57fc358e14cbcd1798cdf9d3289b72f':
  Pack file_contexts into target_files zip.
2015-07-10 21:56:02 +00:00
Tao Bao
2c15d9eefe Pack file_contexts into target_files zip.
file_contexts (specified by SELINUX_FC) is needed both when building
and (re)packaging. We used to use the copy in out/ when building, and
looked for the copy in BOOT/RAMDISK/ when packaging from target_files
zip. With system_root_image enabled, the file_contexts needed for
building and packaging might be different from the one on device. So
we explicitly pack the file as META/file_contexts in target_files zip.

Also refactor out the overriding of selinux_fc property into
common.LoadInfoDict().

Change-Id: I94f9ea6671b3792c12c1c21573840743d63da39a
(cherry picked from commit aa7318c384)
2015-07-10 14:21:16 -07:00
Tao Bao
89832b36af am 7f8ecb7f: Merge "Zero out blocks that may be touched by dm-verity." into mnc-dev
* commit '7f8ecb7f5c21630a75c69d170ba2b401d7a311a5':
  Zero out blocks that may be touched by dm-verity.
2015-07-10 20:55:39 +00:00
Tao Bao
e9b619108d Zero out blocks that may be touched by dm-verity.
dm-verity may touch some blocks that are not in the care_map due to
block device read-ahead. It will fail if such blocks contain
non-zeroes. As a workaround, we mark them as extended blocks and
zero out explicitly to avoid dm-verity failures.

Bug: 20881595
Change-Id: Id097138bfd065c84eac088b3ad49758010b2927b
(cherry picked from commit 2fd2c9bfd6)
2015-07-10 13:50:24 -07:00
Tao Bao
7f8ecb7f5c Merge "Zero out blocks that may be touched by dm-verity." into mnc-dev 2015-07-10 20:44:25 +00:00
Tao Bao
2fd2c9bfd6 Zero out blocks that may be touched by dm-verity.
dm-verity may touch some blocks that are not in the care_map due to
block device read-ahead. It will fail if such blocks contain
non-zeroes. As a workaround, we mark them as extended blocks and
zero out explicitly to avoid dm-verity failures.

Bug: 20881595
Change-Id: I54e24e70ad822c0d6d7af43301f74d24505f4461
2015-07-10 12:16:56 -07:00
Thierry Strudel
f4e503774e am 74a81e66: fix device specific fs_config on build server
* commit '74a81e6633276d92337749a5ee9d921207814dd4':
  fix device specific fs_config on build server
2015-07-10 18:44:53 +00:00
Thierry Strudel
74a81e6633 fix device specific fs_config on build server
fs_config function from libcutils, in order to properly set the xattr FS
used to define device specific uid, gid, permissions and capabilities,
now needs TARGET_OUT make variable to be passed explicitly to all tools
using it:
  fs_config
  fs_get_stats used by mktarball.sh
  make_ext4fs used by mkuserimg.sh
  mksquashfs used by mksquashfsimage.sh

Bug: 21989305
Bug: 22048934
Change-Id: I6caf9cf870882fce2ead93027767092c29b75ded
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-07-10 10:55:54 -07:00
Tao Bao
d94525ca52 am 74008203: am e246964b: Merge "Scan all init.*.rc files for flash_recovery service."
* commit '7400820330b39bc5d044c6f9c46d06a7650c83f1':
  Scan all init.*.rc files for flash_recovery service.
2015-07-08 17:51:34 +00:00
Tao Bao
e246964b8f Merge "Scan all init.*.rc files for flash_recovery service." 2015-07-08 17:22:36 +00:00
Tao Bao
9f0c8dfaf1 Scan all init.*.rc files for flash_recovery service.
Clockwork builds may rename init.rc to init.core.rc. Change the OTA
script to scan all init.*.rc files to determine the proper location for
install-recovery.sh.

Bug: 22128990
Change-Id: Icad3497d1663e074b938919b40fc239c84fbeb2b
(cherry picked from commit 610754e5ad)
2015-07-08 10:20:39 -07:00
Simon Wilson
011ea06db7 Add compressor options for squashfs system images
Change-Id: I2a75f8754273f6e00b96ba6aca6741c4388f5da8
(cherry picked from commit f86e7eeabc)
2015-07-07 11:41:20 -07:00
Tao Bao
e9c462b00a am 1747e35a: am a0021026: Merge "fix up ota_from_target_files symlink detection."
* commit '1747e35a090cff66b117128c7bffd2e8b5050f37':
  fix up ota_from_target_files symlink detection.
2015-07-07 17:18:59 +00:00
Ying Wang
2ffb3147bc fix up ota_from_target_files symlink detection.
Change-Id: I10b668096d4e61e75473dd805f96387049f29b79
2015-07-06 14:02:01 -07:00
Tao Bao
c607474ec2 am 11d4406e: am 48a27bcb: Merge "Fix OTA scripts to generate incremental BBOTA with OEM property."
* commit '11d4406eb9796819baeafda3142b16f9cc63d532':
  Fix OTA scripts to generate incremental BBOTA with OEM property.
2015-07-06 16:49:18 +00:00
Tao Bao
3806c231a9 Fix OTA scripts to generate incremental BBOTA with OEM property.
Bug: 21803136
Change-Id: I3a45e8aea0b4f4f4f2acb4c9c8a7fad7a014680c
2015-07-05 21:08:33 -07:00
Tao Bao
8bd720257e resolved conflicts for merge of 8787cd6d to mnc-dev
Change-Id: I19497d05a021c21c905b2bddd5b36d370dc2208f
2015-07-01 18:06:33 -07:00
Tao Bao
8787cd6d4e resolved conflicts for merge of 7f9470cd to lmp-mr1-ub-dev
Change-Id: Icfc94fcc4178f5fbfad62df9914c84d59d140bb7
2015-07-01 17:44:53 -07:00
Tao Bao
7f9470cda3 sparse_img.py: Don't write empty map groups.
In certain cases, we may have no mapping of ZERO or NONZERO blocks in
the image (such as squashfs at the moment). Don't write those groups if
they are empty.

Change-Id: I82aa05fbbd79130b08868585edd5298e531c4f5a
2015-07-01 10:10:31 -07:00
Tao Bao
4e66343b2b Retry adjusting the size computation for reserved blocks.
Due to the change in https://lwn.net/Articles/546473/, kernel reserves a
few extra blocks (lesser of 2% and 4096 blocks) on ext4 FS which leads to
OTA update failures. Adjust the size computation if the device has
BOARD_HAS_EXT4_RESERVED_BLOCKS := true.

It amends the last attemp in [1]. Now it computes the used blocks from the
make_ext4fs output, instead of altering its argument.

[1]: commit efbb5d2e69.

Bug: 21522719
Bug: 22023465
Bug: 22174684
Change-Id: Iaae6507f6de68a5892f2e3035d330039287b4492
(cherry picked from commit c7a6f1e4f8)
2015-06-30 12:17:28 -07:00
Tao Bao
ed95997724 resolved conflicts for merge of c7a6f1e4 to mnc-dev-plus-aosp
Change-Id: I3201c1d7f9e8b451614259c2fec70c07ae9c8332
2015-06-30 09:33:12 -07:00
Tao Bao
c7a6f1e4f8 Retry adjusting the size computation for reserved blocks.
Due to the change in https://lwn.net/Articles/546473/, kernel reserves a
few extra blocks (lesser of 2% and 4096 blocks) on ext4 FS which leads to
OTA update failures. Adjust the size computation if the device has
BOARD_HAS_EXT4_RESERVED_BLOCKS := true.

It amends the last attemp in [1]. Now it computes the used blocks from the
make_ext4fs output, instead of altering its argument.

[1]: commit efbb5d2e69.

Bug: 21522719
Bug: 22023465
Bug: 22174684
Change-Id: I9783a51abe6581ff5c75db81e78ac606d0f32c4c
2015-06-29 20:45:53 -07:00
Tao Bao
bdf7d94aac am 2384d01c: Revert "Adjust the size computation for reserved blocks"
* commit '2384d01c1c4c5b259840ec526ec8f5ec18cd8087':
  Revert "Adjust the size computation for reserved blocks"
2015-06-29 20:56:34 +00:00
Tao Bao
2384d01c1c Revert "Adjust the size computation for reserved blocks"
We should not change the parameter to mkfs_ext4. Bug filed at
b/22174684. Will come up with a new CL.

This reverts commit efbb5d2e69.

Change-Id: I15f7a9a07a65a936ba186d2ce672ec4832ed3e17
2015-06-29 12:55:38 -07:00
Tao Bao
929fbe7d37 am 0f0af20d: am 5df6b5c3: Merge "sparse_img.py: Don\'t write empty map groups."
* commit '0f0af20d6d4fa7d75f7dd8569f713e68eb0cad46':
  sparse_img.py: Don't write empty map groups.
2015-06-27 16:58:36 +00:00
Tao Bao
a89781204e sparse_img.py: Don't write empty map groups.
In certain cases, we may have no mapping of ZERO or NONZERO blocks in
the image (such as squashfs at the moment). Don't write those groups if
they are empty.

Change-Id: I82aa05fbbd79130b08868585edd5298e531c4f5a
2015-06-27 09:21:31 -07:00
Tao Bao
c94a705f44 Merge "Use fstab in the source build" 2015-06-26 22:57:09 +00:00
Tao Bao
dd77b561e5 Merge "Support SELinux context label when mounting" 2015-06-26 22:56:57 +00:00
Tao Bao
34b47bf42b Use fstab in the source build
When generating incremental OTAs, we should use the fstab in the source
build instead of the target one. Similarly for recovery_mount_options.

Bug: 22011892
Change-Id: Ia02584c71af7d47835b1f62e7daa46f27940a545
(cherry picked from commit bebd3cfbf9)
2015-06-26 15:53:16 -07:00
Ying Wang
f6bb95b7a9 am 48f68478: am 8f180b90: Merge "Create userdata.img with real data when SANITIZE_TARGET=address."
* commit '48f68478bd2a375886f30c01b63920575739d9db':
  Create userdata.img with real data when SANITIZE_TARGET=address.
2015-06-25 21:54:52 +00:00
Ying Wang
8f180b904f Merge "Create userdata.img with real data when SANITIZE_TARGET=address." 2015-06-25 21:29:52 +00:00
Ying Wang
2a04839aec Create userdata.img with real data when SANITIZE_TARGET=address.
Bug: 21785137
Change-Id: Ie0c36988759fe07419ad29bab5a71cdd0d992d2a
2015-06-25 14:29:04 -07:00
Mohamad Ayyash
99811e45d0 am 07a7590f: Merge "build_image.py: Make sparse squashfs images" into mnc-dev
* commit '07a7590f087e4ce7783e0907c9e5c84e18a6481e':
  build_image.py: Make sparse squashfs images
2015-06-24 23:42:30 +00:00
Simon Wilson
5e14d57658 am b7b7aede: Merge "resolved conflicts for merge of ecfc97f7 to mnc-dev" into mnc-dev
* commit 'b7b7aedeb3c960890e3842ec8e729dbd10077ae4':
  Add compressor options for squashfs system images
2015-06-24 23:42:29 +00:00
Mohamad Ayyash
07a7590f08 Merge "build_image.py: Make sparse squashfs images" into mnc-dev 2015-06-24 23:15:56 +00:00
Simon Wilson
6d5ddc32ab resolved conflicts for merge of ecfc97f7 to mnc-dev
Change-Id: Ic7661c4176dc87cb2796f9cbb61bdd64f89cdc01
2015-06-24 16:06:34 -07:00
Mohamad Ayyash
48cb24a655 am 648e40e8: build_image.py: Make sparse squashfs images
* commit '648e40e8660135f37adad5981a48250476c2f3fd':
  build_image.py: Make sparse squashfs images
2015-06-24 22:52:10 +00:00
Simon Wilson
ecfc97f772 resolved conflicts for merge of f86e7eea to lmp-mr1-ub-dev
Change-Id: I746021aa57edd5f6fae6e57cec0908951a659664
2015-06-24 15:42:27 -07:00
Mohamad Ayyash
9ca7fa8993 resolved conflicts for merge of 1b748051 to lmp-mr1-ub-dev 2015-06-24 15:04:38 -07:00
Mohamad Ayyash
042e851999 Merge "build_image.py: Make sparse squashfs images" 2015-06-24 22:01:00 +00:00
Mohamad Ayyash
2cd51cc711 build_image.py: Make sparse squashfs images
Change-Id: Iea0399868a9406f9929d8176d61d5698a2043697
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-24 11:08:00 -07:00
Mohamad Ayyash
648e40e866 build_image.py: Make sparse squashfs images
Change-Id: Iea0399868a9406f9929d8176d61d5698a2043697
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-24 10:54:16 -07:00
Mohamad Ayyash
fa6c8a9b79 build_image.py: Make sparse squashfs images
Change-Id: Iea0399868a9406f9929d8176d61d5698a2043697
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-24 10:44:52 -07:00
Tao Bao
344af6d18c am 7102f577: Merge "Adjust the size computation for reserved blocks" into mnc-dev
* commit '7102f57781a8cde2e450951af3cbd7e60b44dca1':
  Adjust the size computation for reserved blocks
2015-06-24 02:13:40 +00:00
Tao Bao
8adebf62f8 am ca8fb0f2: am c9fcdae2: Merge "Fix the error in sparse_img.py"
* commit 'ca8fb0f21f3b4b91d60e0678b512f59167d79fda':
  Fix the error in sparse_img.py
2015-06-24 02:01:11 +00:00
Tao Bao
7102f57781 Merge "Adjust the size computation for reserved blocks" into mnc-dev 2015-06-24 00:53:17 +00:00
Tao Bao
109555753f Fix the error in sparse_img.py
Bug: 22046423
Change-Id: I0796e14df2b523570f0c485d146273f5e5aa5494
(cherry picked from commit 2b4ff174ff)
2015-06-23 17:44:48 -07:00
Tao Bao
2b4ff174ff Fix the error in sparse_img.py
Bug: 22046423
Change-Id: I9c257002c405277557974fadfe27942c38c3cd04
2015-06-23 17:36:10 -07:00
Tao Bao
efbb5d2e69 Adjust the size computation for reserved blocks
Due to the change in https://lwn.net/Articles/546473/, kernel reserves a
few extra blocks (lesser of 2% and 4096 blocks) on ext4 FS which leads to
OTA update failures. Adjust the size computation if the device has
BOARD_HAS_EXT4_RESERVED_BLOCKS := true.

Bug: 21522719
Bug: 22023465
Change-Id: I49f16adbf2dedc5279fbb8622bf99ef71dcc494f
2015-06-23 14:53:28 -07:00
Tao Bao
44dbba98b8 am bebd3cfb: Use fstab in the source build
* commit 'bebd3cfbf934beb18b73a4d4e98b98c2c0a1d6fe':
  Use fstab in the source build
2015-06-23 20:46:04 +00:00
Tao Bao
bebd3cfbf9 Use fstab in the source build
When generating incremental OTAs, we should use the fstab in the source
build instead of the target one. Similarly for recovery_mount_options.

Bug: 22011892
Change-Id: Idb5c72d1a792e8bb40376a380e3dc06136b13652
2015-06-22 19:27:59 -07:00
Simon Wilson
f86e7eeabc Add compressor options for squashfs system images
Change-Id: I2a75f8754273f6e00b96ba6aca6741c4388f5da8
2015-06-22 15:42:52 -07:00
Mohamad Ayyash
1b748051dd common.py: Add support for squashfs
Change-Id: Ia40f8c6307d0213d43207aee91c4c8a5b5ad6f1e
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-16 13:18:44 -07:00
Mohamad Ayyash
cade49ddee Allow flashing a squashfs system image
Change-Id: Ic51d11274784a8d2e9d57d5f0b821ebc89680e5a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-16 13:11:21 -07:00
Tao Bao
05451045c9 am abfe1044: Merge "Support SELinux context label when mounting" into mnc-dev
* commit 'abfe10440836f4bbd513b83cf731788099dd81b4':
  Support SELinux context label when mounting
2015-06-11 02:08:14 +00:00
Tao Bao
df06e96826 Support SELinux context label when mounting
If there is a SELinux context label in the recovery.fstab, we should
honor that when mounting the partition.

Bug: 19764039
Change-Id: Ic80a3377a5a94c9d10dd464eb1257b157a947510
(cherry picked from commit 548eb76c8f)
2015-06-10 16:20:18 -07:00
Tao Bao
548eb76c8f Support SELinux context label when mounting
If there is a SELinux context label in the recovery.fstab, we should
honor that when mounting the partition.

Bug: 19764039
Change-Id: I4df71a092b418cd340a18b2e3b0936de33d8e3f5
2015-06-10 15:35:34 -07:00
Baligh Uddin
d80f08688c am 942a42e3: Merge "Allow custom boot_signer and verity_signer." into mnc-dev
* commit '942a42e31de9a0468014a256ed7fdd67cb208e64':
  Allow custom boot_signer and verity_signer.
2015-06-09 23:28:07 +00:00
Baligh Uddin
601ddeae06 Allow custom boot_signer and verity_signer.
Bug: 21701163
Change-Id: I85e75fd3a166a9f6a7859ebf81dee73322dc2798
2015-06-09 15:48:14 -07:00
Tao Bao
b7998ec0d5 am 726b7f33: Fix the broken signing script
* commit '726b7f338f32ca6d18e9961b0a2da3ef385f7e34':
  Fix the broken signing script
2015-06-04 01:34:06 +00:00
Tao Bao
726b7f338f Fix the broken signing script
check_target_files_signatures.py was accidentally broken due to the
renaming of a variable in last commit. It escaped the checking from
pylint because it was a keyword ('all').

Bug: 21611858
Change-Id: I58c983e59c4a3e0018481d3c9ba328ed76f5c08a
2015-06-03 17:36:12 -07:00
Tao Bao
7cebca42e3 am 1ef34d34: am 54310d1a: Merge "Fix the wrong error message"
* commit '1ef34d3440db524d6ea2e0a6d4e72b668765d293':
  Fix the wrong error message
2015-06-03 18:36:17 +00:00
Ying Wang
4540a85dd4 Support to configure and build multiple custom images.
Build additional images requested by the product makefile.
This script gives the ability to build multiple additional images and
you can configure what modules/files to include in each image.
1. Define PRODUCT_CUSTOM_IMAGE_MAKEFILES in your product makefile.
   PRODUCT_CUSTOM_IMAGE_MAKEFILES is a list of makefiles.
   Each makefile configures an image.
   For image configuration makefile foo/bar/xyz.mk, the built image
   file name
   will be xyz.img. So make sure they won't conflict.
2. In each image's configuration makefile, you can define variables:
  - CUSTOM_IMAGE_MOUNT_POINT, the mount point, such as "oem", "odm"
    etc.
  - CUSTOM_IMAGE_PARTITION_SIZE
  - CUSTOM_IMAGE_FILE_SYSTEM_TYPE
  - CUSTOM_IMAGE_DICT_FILE, a text file defining a dictionary
    accepted by BuildImage() in tools/releasetools/build_image.py.
  - CUSTOM_IMAGE_MODULES, a list of module names you want to include
    in the image; Not only the module itself will be installed to proper
    path in the image, you can also piggyback additional files/directories
    with the module's LOCAL_PICKUP_FILES.
  - CUSTOM_IMAGE_COPY_FILES, a list of "<src>:<dest>" to be copied to
    the image. <dest> is relativ to the root of the image.

To build all those images, run "make custom_images".

Bug: 19609718
Change-Id: Ic73587e08503a251be27797c7b00329716051927
(cherry picked from commit 5fcf1094f9)
2015-06-03 09:56:29 -07:00
Tao Bao
e7b103751c Fix the wrong error message
apply_patch_space() checks the free space on /cache, not /system.

Change-Id: I70996d5cd5a81fe4871ee738bddb1437e8df6fb9
2015-06-03 09:25:10 -07:00
Tao Bao
87742421b2 am 2e30a5e8: am 708c4623: Merge "Add post-install verification for BBOTAs"
* commit '2e30a5e853a584b11db65c0703aff93c7f7870f8':
  Add post-install verification for BBOTAs
2015-06-02 18:28:30 +00:00
Tao Bao
5fcaaeffc3 Add post-install verification for BBOTAs
Similar to the assertations in file-based OTA, we perform verification
for block-based OTAs (BBOTAs) after updating a partition, for both of
the incremental and full OTAs. It increases the update time (~20s on
Nexus 6), but will capture unnoticed errors right away.

Bug: 21500869
Change-Id: I0f8b27734caaa0f41f9c1b904d55af2112784a68
(cherry picked from commit 68658c0f4f)
2015-06-02 11:15:33 -07:00
Tao Bao
68658c0f4f Add post-install verification for BBOTAs
Similar to the assertations in file-based OTA, we perform verification
for block-based OTAs (BBOTAs) after updating a partition, for both of
the incremental and full OTAs. It increases the update time (~20s on
Nexus 6), but will capture unnoticed errors right away.

Bug: 21500869
Change-Id: I89ac8fe623b855721b7affd07cf9426a23433ab0
2015-06-01 15:00:30 -07:00
Brian Carlstrom
663127d0ca Use zipalign -p to page align .so files
Bug: 21400810
Change-Id: Ie3adf26dd3a51acfdb0faa23dc8ca1b206fb3727
(cherry picked from commit 903186f938)
2015-05-26 15:16:36 -07:00
Brian Carlstrom
903186f938 Use zipalign -p to page align .so files
Bug: 21400810
Change-Id: Ie9a0ec0a55511383596016e830b474c76754277a
2015-05-22 15:51:19 -07:00
Tao Bao
58c1b96165 Fix the permission setting in common.ZipWriteStr()
When passing a ZipInfo instance to common.ZipWriteStr(), the
external_attr attribute should not be overwritten unless specified.
We didn't have the issue previously because we were calling
ZipFile.writestr() directly until [1] merged.

[1] commit 2ed665a033.

Bug: http://b/21309935
Change-Id: I8c0190362c60d7d78965ecfe5e484f8398ddc5f2
(cherry picked from commit 9773465409)
2015-05-20 13:29:03 -07:00
Tao Bao
9773465409 Fix the permission setting in common.ZipWriteStr()
When passing a ZipInfo instance to common.ZipWriteStr(), the
external_attr attribute should not be overwritten unless specified.
We didn't have the issue previously because we were calling
ZipFile.writestr() directly until [1] merged.

[1] commit 2ed665a033.

Bug: http://b/21309935
Change-Id: I374ccd40c174ff9259844f38bdbf187dfe82552d
2015-05-20 12:18:55 -07:00
Tao Bao
5ece99d64e 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: I657025b7b1ad50d4365e7b18dc39308facfe864e
(cherry picked from commit ff7778166b)
2015-05-13 12:26: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
f3282b4a7f 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: I499574cee51ec4804bc10cbefe0b17940afed918
(cherry picked from commit 2ed665a033)
2015-05-08 15:53:27 -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
95e74c1424 common.py: Add support for squashfs
Change-Id: Ia40f8c6307d0213d43207aee91c4c8a5b5ad6f1e
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-05-01 15:58:42 -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
Sami Tolvanen
3edeb4e97b am 045d817c: am 497b74d5: am d21d1d27: am 00e1f003: Merge "Check partition hash before resorting to block_image_verify"
* commit '045d817cce8cb1feb0186b537306cabf1a5069cd':
  Check partition hash before resorting to block_image_verify
2015-04-25 10:01:53 +00:00
Sami Tolvanen
497b74d5a2 am d21d1d27: am 00e1f003: Merge "Check partition hash before resorting to block_image_verify"
* commit 'd21d1d273b83e701667beeabe0c76fd6888e15fc':
  Check partition hash before resorting to block_image_verify
2015-04-25 09:32:33 +00: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
1699a90b21 am b93b9ec4: am d8c62ae5: am 347d8e66: am 7f47c133: Merge "Add support for full radio option"
* commit 'b93b9ec42d008a5478018d8055791e1d1449fa36':
  Add support for full radio option
2015-04-22 22:18:52 +00:00
Tao Bao
d8c62ae577 am 347d8e66: am 7f47c133: Merge "Add support for full radio option"
* commit '347d8e66228ab09af1ec458632cb51c20a818e06':
  Add support for full radio option
2015-04-22 18:55:14 +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
8f9f7c0672 am c4d303e9: am 7788547f: am 586b38cc: Merge "Calculate max_stashed_blocks correctly for block OTA v3"
* commit 'c4d303e958e1f3475fd1070bdb307b4f675f3bdd':
  Calculate max_stashed_blocks correctly for block OTA v3
2015-04-17 19:30:23 +00:00
Sami Tolvanen
c4d303e958 am 7788547f: am 586b38cc: Merge "Calculate max_stashed_blocks correctly for block OTA v3"
* commit '7788547ff34d93b5196933eedb9f006fb1fe9f4d':
  Calculate max_stashed_blocks correctly for block OTA v3
2015-04-17 19:09:02 +00: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
Sami Tolvanen
e18196095b Merge "Separate boot and recovery image signing from dm-verity" 2015-04-10 09:44:47 +00:00
Tao Bao
915e47aad5 am 948f67b0: am d0ca0549: am 8c76d1e0: Merge "Dump fingerprints into recovery log"
* commit '948f67b0e7b3863488fd4a12a6797311d4c30508':
  Dump fingerprints into recovery log
2015-04-10 04:35:11 +00:00
Tao Bao
948f67b0e7 am d0ca0549: am 8c76d1e0: Merge "Dump fingerprints into recovery log"
* commit 'd0ca05493bfe06cf166e4e215cd9bf38936fb344':
  Dump fingerprints into recovery log
2015-04-10 02:23:31 +00: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
Sami Tolvanen
8b3f08bc7b Separate boot and recovery image signing from dm-verity
Allow dm-verity to be enabled without boot and recovery images being
signed. This makes it possible to enable only dm-verity to detect
corruption without confusing bootloaders that do not understand signed
images.

Bug: 19985143
Change-Id: Ie52c6ff595faa7a5c1f1bc1b37f6899c4d0c7001
2015-04-08 12:30:16 +01:00
Mohamad Ayyash
31bca0bea9 am e71b5560: am 347195da: am 6ddc3600: Merge "build_image.py: Verity support for flashing non partition spanning fs"
* commit 'e71b55606e2d0820f4a743f6c0e6b524f2354919':
  build_image.py: Verity support for flashing non partition spanning fs
2015-04-02 18:57:32 +00:00
Mohamad Ayyash
e71b55606e am 347195da: am 6ddc3600: Merge "build_image.py: Verity support for flashing non partition spanning fs"
* commit '347195da2ea801db95cf201fa7516bf392dc005a':
  build_image.py: Verity support for flashing non partition spanning fs
2015-04-02 18:37:05 +00: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
521a8dbd18 am 93d46584: am ae26f5b0: am 53602955: Merge "Add support to sign bootable images with vboot_signer"
* commit '93d46584170a9aae1728cdb9010eef41e25b4d4a':
  Add support to sign bootable images with vboot_signer
2015-04-01 17:33:36 +00:00
Tao Bao
93d4658417 am ae26f5b0: am 53602955: Merge "Add support to sign bootable images with vboot_signer"
* commit 'ae26f5b002de956d495c4019b365040490ff18dd':
  Add support to sign bootable images with vboot_signer
2015-04-01 17:15:29 +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