Commit graph

191 commits

Author SHA1 Message Date
Alex Klyubin
9667b18f23 Make signapk use Conscrypt.
This makes the signapk tool use Conscrypt (where possible) instead of
the platform-default JCA providers and the Bouncy Castle JCA provider.
This speeds up (by 10-30%) APK and OTA update signing because
Conscrypt's crypto primitives are backed by BoringSSL.

Previously, the signapk tool consisted only of the signapk.jar.
Because Conscrypt is backed by native code, signapk now consists of
signapk.jar and crypto_openjdk_jni shared library. This requires that
users of the tool be updated to provide a suitable -Djava.library.path
argument to the Java runtime. This change updates all known users of
the tool inside the Android source tree to do so.

Bug: 26097626
Change-Id: I8411b37d7f771ed99269751a3007dff103083552
2015-12-11 08:36:42 -08:00
Alex Klyubin
eb756d7b7b Do not run zipalign when re-signing APKs.
Running zipalign is no longer needed because signapk takes care of
alignment.

Bug: 25794543
Change-Id: I1080240a67ea6f1b41585fff83d18d57fdcf44e2
2015-12-08 11:05:13 -08:00
Tao Bao
48550cceb0 releasetools: Fix the bug with TARGET_NO_RECOVERY.
The packaging script is broken when we set TARGET_NO_RECOVERY and
SYSTEM_ROOT_IMAGE both. With TARGET_NO_RECOVERY set, we don't have
RECOVERY/RAMDISK/etc/recovery.fstab. It thus fails the assertion in
common.LoadRecoveryFSTab() that "/" must exist in fstab when enabling
SYSTEM_ROOT_IMAGE.

Change-Id: Id509d724f18be7cf7389dd786924ead894ac0cc1
2015-11-19 17:14:21 -08:00
Tao Bao
9bc6bb23b5 releasetools: Support generating verify packages.
We can generate a special OTA package that verifies all the partitions
(boot, recovery, system, vendor and etc) on a device. It also calls
device-specific script to verify bootloader and radio images. This
ensures a flashed device contains all the desired images faithfully.

Usage:
ota_from_target_files.py --gen_verify target_files.zip output.zip

Bug: 24679956
Change-Id: Ib3091d98c4b17a6fad305b3edf16d09efbda5c38
2015-11-10 12:49:33 -08:00
Sami Tolvanen
a25cced65f Merge "Error correction: Use block_image_recover in block OTAs"
am: fe4e86c7fd

* commit 'fe4e86c7fd1b9c8903fda194b8515451c477ced9':
  Error correction: Use block_image_recover in block OTAs
2015-10-29 16:45:14 +00:00
Sami Tolvanen
f0a7c76b45 Error correction: Use block_image_recover in block OTAs
If block_image_verify fails, attempt to recover using FEC before giving up.

Bug: 21893453
Change-Id: Ibc1fe5d28b2a8099d2b5094277b572ec08229c3a
2015-10-29 11:39:31 +00:00
Tao Bao
6ce8ae761b am ac39bef4: Merge "common.py: Fix the build."
* commit 'ac39bef43fb032bff75b8558f54107e733355265':
  common.py: Fix the build.
2015-10-16 15:46:31 -07:00
Tao Bao
aac4ad56b6 common.py: Fix the build.
Should only use source_info_dict when creating incremental OTAs.

Change-Id: I6a4e5f8fa3613a1b36563ec915e433247965a2b8
2015-10-16 15:28:00 -07:00
Tao Bao
63e63c2a07 am 543b28d4: Merge "Pass source\'s info_dict to vendor\'s releasetools.py."
* commit '543b28d42f8fdebe011a906826251ab8df70a226':
  Pass source's info_dict to vendor's releasetools.py.
2015-10-16 14:49:40 -07:00
Tao Bao
6f0b219ac5 Pass source's info_dict to vendor's releasetools.py.
When building incremental packages, the info_dict from the source build
should be the one in use. We have done that for most of the partitions
(system and etc.), and should pass that to vendor's script as well.

Bug: 24898607
Change-Id: Ie2973d41b905637862616286663baf80df83bd88
2015-10-13 16:38:36 -07:00
Tao Bao
8c85549a3c am c9ff5102: am 35da9685: Merge "Use the basename of file_contexts from the info dict."
* commit 'c9ff5102ad9258f9189afd3bd15eb58cab186215':
  Use the basename of file_contexts from the info dict.
2015-08-28 18:56:36 +00:00
Tao Bao
c9ff5102ad am 35da9685: Merge "Use the basename of file_contexts from the info dict."
* commit '35da9685f0d3bb367b50aaa4c476b12907099f77':
  Use the basename of file_contexts from the info dict.
