Commit graph

860 commits

Author SHA1 Message Date
Tao Bao
88f7e6a867 Merge \"Handle multiple APKs from the same package in check_target_files_signatures.py.\"
am: 653980bfe4

Change-Id: I9b47c241b8d8c879b6e1794e5c84ad9fd8541613
2016-07-28 04:41:18 +00:00
Tao Bao
6a54299fbd Handle multiple APKs from the same package in check_target_files_signatures.py.
We were using the package name as the key to index APKs. APKs from the
same package got messed up and gave wrong signature summary. Switch to
using the package filename as the key, which is identical in a given build.

Also fix the trailing space when printing the signature summary.

Bug: 30418268
Test: Run with a target_files.zip that has multiple APKs from the same package.

Change-Id: I6317e8c05e987c5690915e05c294153d10e2f0ab
2016-07-27 19:52:28 -07:00
Tao Bao
538ed261eb resolve merge conflicts of 4058a71 to stage-aosp-master
Change-Id: I0816bfc5d8adb20e175617d97651f1474ce4e916
2016-07-11 09:08:24 -07:00
Tao Bao
62a6c464a2 releasetools: Fix the detection of using squashfs.
We should disable using imgdiff if *any* of the source and target
partitions uses squashfs.

Bug: 30004734
Test: Create an incremental with two builds with one of them uses squashfs.
Change-Id: I826cd13d7b852c548e4b45e61f5ae00f6407cac3
(cherry picked from commit f8acad1480)
2016-07-10 23:16:14 -07:00
Tao Bao
b6568cd4be releasetools: Disable using imgdiff for squashfs.
We use imgdiff to handle files in zip format (e.g. jar/zip/apk) for
higher compression ratio.

For system/vendor in squashfs, a) all files are compressed in LZ4
format; b) we use 4096-byte block size in their sparse images, but the
files in squashfs may not be laid out as 4K-aligned. So the blocks for
a given file as listed in block map may not form a valid zip file, which
may fail the patch generation with imgdiff.

Disable using imgdiff for squashfs images, and use bsdiff instead.

Bug: 22322817
Change-Id: Ie76aa4cece5c9d38cb1d1a34c505a4a8f37512d3
(cherry picked from commit 293fd135c7)
2016-07-10 23:15:48 -07:00
Tao Bao
c4449f819c Merge \"releasetools: Fix the payload public key replacement.\"
am: 8a09095c34

Change-Id: I464ec9dd1a12dcb06bc1dcbf340fdcbac04b9575
2016-07-08 21:09:20 +00:00
Tao Bao
13b6962e8d releasetools: Fix the payload public key replacement.
update_engine expects the extracted public key instead of the
certificate.

Bug: 28701652
Change-Id: I292d39da9e039f96d01a4214226aeb46f8cb881d
(cherry picked from commit afaf295cb8)
2016-07-08 12:52:45 -07:00
Tianjie Xu
85da4d3566 Merge \"Skip copying existing vendor images\"
am: 1767d3f918

Change-Id: I5f929adedb17b6d32d2e0e284aa37c39c643c3ea
2016-06-29 18:45:57 +00:00
Tianjie Xu
aaca421ec1 Skip copying existing vendor images
add_img_to_target_files.py has an option of "-a" to add missing
images only. Under this option, the script should skip copying
the radio images for A/B devices when given image exists already
under "IMAGES/".

Test: Run the command on an A/B device, the existing radio images under "IMAGES/" don't get overwritten; and missing images are added correctly.
Bug: 29608905
Change-Id: Ie034b85a5d777d53e367f99470cea4d19cb1aaaf
2016-06-29 18:32:30 +00:00
Ethan Xia
e4efe69fae Merge \\"releasetools: Change the default key path for bvbtool\\" am: 7c7571d510
am: 090e8eff5e

Change-Id: I34f3cc1a38b860fd3100548f55a38af9faf69e19
2016-06-28 01:59:47 +00:00
Ethan Xia
090e8eff5e Merge \"releasetools: Change the default key path for bvbtool\"
am: 7c7571d510

Change-Id: Ic02f432c689edba37ecce684662d8f5f1cfc32b6
2016-06-28 01:57:26 +00:00
Ethan Xia
37b4a9819b releasetools: Change the default key path for bvbtool
The bvb path has been changed from 'system/bvb' to 'external/bvb'

