Commit Graph

3630 Commits

Author SHA1 Message Date
Alex Klyubin 284e45ac09 Fix bug in APK entry alignment.
APK entry alignment logic assumes that input entries have zero-length
comment and extra fields. When the assumption is broken, the logic
silently breaks alignment of output entries. This happens, for
example, when the APK to be signed is already aligned and thus may
contain entries with non-empty extra fields.

Given that APKs are not supposed to use comment and extra fields for
anything useful and given that this signer already discards comment
and extra fields of compressed entries, this change makes the signer
discard comment and extra fields of STORED input entries as well.
This unbreaks the existing alignment logic.

Bug: 27814973

(cherry picked from commit 37a0ecd329)

Change-Id: If2e0df6d3298e9736ef175bb0d9a05d450164c9f
2016-03-23 18:11:35 -07:00
smain@google.com 6405ed9d51 remove the 'refonly' templates.
no longer needed, as the standard templates now have conditions to handle the reference only design.
bug: 27667787

Change-Id: I7c627ad4cace0bb1c77c494b3052eca3c9609a5c
2016-03-22 16:00:34 -07:00
smain@google.com 9a12a2f82f add the 'reference only' header design as a condition to the normal templates.
also add override for implementation to the to-root link path.
bug: 27667787

Change-Id: I79892ddb7c5053d5325afcd50016c726b34e1361
2016-03-22 14:31:39 -07:00
Sami Tolvanen a8c37be285 Revert "Revert "build: pass version and patch level to mkbootimg""
This reverts commit 494a9090f9.

Bug: 27498078
Bug: 22914603
Change-Id: Iee6a784271ec32c6bfcc0a6ad3f0395d82016df3
(cherry picked from commit 3303d909a1)
2016-03-15 11:23:56 -07:00
Alex Klyubin 914b37f4e3 Fix two cosmetic issues in signapk.
* Zip EoCD record comment length was referred to as 32-bit whereas it
  is a 16-bit field. The implementation was fine, but the comment and
  the naming of a constant were wrong.
* System.out.println was left over from early prototyping days.
  Removed.

Bug: 25794543

(cherry picked from commit 82bf99bb4e)

Change-Id: I9845b5fa096859d67b306f4b9b6c205cad622c0c
2016-03-14 15:13:30 -07:00
Sami Tolvanen b3038bedcd Merge "Revert "build: pass version and patch level to mkbootimg"" into nyc-dev 2016-03-14 15:49:15 +00:00
Sami Tolvanen 1bca9fb6d4 Revert "build: pass version and patch level to mkbootimg"
This reverts commit e555f77962.

Bug: 27580174
Change-Id: I0fd1ddb64d2fd4f91b0ecbc1ab8953a1324a10eb
2016-03-14 15:47:11 +00:00
Scott Main e6e3c70b67 Merge "change printed version in offline docs to check whether in preview or not, and change the title accordingly, using new preview codename or version number." into nyc-dev 2016-03-10 23:12:44 +00:00
smain@google.com 0d7e38042d make image resource URLs relative so they work in offline docs
Change-Id: I4329689d8a3db3ce67f1aa7084a3a4634721e3cb
(cherry picked from commit 7d959be058)
2016-03-10 23:10:15 +00:00
smain@google.com 0e3342ff81 change printed version in offline docs to check whether in preview or not,
and change the title accordingly, using new preview codename or version number.

Change-Id: I2833dcd05447add10495fea2149b5a9678831235
2016-03-10 15:04:40 -08:00
smain@google.com 5e37eef425 change name of offline doc tab to "API reference"
and put the version number in the secondary nav bar (it was there anyway).

Change-Id: I4b49581eca6afa445a434cd6ae31572d01f276ef
(cherry picked from commit 06bdd78284)
2016-03-10 18:06:25 +00:00
Mohamad Ayyash 6a3185f23d Merge "Hook incremental ext4 image generation into build" into nyc-dev 2016-03-09 20:56:19 +00:00
Tao Bao 00ed831a11 resolve merge conflicts of 2ad8b97577 to nyc-dev
Change-Id: Ifa7501e58dd25e73ed760b1383a1873e4d449885
2016-03-08 21:39:13 -08:00
Tao Bao 7302eb7dd6 Use the update-binary in the source build for downgrade OTAs.
am: fa41fb2705

* commit 'fa41fb27054185b3fba0519d01dabd21444fe772':
  Use the update-binary in the source build for downgrade OTAs.