2015-08-28 18:46:31 +00:00
Tao Bao
79735a6a82 Use the basename of file_contexts from the info dict.
Changes in [1] break the backward compatibility of the OTA scripts. Fix
the issue by extracting the file basename from the info dict in
META/misc_info.txt.

[1] commit d3a803e668

Bug: 23620049
Change-Id: I40a5625bbe0beb295f34b2328906a4a4283fe59b
2015-08-28 11:17:38 -07:00
Nick Kralevich
cd8f838d07 am c85364c9: am 5f79bcdd: Merge changes from topic \'file_contexts.bin\'
* commit 'c85364c9c91961461a6d81a37c8b30b34b02383b':
  build: switch over to file_contexts.bin only
  Update embedded.mk to support file_contexts.bin
2015-08-13 00:01:09 +00:00
Nick Kralevich
420662b9cd am c85364c9: am 5f79bcdd: Merge changes from topic \'file_contexts.bin\'
* commit 'c85364c9c91961461a6d81a37c8b30b34b02383b':
  build: switch over to file_contexts.bin only
  Update embedded.mk to support file_contexts.bin
2015-08-13 00:00:36 +00:00
Nick Kralevich
5f79bcdd07 Merge changes from topic 'file_contexts.bin'
* changes:
  build: switch over to file_contexts.bin only
  Update embedded.mk to support file_contexts.bin
2015-08-12 23:46:28 +00:00
Furquan Shaikh
d7ebf9acfc am 7bb7a5f9: am f8a714ba: am 9f5c487e: Merge "releasetools: Fix parameters for vboot_signer" into mnc-dr-dev
* commit '7bb7a5f94e8a2f1f61156773fc259cf112261803':
  releasetools: Fix parameters for vboot_signer
2015-08-10 20:26:27 +00:00
Furquan Shaikh
f8a714ba6f am 9f5c487e: Merge "releasetools: Fix parameters for vboot_signer" into mnc-dr-dev
* commit '9f5c487ef586d20c273cafba6ce663287ef6a37a':
  releasetools: Fix parameters for vboot_signer
2015-08-10 19:34:16 +00:00
Furquan Shaikh
852b8de43f releasetools: Fix parameters for vboot_signer
With the change in vboot_signer (CL:744257), an additional parameter
is required to vboot_signer script. This change adds the required
parameter to releasetools as well.

BUG=23076037

Change-Id: Ice5329578b3a9bc459e278a9d404a1981b35ca88
Signed-off-by: Furquan Shaikh <furquan@google.com>
2015-08-10 11:43:45 -07:00
Tao Bao
f022de397b am 0fed6730: am 8af98164: Merge "Change the cache partition size check into warnings."
* commit '0fed67301d698a30d3f593f6e6ad738f5b28d41e':
  Change the cache partition size check into warnings.
2015-08-08 04:40:35 +00:00
Tao Bao
e3f3a3a941 am 0fed6730: am 8af98164: Merge "Change the cache partition size check into warnings."
* commit '0fed67301d698a30d3f593f6e6ad738f5b28d41e':
  Change the cache partition size check into warnings.
2015-08-08 04:40:29 +00:00
Tao Bao
575d68a48e Change the cache partition size check into warnings.
For some old builds, we may not define cache partition size. Change the
exception into a warning to make the script backward compatible.

Change-Id: Ie94c7fbb1a9f3a7db3f16e8d845e493a534aac5b
2015-08-07 19:49:45 -07:00
Tao Bao
44ca42a515 am 44c8e4db: am 420f95ff: Merge "releasetools: Support packaging for system_root_image."
* commit '44c8e4db55707bb67e06ccc0db3f42a8c7a9bb1e':
  releasetools: Support packaging for system_root_image.
2015-08-07 20:21:04 +00:00
Tao Bao
f08f5e37f9 am 44c8e4db: am 420f95ff: Merge "releasetools: Support packaging for system_root_image."
* commit '44c8e4db55707bb67e06ccc0db3f42a8c7a9bb1e':
  releasetools: Support packaging for system_root_image.
2015-08-07 20:08:08 +00:00
Tao Bao
7a5bf8a645 releasetools: Support packaging for system_root_image.
For system images that contain the root directory, we need to find the
root directory at ROOT/ instead of BOOT/RAMDISK/.

Change-Id: Ica345c8b1b03475f8ac6c44fd576045fcf17c882
2015-08-05 16:28:55 -07:00
Stephen Smalley
d3a803e668 build: switch over to file_contexts.bin only
Change all uses of the file_contexts file to use the
file_contexts.bin file instead.