Change-Id: I8587351b7d702a287883c6bd3c9de1cd3540435b
2016-06-27 17:19:01 +08:00
Tao Bao
1ea603491f Merge \\"Fix the path for verity_key replacement when signing.\\" am: 46abc55954
am: 5b9921369e

Change-Id: Iae1fbc6e07d1cada56d0f34b87dad2074b4664a6
2016-06-24 05:30:31 +00:00
Tao Bao
c8338f1c35 Merge \\"Add ability to pass in payload_signer args\\" am: 8e6582b238
am: 8f9df9efb9

Change-Id: I3603ac55a8836406ca60c05959efffffb7ffca3a
2016-06-24 05:30:31 +00:00
Tao Bao
63cc08f93d Merge \\"releasetools: Support using payload_signer.\\" am: 983a42bdf1
am: 9322317ee7

Change-Id: I13c5eede68149c1dda6da9bb33a2527adc05dd8c
2016-06-24 05:30:31 +00:00
Tao Bao
fb45739c55 Merge \\"releasetools: replace verity keyid\\" am: 6efa887f9b
am: 45d28d7392

Change-Id: I2104805b0de9ca28fde19f2c460b540977260dc2
2016-06-24 05:30:30 +00:00
Tao Bao
b2814336a0 Merge \\"Replace OTA keys when signing for A/B devices.\\" am: f2c34ece3c
am: deb116a65d

Change-Id: Ib57f472bdd232a908e0399dc1365f9aaf8ddf3ba
2016-06-24 05:30:30 +00:00
Tao Bao
5b9921369e Merge \"Fix the path for verity_key replacement when signing.\"
am: 46abc55954

Change-Id: I9496d5826e077a470ac0ddd3565e3547611e6bf1
2016-06-24 05:27:03 +00:00
Baligh Uddin
8f9df9efb9 Merge \"Add ability to pass in payload_signer args\"
am: 8e6582b238

Change-Id: I83ab46e365fd09c7bf3d4a97fddf289e5d819ce0
2016-06-24 05:27:02 +00:00
Tao Bao
9322317ee7 Merge \"releasetools: Support using payload_signer.\"
am: 983a42bdf1

Change-Id: I027ae0f71c3a57ffad476791721b111605844f1d
2016-06-24 05:27:02 +00:00
Badhri Jagan Sridharan
45d28d7392 Merge \"releasetools: replace verity keyid\"
am: 6efa887f9b

Change-Id: I63b11e2e0d27100a58a05ea91c0e7c29bb0597ff
2016-06-24 05:27:01 +00:00
Tao Bao
deb116a65d Merge \"Replace OTA keys when signing for A/B devices.\"
am: f2c34ece3c

Change-Id: I7eb287bd486d197b3c2c96616b558e7bc9536329
2016-06-24 05:27:00 +00:00
Tao Bao
8adcfd1688 Fix the path for verity_key replacement when signing.
system_root_image expects the key at ROOT/verity_key as opposed to
BOOT/verity_key. Also refactor the verity key replacement lines.

Bug: 29397395
Test: 'sign_target_files_apks.py --replace_verity_private_key newkey --replace_verity_public_key newkey.pub target_files.zip signed-target_files.zip' and verify the replaced key in boot.img.
Change-Id: I58a5defff4be008ad55d4b5a5b7148569c3b8d66
(cherry picked from commit e0ee794fa1)
2016-06-23 22:17:46 -07:00
Baligh Uddin
34eb000de5 Add ability to pass in payload_signer args
Bug: 28701652
Change-Id: I110d5fc14446e4a6a0f8e25dcb0d300decdf09a4
(cherry picked from commit 2abbbd0333)
2016-06-23 22:16:46 -07:00
Tao Bao
1a5e1d18a7 releasetools: Support using payload_signer.
For A/B OTAs, by default it calls 'openssl pkeyutl' to sign the payload
and metadata with the package private key. If the private key cannot be
accessed directly, a payload signer that knows how to do that should be
supplied via "--payload_signer <signer>".

The signer will be called with "-inkey <path_to_private_key>",
"-in <input_file>" and "-out <output_file>" parameters.