2016-03-09 05:27:36 +00:00
Tao Bao ff75c23086 releasetools: Fix the bug in AssertSequenceGood.
We use a bitset for blocks in the target image to assert a block hasn't
been touched before reading. Skip checking the blocks that are in the
source image only.

Bug: 27556903
Change-Id: I3a77292da673c813bd20d8dc177ff36419d8ecae
(cherry picked from commit dca2200c8a)
2016-03-08 19:01:26 -08:00
Tao Bao fa41fb2705 Use the update-binary in the source build for downgrade OTAs.
We used to use the update-binary from the target build when creating
incremental OTAs. But for downgrade OTAs, we should use the one in the
source build instead, which is actually newer.

Bug: 27556903
Change-Id: Ib6415729b979dbffdebdda24902f7f560942801a
(cherry picked from commit 4996cf03d2)
2016-03-08 18:48:40 -08:00
smain@google.com b8b72c14e5 Add new templates directory for "reference only" builds.
The only difference is that this changes the masthead.cs file to show a different header.

Change-Id: Id58eb7e8c42a8ab0886f2f5da794fcd108f299ff
(cherry picked from commit 5fea5df99c)
2016-03-08 21:31:20 +00:00
Sami Tolvanen e555f77962 build: pass version and patch level to mkbootimg
Add --os_version and --os_patch_level arguments to mkbootimg.

Needs matching changes from
  I57682611e0c27fec5ed284da7d9a788383ff98b1

Bug: 27498078
Bug: 22914603
Change-Id: I04e20b0de40d864aac92ac7bcf466a6cbde3d0e4
(cherry pick from commit 8fb47f191f)
2016-03-08 08:21:52 -08:00
Tao Bao 84bc4b78cc resolve merge conflicts of 08a3a32fa9 to nyc-dev
Change-Id: I6fd55b3d2bd0c396018163dd4f54970cb55432cd
2016-03-07 21:49:33 -08:00
Tao Bao bd25fcdc02 resolve merge conflicts of 177c610e7f to cw-e-dev
Change-Id: Iba7820247d0b53d7f9553290eb0db3547f31beda
2016-03-07 21:24:40 -08:00
Tao Bao 177c610e7f DO NOT MERGE releasetools: Support generating downgrade incremental OTAs.
Add --downgrade flag to ota_from_target_files.py script. It allows
generating an incremental OTA that updates from a newer build to an
older one (based on timestamp comparison). "post-timestamp" line in the
metadata file will be replaced by "ota-downgrade=yes". A data wipe will
always be enforced, so "ota-wipe=yes" will also be included in the
metadata file.

Bug: 26883782
Change-Id: Iaa05f662d948b7ab632a9fbb7051cc3f8bf68c21
(cherry picked from commit 5d1825664a)
2016-03-07 21:02:36 -08:00
Mohamad Ayyash f876555893 Hook incremental ext4 image generation into build
Allows passing the *.base_fs or *.map files for system and vendor in
INTERNAL_SYSTEM_BASE_FS_PATH and INTERNAL_VENDOR_BASE_FS_PATH variables
respectively.

Internal Design Doc: go/incremental-ext4
BUG: 26839493
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>

Change-Id: Ie57ef6dbfa6084268b6535fe0a673a3b4aaa6e2f
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-03-03 12:07:21 -08:00
Tao Bao 8cad831b39 resolve merge conflicts of 9baa993c07 to nyc-dev
Change-Id: Ifcfb2da03662ef1b6677c0974605189e2a8e3d20
2016-03-01 15:08:51 -08:00
Tao Bao df4cb0b2c1 releasetools: Add --oem_no_mount option.
We may have devices with OEM-specific properties but without an OEM
partition (e.g. the properties might be set by init based on hardware
SKUs). For such devices, we supply --oem_no_mount to skip mounting the
OEM partition in the updater-script. The option is only meaningful when
-o (--oem_settings) is specified.

Bug: 27359929
Change-Id: Ic08396e478a82be4188e980e704b33b4f704a8d7
(cherry picked from commit 8608cde944)
2016-02-26 16:10:34 -08:00
Tao Bao 4da324e1a4 releasetools: Support generating downgrade incremental OTAs.
Add --downgrade flag to ota_from_target_files.py script. It allows
generating an incremental OTA that updates from a newer build to an
older one (based on timestamp comparison). "post-timestamp" line in the
metadata file will be replaced by "ota-downgrade=yes". A data wipe will
always be enforced, so "ota-wipe=yes" will also be included in the
metadata file.

