Commit graph

859 commits

Author SHA1 Message Date
Badhri Jagan Sridharan
ed25565e63 Merge \"releasetools: replace verity keyid\" into nyc-mr1-dev
am: 05dcc3718a

Change-Id: I0e9e1b1b2b9ca826de09b81925760c19697b39dc
2016-06-22 20:59:55 +00:00
Badhri Jagan Sridharan
05dcc3718a Merge "releasetools: replace verity keyid" into nyc-mr1-dev 2016-06-22 20:54:21 +00:00
Tianjie Xu
8fe72d5479 Merge \"Limit the number of blocks in command zero\" into nyc-mr1-dev
am: 7112b50252

Change-Id: I30e4a669f0d7b819acc97ad6ca4ed5af666d994a
2016-06-21 23:37:25 +00:00
Tianjie Xu
7112b50252 Merge "Limit the number of blocks in command zero" into nyc-mr1-dev 2016-06-21 23:19:12 +00:00
Tianjie Xu
bb848c54a7 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
2016-06-21 16:13:06 -07:00
Tao Bao
6047c24fae resolve merge conflicts of 9cbe37e to nyc-mr1-dev-plus-aosp
Change-Id: I9643386f714fe520e5732d0e6dbe821131ea6d02
2016-06-21 13:37:26 -07:00
Tao Bao
dea0f8bfed 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
2016-06-20 20:32:37 -07:00
Elliott Hughes
1e070434c7 Merge \\\"Remove --no_prereq flag from OTA script.\\\" am: bc450fc9c8 am: bd30d5fa16
am: 38f9a845ca

Change-Id: Id2149bae492959ba44a520efe7ec73d55fe1e823
2016-06-21 00:10:55 +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
Badhri Jagan Sridharan
b58d23fe00 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
2016-06-20 21:52:32 +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
Tao Bao
827e9dfd38 Merge \"Replace OTA keys when signing for A/B devices.\" into nyc-mr1-dev
am: 008babb191

Change-Id: I7062b5245187446c686ff58391dda7286e5ac887
2016-06-17 22:10:04 +00:00
Tao Bao
008babb191 Merge "Replace OTA keys when signing for A/B devices." into nyc-mr1-dev 2016-06-17 22:03:34 +00:00
Tao Bao
24a7206430 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
2016-06-17 12:16:31 -07:00
Elliott Hughes
2d208075c6 Merge \\\"Remove obsolete MTD support from the releasetools scripts.\\\" am: 63fc2b6766 am: ece6ff869c
am: f66d3e61f8

Change-Id: Ib754bc3e9b1c895d431e3b7be9e5435bb6b05fb5
2016-06-17 05:05:08 +00: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
44dc2a973f resolve merge conflicts of 8ebbc4e to nyc-mr1-dev
am: 423862500b

Change-Id: I8f8dd48e52c1ab7cb3462725569cf7c1e0443d38
2016-06-16 20:22:30 +00:00
Mohamad Ayyash
423862500b resolve merge conflicts of 8ebbc4e to nyc-mr1-dev
Change-Id: I2349bb3fede317487227b16cb7c7b093a93a3876
2016-06-16 13:11:45 -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
Tao Bao
73621c8214 Support wiping userdata for A/B OTA packages.
am: 38ca0be399

Change-Id: Id1908bbbb475f5ae3bc16fc2da5120e7d205b0b6
2016-06-16 03:49:34 +00:00
Tao Bao
38ca0be399 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
2016-06-15 17:07:03 -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
c3216ac077 Merge \\"Pass block_list param to mksquashfs\\" into nyc-dev am: 3bddf74752
am: 52cef0d4f0

Change-Id: I0fe16c6b9728acf7b46f412d705fa0aacd2b4655
2016-06-15 17:02:47 +00:00
Mohamad Ayyash
b54038689e Merge \\"releasetools: Disable using imgdiff for squashfs.\\" into nyc-dev am: a8d3741f1a
am: 46ff838582

Change-Id: I8e0e9f9b116da0b07ad89968eb8346aa1a0f04a8
2016-06-15 17:02:44 +00:00
Mohamad Ayyash
f80e55b821 Merge \"Pass block_list param to mksquashfs\" into nyc-dev
am: 3bddf74752

Change-Id: I713c6a60d10ef1e85475e462bb34c89751f74e7d
2016-06-15 16:58:36 +00:00
Tao Bao
df56506d30 Merge \"releasetools: Disable using imgdiff for squashfs.\" into nyc-dev
am: a8d3741f1a

Change-Id: Iec58dd45df569d4c558ed0114b576db0f5cb101a
2016-06-15 16:58:35 +00: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
361cc8c8e0 Merge \\\"Redirect subprocess stderr to stdout in verbose mode.\\\" am: 1318ec93e7 am: 74d7b31f7d
am: dbae67fac8

Change-Id: I6a690861e22041a67bb5b17aff474ee8f0e8aa41
2016-06-11 01:15:42 +00: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
884e274103 Add build.version.incremental to metadata am: d06f07eef4
am: c201d28713

Change-Id: Ib8a9dcc4441af7bed6374401deb0dc8c3aa92127
2016-06-10 17:30:30 +00:00
Tianjie Xu
21c8d29ee1 Add build.version.incremental to metadata
am: d06f07eef4

Change-Id: Id13fbae7fdc6232cd44b8a3cceba0d936a890f92
2016-06-10 17:30:29 +00: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
Tianjie Xu
97be5b9b6e Merge "Report error codes in the OTA update script" into nyc-dev
am: 654e4fb023

* commit '654e4fb02368b05cbfba3246b4c634512fa84464':
  Report error codes in the OTA update script

Change-Id: I333bd45886d5915858b762e086d8a263f81b26e2
2016-05-25 21:11:12 +00:00
Tianjie Xu
7d1dd8e310 Merge "Report error codes in the OTA update script" into nyc-dev am: 654e4fb023
am: 6a912c14dd

* commit '6a912c14ddc39e3ef70ba2b4b484ef080ef61d3b':
  Report error codes in the OTA update script

Change-Id: I2fc44e04861523d21724d39ab7e5fa2c0d6a4af7
2016-05-25 21:06:31 +00:00
Tianjie Xu
6a912c14dd Merge "Report error codes in the OTA update script" into nyc-dev
am: 654e4fb023

* commit '654e4fb02368b05cbfba3246b4c634512fa84464':
  Report error codes in the OTA update script

Change-Id: Ic8d04a484bdf6d08af5109a71967c3d5f8f0be27
2016-05-25 21:02:21 +00:00
Tianjie Xu
209db46be1 Report error codes in the OTA update script
Modify the abort() function in the OTA update generation script to
report an error code. The recoveryimage will parse the code and write it
into last_install for further data analysis.

Bug: 28934032
Change-Id: I2d62f81fd352c3102fb84f054972ac0ecb965a21
2016-05-25 12:22:31 -07:00
Mohamad Ayyash
000d71dc1d Pass squashfs block size as a parameter
am: dfec815882

* commit 'dfec815882d2253c6c9130e3241a1906161f3824':
  Pass squashfs block size as a parameter

Change-Id: Ie767254ce653b6a0d21ca9922434ad350fd61a48
2016-05-24 21:08:17 +00:00