Test: Use a dummy signer, call 'ota_from_target_files.py --payload_signer <signer> <target_files.zip> <ota.zip>' and verify the signatures in the generated package.
Bug: 28701652
Change-Id: I26cfdd3fdba6fc90799221741b75426988e46fd3
(cherry picked from commit dea0f8bfed)
2016-06-23 22:15:30 -07:00
Badhri Jagan Sridharan
35c9b1243f releasetools: replace verity keyid
Replace verity keyid with the keyid extracted from cert
passed through --replace_verity_keyid. The veritykeyid in the
BOOT/cmdline of input target files is replaced with keyid
extracted from --replace_verity_keyid and written to the
output target files.

BUG: 28384658
Change-Id: Ic683f36f543c4fcd94b6f95e40f01200fbf45ee1
(cherry picked from commit b58d23fe00)
2016-06-23 22:13:12 -07:00
Tao Bao
a80ed221b8 Replace OTA keys when signing for A/B devices.
It replaces the package verification key (change of path due to
system_root_image flag), as well as the payload verification key.

Bug: 29397395
Change-Id: I10435072aaf4356f2d8b5e1b6e82eb9cead7ad62
(cherry picked from commit 24a7206430)
2016-06-23 22:12:31 -07:00
Tianjie Xu
5371829b86 Merge \"Limit the number of blocks in command zero\" into nyc-dev
am: 0eade3f027

Change-Id: I7f5cc1319863eb1ec1d87b6bf3e9cb62f3401e41
2016-06-22 05:17:42 +00:00
Tianjie Xu
b64439b291 Limit the number of blocks in command zero
Limit the number of blocks in command zero to 1024 blocks. This
prevents the target size of one command from being too large and
might help to avoid fsync errors during the OTA update.

Bug: 29535618
Change-Id: Ic630cea2599138516162bd0029e2e4b2af75bf4f
(cherry picked from commit bb848c54a7)
2016-06-21 23:19:30 +00:00
Elliott Hughes
38f9a845ca Merge \\"Remove --no_prereq flag from OTA script.\\" am: bc450fc9c8
am: bd30d5fa16

Change-Id: Ic083c9b038bd5a31f9b52ebd6fc498e0353239ca
2016-06-21 00:08:23 +00:00
Elliott Hughes
bd30d5fa16 Merge \"Remove --no_prereq flag from OTA script.\"
am: bc450fc9c8

Change-Id: I35a4400afc829bf2b269135fa99f00979affd3bd
2016-06-21 00:05:51 +00:00
Elliott Hughes
d8a52f9785 Remove --no_prereq flag from OTA script.
Bug: http://b/29393071
Test: aosp_flounder "make dist"
Change-Id: I9ec85210e118f7e525291e31ab4081a2bd10f998
2016-06-20 14:44:18 -07:00
Elliott Hughes
f66d3e61f8 Merge \\"Remove obsolete MTD support from the releasetools scripts.\\" am: 63fc2b6766
am: ece6ff869c

Change-Id: I4b5f5b6a622a2fbb996861e8832e1fc1d12e6bf4
2016-06-17 05:02:05 +00:00
Elliott Hughes
ece6ff869c Merge \"Remove obsolete MTD support from the releasetools scripts.\"
am: 63fc2b6766

Change-Id: I26ed21479ab52d535bcc99b13e55a1476a02f76c
2016-06-17 04:59:26 +00:00
Elliott Hughes
305b088729 Remove obsolete MTD support from the releasetools scripts.
Bug: http://b/29250988
Change-Id: I653dc306485c6b35411840b53211d42eb6d19e34
2016-06-16 20:48:47 -07:00
Mohamad Ayyash
3336f9ae67 Merge \"squashfs: make disable-4k-align a parameter\" into nyc-dev
am: 8ebbc4e7e2

Change-Id: Ia5c59b7bfc7f2b25fa9b13c2ce52c1bd75ccecce
2016-06-16 16:39:39 +00:00
Mohamad Ayyash
8ebbc4e7e2 Merge "squashfs: make disable-4k-align a parameter" into nyc-dev 2016-06-16 16:24:34 +00:00
Tao Bao
7e5205f929 Merge \\"Support wiping userdata for A/B OTA packages.\\" am: b727d5bb32
am: 4f2b227fae