Bug: 26883782
Change-Id: Iaa05f662d948b7ab632a9fbb7051cc3f8bf68c21
(cherry picked from commit 5d1825664a)
2016-02-25 16:39:42 -08:00
Alex Klyubin 8d8c3de3b1 Switch to production constant for v2 signing scheme ID.
Bug: 25794543

(cherry picked from commit 97dd58a071)

Change-Id: Iefb8eec4e512115bc6a0f5126249e8b2c8b66ddb
2016-02-17 10:44:58 -08:00
Colin Cross d2f35846e4 makeparallel: unset MAKEFLAGS and MAKELEVEL
makeparallel inherits values for MAKEFLAGS and MAKELEVEL from make
through the environment, but they should not be propagated to the child
process in case the child process tries to run make again.

Bug: 26071246
Change-Id: I4c5df10ea8055cd1f1f61a892d5b1a7acb287bbb
(cherry picked from commit d8f0d68b78)
2016-02-16 13:10:40 -08:00
Aurimas Liutikas af1d741182 Fix 2 unused parameter warnings in zipalign.
ZipFile parameter was not used and therefore can be removed.

Bug: 26936282
Change-Id: Id2b6e693b40571b7e7486304a6effaedc1b3c940
2016-02-12 02:13:30 +00:00
Alex Klyubin b05b62df2e Sign APKs using SHA-256 instead of SHA-1 when possible.
This changes the build system to provide the signapk tool with the
minSdkVersion of the APK being signed. signapk in turn will then use
SHA-256 instead of SHA-1 if minSdkVersion is 18 (JB MR2) or higher
(see c2c49ed0c1).

To avoid increasing incremental OTA update package sizes for already
released platforms, release build scripts disable the above logic when
signing target files ZIPs for pre-N platforms.

Bug: 25643280

(cherry picked from commit 2cfd1d108c)

Change-Id: I38450d07ddc05c705de40313f843beada8db7d98
2016-02-10 17:19:08 -08:00
Sami Tolvanen 405e71dcd3 Fix metadata location when file system doesn't span the partition
Pad the sparse image with a zero fill chunk to correctly position
verity and FEC metadata at the end of the partition.

Bug: 27073791
Change-Id: I9f70d579a42e5007d50e9c02a98a608d2815f0ed
(cherry picked from commit 6a8781a251)
2016-02-10 10:53:47 -08:00
Alex Klyubin fb5ac541a4 Merge "Use Jan 1 2009 as timestamp in OTA update ZIPs." into nyc-dev 2016-02-10 18:15:26 +00:00
Tao Bao b4cfca530c releasetools: Add two new entries to metadata.
Add "ota-required-cache" into the metadata file in an OTA package,
which shows the minimum free space on /cache to apply the update.

Add "ota-type" into the metadata file, which shows the OTA type for
this package (i.e. one of FILE, BLOCK and AB).

Also add the cache free space check into updater-script when generating
block-based incremental OTAs (we only had such lines for file-based
incrementals before).

Bug: 26731903
Change-Id: Id6ff0fc4cdfb1443636b0b3800b0f8bddb5bb1d0
(cherry picked from commit d8d14bec0d)
2016-02-10 09:37:40 -08:00
Tao Bao ebadc3bd8e Merge "improve performance of blockimgdiff" into nyc-dev 2016-02-10 17:36:59 +00:00
Doug Zongker 6ab2a5017e improve performance of blockimgdiff
Substantially improves the performance of some BlockImageDiff steps on
large images.  GenerateDigraph and AssertSequenceGood are now linear in
the number of blocks in the target image rather than quadratic in the
size of the partition.  FindVertexSequence tracks the score of each
vertex, the set of sources and sinks, and maintains a heap for finding
the best vertex to use for the greedy step, instead of repeatedly
re-scanning the set of remaining vertexes.

Change-Id: Ifeea5053d80ef4f06a5aa239c9a1797dd5e47841
(cherry picked from commit 2d2dd1526d)
2016-02-10 09:36:22 -08:00
Alex Klyubin b9f720a18b Use Jan 1 2009 as timestamp in OTA update ZIPs.
This is a follow-up to 6c41036bcf where
I forgot to update a section of OTA update ZIP code.

Bug: 26864066

(cherry picked from commit f735851fa9)