Depends on
   I75a781100082c23536f70ce3603f7de42408b5ba
   I43806d564b83d57f05f5c36c8eba7b1ff4831b04
   Id560d093440a2aba99cef28c20133b35feebf950
   I15660f4b3e4c5cb8ae0ec1498c74d6fcbb9a0400

Change-Id: Iaf8c4b2e420f610425a07f48db7af32bda3f5b3a
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-08-04 14:59:06 -04:00
Daniel Rosenberg
7d3ad6040a am b139ae07: am 22354d3c: Merge "Add support for system images that contain the root directory"
* commit 'b139ae078c8b2598889c2fde1a39a9d64f27dc62':
  Add support for system images that contain the root directory
2015-08-03 17:57:23 +00:00
Daniel Rosenberg
93d8ea20b8 am b139ae07: am 22354d3c: Merge "Add support for system images that contain the root directory"
* commit 'b139ae078c8b2598889c2fde1a39a9d64f27dc62':
  Add support for system images that contain the root directory
2015-08-01 00:23:58 +00:00
Daniel Rosenberg
e6853b0d63 Add support for system images that contain the root directory
When the root directory is included in system, the assumption that
system is mounted at /system breaks down. Redirect /system to /
in that case.

Change-Id: I8031b32d7cb9ca699c1cc22939e28afce9d1c847
2015-07-31 16:52:21 -07:00
Tao Bao
0d511afcb8 resolved conflicts for merge of 910d3822 to mnc-dev-plus-aosp
Change-Id: Ied44516c7c2e46b93965dbdb8fb4bc98d6ed3310
2015-07-28 17:03:09 -07:00
Tao Bao
7eddd6285f resolved conflicts for merge of 910d3822 to mnc-dr-dev-plus-aosp
Change-Id: I2c899be9d6a82664e4d14c903311daeed5e546fd
2015-07-28 16:58:03 -07:00
Tao Bao
f2cffbddb9 Support systems that use a full copy of recovery image.
If BOARD_USES_FULL_RECOVERY_IMAGE == true, a full copy of recovery
image will be carried as /system/etc/recovery.img instead of a patch
at /system/recovery_from_boot.p.

Bug: 22641135
Change-Id: Ie271d3e2d55d7b003f667ac5b44203d69b23c63b
(cherry picked from commit 8beab69bd5)
2015-07-28 12:20:36 -07:00
Tao Bao
5442819cb1 am a04e6b89: am dd68e68f: Merge "Override properties that point to out/ directory."
* commit 'a04e6b89ec262f4dd38c9d80ee05ce313bab9347':
  Override properties that point to out/ directory.
2015-07-21 18:28:15 +00:00
Tao Bao
1358123688 am a04e6b89: am dd68e68f: Merge "Override properties that point to out/ directory."
* commit 'a04e6b89ec262f4dd38c9d80ee05ce313bab9347':
  Override properties that point to out/ directory.
2015-07-21 18:25:36 +00:00
Tao Bao
84e7568b1f Override properties that point to out/ directory.
A few properties are stored as links to the files in the out/
directory, which are no longer available when (re)packing from
target_files zip. Redirect those properties to the actual files in
the unzipped directory when repacking.

Change-Id: I18e930cbea224ab9c6db8d4e721b1c266a671db6
2015-07-19 08:48:09 -07:00
Tao Bao
906550f285 am bf8e85ab: am 2e4dd9ab: Merge "Fix the permission in common.ZipWriteStr()."
* commit 'bf8e85abb59daf676bc213623a906b8d00a65790':
  Fix the permission in common.ZipWriteStr().
2015-07-11 02:04:05 +00:00
Tao Bao
71404b8102 am bf8e85ab: am 2e4dd9ab: Merge "Fix the permission in common.ZipWriteStr()."
* commit 'bf8e85abb59daf676bc213623a906b8d00a65790':
  Fix the permission in common.ZipWriteStr().
2015-07-11 01:39:49 +00:00
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
6a7d8fced3 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:22 +00: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
ca87c735a3 am 46b1b205: am da724f7a: Merge "Zero out blocks that may be touched by dm-verity."
* commit '46b1b2057d5700a03b3fa6e332a737a0ef2425ba':
  Zero out blocks that may be touched by dm-verity.
2015-07-10 21:16:20 +00:00
Tao Bao
d2e77d6ec5 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 21:09:40 +00: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
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
Tao Bao
b8fbf8a2a1 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:52:33 +00: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
38a534b693 resolved conflicts for merge of 610754e5 to cw-e-dev
Change-Id: Ia0d0d82c7fec86e1585a9e2c90ac877c363ed491
2015-07-08 10:43:31 -07: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