Change-Id: Icf157b44ecda14a2c289d4826e5a55af67e805d5
2016-06-16 15:53:20 +00:00
Tao Bao
4f2b227fae Merge \"Support wiping userdata for A/B OTA packages.\"
am: b727d5bb32

Change-Id: I9d6e67c5e71b025f7cb9119b45f05c51f2cfd340
2016-06-16 15:50:47 +00:00
Tao Bao
7c5dc578b3 Support wiping userdata for A/B OTA packages.
update_engine now accepts POWERWASH=1 to schedule a factory reset in
the post-install phase. Hook up with the --wipe_user_data flag in the
OTA script.

Bug: 28700985
Change-Id: Ie73876a61db90d124d2af588d674757376e9aabc
(cherry picked from commit 38ca0be399)
2016-06-15 23:19:52 -07:00
Mohamad Ayyash
1b6d3485fc squashfs: make disable-4k-align a parameter
BUG: 29388879
Change-Id: I121d2b76db5fb269e2f7152abb2e78098437a0d5
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-06-15 16:37:21 -07:00
Mohamad Ayyash
52cef0d4f0 Merge \"Pass block_list param to mksquashfs\" into nyc-dev
am: 3bddf74752

Change-Id: I1679c255b297a36bc10b50ff9d6214c92d763489
2016-06-15 16:12:55 +00:00
Tao Bao
46ff838582 Merge \"releasetools: Disable using imgdiff for squashfs.\" into nyc-dev
am: a8d3741f1a

Change-Id: If8392b72a865f53449a1d5ca7b52de7697c4b412
2016-06-15 16:12:52 +00:00
Mohamad Ayyash
3bddf74752 Merge "Pass block_list param to mksquashfs" into nyc-dev 2016-06-15 16:03:08 +00:00
Tao Bao
293fd135c7 releasetools: Disable using imgdiff for squashfs.
We use imgdiff to handle files in zip format (e.g. jar/zip/apk) for
higher compression ratio.

For system/vendor in squashfs, a) all files are compressed in LZ4
format; b) we use 4096-byte block size in their sparse images, but the
files in squashfs may not be laid out as 4K-aligned. So the blocks for
a given file as listed in block map may not form a valid zip file, which
may fail the patch generation with imgdiff.

Disable using imgdiff for squashfs images, and use bsdiff instead.

Bug: 22322817
Change-Id: Ie76aa4cece5c9d38cb1d1a34c505a4a8f37512d3
2016-06-13 10:04:23 -07:00
Mohamad Ayyash
c3484f7f64 Pass block_list param to mksquashfs
Needed to generate image.map and to optimize the OTA size

BUG: 22322817
Change-Id: I7802f4dbb9116a94ea99a00b68c3a7ff180ef08a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-06-13 09:48:05 -07:00
Alex Deymo
dbae67fac8 Merge \\"Redirect subprocess stderr to stdout in verbose mode.\\" am: 1318ec93e7
am: 74d7b31f7d

Change-Id: Ia9757f09dead577349b0cf4b97cb062f30d0f45d
2016-06-11 01:12:06 +00:00
Alex Deymo
d8d96ecdae Redirect subprocess stderr to stdout in verbose mode.
This patch uses subprocess.communicate instead of subprocess.wait to
prevent deadlock if any of the child processes outputs too much data,
and redirects the subprocess output to stdout when running in verbose
mode.

With this patch `ota_from_target_files -v` prints the delta_generator
output in stdout, and no output if '-v' is not passed.

Bug: None
TEST=ota_from_target_files -v ...

Change-Id: Id66e4f3360a6f91d61a3ce96d53afbccdaa19da5
2016-06-10 16:38:31 -07:00
Tianjie Xu
c201d28713 Add build.version.incremental to metadata
am: d06f07eef4

Change-Id: I4f0b89d69154ef32bbb04fa905fdc014c911d571
2016-06-10 17:24:52 +00:00
Tianjie Xu
d06f07eef4 Add build.version.incremental to metadata
Add the build property "build.version.incremental" of the source (if
present) and target files to the metadata of the ota update package.

Example of metadata:
....
post-build-incremental=2951741
post-timestamp=1465345123
pre-build-incremental=2943039
pre-device=bullhead
...

Bug: 28658632
Change-Id: I889e8ccf39633b1b35590751001a42d1b05d5514
2016-06-09 17:54:46 -07:00