Change-Id: I4f85ce170ac72d13a9c8636414927a295e350458
2016-02-10 09:04:49 -08:00
Patrick Tjin e11aa50bb2 Add compressor options for squashfs vendor images
Change-Id: I4f9f5d62e24654cb37d436cb73dd5893aed30fa8
2016-02-09 15:41:07 -08:00
Alex Deymo f9f0a6180c Merge "ota_from_target_files: Include the payload properties." am: db82f72752
am: 07085a5113

* commit '07085a511385a9dfa71414735641f96119ec342c':
  ota_from_target_files: Include the payload properties.
2016-02-05 23:43:38 +00:00
Alex Deymo 07085a5113 Merge "ota_from_target_files: Include the payload properties."
am: db82f72752

* commit 'db82f72752532bf2b98103171b3d7cd8405b88e4':
  ota_from_target_files: Include the payload properties.
2016-02-05 23:16:47 +00:00
Alex Deymo db82f72752 Merge "ota_from_target_files: Include the payload properties." 2016-02-05 23:11:18 +00:00
Alex Deymo 19241c11bd ota_from_target_files: Include the payload properties.
When building an A/B OTA package, include the payload.bin properties as
a key-value pairs text file, so it can easily be passed to
update_engine during payload application.

Bug: 26991255
TEST=`ota_from_target_files out/dist/${BOARD}-target_files.zip full-ota.zip` includes the properties.

Change-Id: I445c8a8e412a8e16b48b6ee626db8e27d48a38a9
2016-02-04 23:29:50 -08:00
Dan Willemsen ced2a7d6a1 Merge changes I2e00bb66,I00890229 am: 6c597e6bdd
am: 11b5b1c992

* commit '11b5b1c9925acf80dd42a184e92870d6bfa54736':
  Do not diff .odex files
  Diff libpac.so now that it is deterministic
2016-02-03 19:05:09 +00:00
Dan Willemsen 11b5b1c992 Merge changes I2e00bb66,I00890229
am: 6c597e6bdd

* commit '6c597e6bdd6f3ba9d0ab0fbad43cd7746e34ed86':
  Do not diff .odex files
  Diff libpac.so now that it is deterministic
2016-02-03 19:02:54 +00:00
Dan Willemsen c4438d3d29 Do not diff .odex files
They still are not deterministic -- only the boot images were made
deterministic (.oat/.art).

Bug: 26956807
Change-Id: I2e00bb6662b4c8d184c48ef9aa34b39142c94893
2016-02-03 10:46:39 -08:00
Dan Willemsen 8c915ee2ef Diff libpac.so now that it is deterministic
Bug: 25348136
Change-Id: I008902299281b5ddd55a9b8c405d53eea2d56c8b
2016-02-03 10:45:25 -08:00
Dan Willemsen f056513b69 Merge "Diff .art/.oat/.odex files now that they are deterministic" am: 78861d7e6e
am: 822f20f933

* commit '822f20f933d8b6d8fb16699744f5865bafbce7da':
  Diff .art/.oat/.odex files now that they are deterministic
2016-02-01 22:44:44 +00:00
Dan Willemsen 822f20f933 Merge "Diff .art/.oat/.odex files now that they are deterministic"
am: 78861d7e6e

* commit '78861d7e6e56a770eb6c50370aa405992a3fab4c':
  Diff .art/.oat/.odex files now that they are deterministic
2016-02-01 22:42:50 +00:00
Dan Willemsen 734d78cdf6 Diff .art/.oat/.odex files now that they are deterministic
This also whitelists the ro.build.user property, which may change based
on host username.

Bug: 26687569
Change-Id: I8f3244c2325dd80a7961c474655f0c50670d1b46
2016-02-01 13:41:30 -08:00
Dan Willemsen 412057d206 Merge "Use Jan 1 2009 as timestamp in APKs and OTA update ZIPs." am: 0d85dab09a
am: 10b4db6f0e

* commit '10b4db6f0efaac70995bf18670d6e3bd7da3c753':
  Use Jan 1 2009 as timestamp in APKs and OTA update ZIPs.
2016-01-30 02:49:22 +00:00
Dan Willemsen 10b4db6f0e Merge "Use Jan 1 2009 as timestamp in APKs and OTA update ZIPs."
am: 0d85dab09a

* commit '0d85dab09a09de48535e4139b858e5e4bef8565f':
  Use Jan 1 2009 as timestamp in APKs and OTA update ZIPs.
2016-01-30 02:47:35 +00:00
Dan Willemsen 0d85dab09a Merge "Use Jan 1 2009 as timestamp in APKs and OTA update ZIPs." 2016-01-30 02:44:27 +00:00