Commit graph

551 commits

Author SHA1 Message Date
Tao Bao
9a5afa5242 am 5e23069b: Merge "build_image.py: Use a fixed timestamp in the generated image."
* commit '5e23069bceebfbf17f67c709bad495d707b194dc':
  build_image.py: Use a fixed timestamp in the generated image.
2015-09-28 21:16:34 +00:00
Tao Bao
052ae3542b build_image.py: Use a fixed timestamp in the generated image.
Bug: 24377993
Change-Id: I9b1433c8c877dc2a391615bb016b8970426e9f70
2015-09-28 13:44:13 -07:00
Tao Bao
c41dc0ad1a am 251d56b8: Merge "releasetools: Update the fingerprint when signing."
* commit '251d56b851af2159df8139639b4a1a1602d60163':
  releasetools: Update the fingerprint when signing.
2015-09-25 21:14:17 +00:00
Tao Bao
cb7ff77da5 releasetools: Update the fingerprint when signing.
ro.bootimage.build.fingerprint should be updated when signing.

Bug: 22720426
Bug: 24009888
Change-Id: Ib246a257581fd31f90ad6b3d21f39d1a2de24ba8
(cherry picked from commit 265d9aeb62)
2015-09-25 12:41:34 -07:00
Tao Bao
e0540445e3 am c5fe3f11: Merge "releasetools: Fix the expected total blocks."
* commit 'c5fe3f117d79ed9ddb6e77fbf211a87dc5dffed4':
  releasetools: Fix the expected total blocks.
2015-09-09 19:39:40 +00:00
Tao Bao
b32d56ea8c releasetools: Fix the expected total blocks.
With the change in [1], it zeroes out extra blocks that might be read
by dm-verity. We should update the expected number of blocks that get
touched.

[1] commit e9b619108d.

Bug: 23786644
Change-Id: I7a7c3531e5af6bf381d3a14832e77abfa9a8efce
2015-09-09 11:56:58 -07:00
Tao Bao
5ffff55bbd am 10b2e62b: Merge "releasetools: Don\'t write empty groups."
* commit '10b2e62b6d45dc4b406be1544fd9b25d6f800e89':
  releasetools: Don't write empty groups.
2015-09-08 22:33:16 +00:00
Tao Bao
42206c3f2f releasetools: Don't write empty groups.
For a DataImage, we may have no mapping of ZERO or NONZERO blocks. Don't
write those groups if they are empty.

Bug: 19024504
Change-Id: I1e921effcdbf0661d4f4b541c104dd456ac0c582
2015-09-08 14:06:08 -07:00
Tao Bao
102ffce5dc am 16656668: Merge "releasetools: Always write the last block if it\'s padded."
* commit '16656668e1cca5b62ca4487206c462b93bf5a0fc':
  releasetools: Always write the last block if it's padded.
2015-09-08 17:50:25 +00:00
Tao Bao
7589e961a7 releasetools: Always write the last block if it's padded.
In BBOTAs if the last block of a DataImage is padded, we should always
write the whole block even for incremental OTAs. Because otherwise the
last block may be skipped if unchanged, but would fail the post-install
verification if it has non-zero contents in the padding bytes.

Bug: 23828506
Change-Id: I4b0af7344d18261258cd48d18c029c089d6ff365
2015-09-05 20:54:55 -07:00
Tao Bao
2f44006a4b am 8f4b307e: Merge "releasetools: Fix the bug when deleting files."
* commit '8f4b307e56ea73153f249b44dc2b15de77e058f7':
  releasetools: Fix the bug when deleting files.
2015-09-04 17:56:22 +00:00
Tao Bao
a77d41e2f7 releasetools: Fix the bug when deleting files.
For file-based OTAs, we used to remove unneeded files in ascending
order, which failed to delete non-empty directories. Reverse the order
to fix the issue.

For example, now we have the following in our generated script:
  delete("/system/app/Calculator/arm/Calculator.odex",
         "/system/app/Calculator/arm/",
         "/system/app/Calculator/Calculator.apk",
         "/system/app/Calculator/");

Bug: 22960996
Change-Id: I0d36d29b7862fb53bf55bf5685a990180f9c0b3b
2015-09-03 21:21:55 -07:00
Tao Bao
3fb3ece67e am c6c9c61d: Merge "releasetools: Fix the bug in symlink deletion."
* commit 'c6c9c61d05ffcc41239baaa1f3011b17e8518b65':
  releasetools: Fix the bug in symlink deletion.
2015-09-03 01:40:41 +00:00
Tao Bao
84006eacd0 releasetools: Fix the bug in symlink deletion.
For file-based OTAs, symlinks in the source build but not in the target
build will be deleted. However, if a symlink is replaced by a regular
file in the target build, the file will be accidentally deleted when
applying (resuming) the same package again.

Verify the checksum of a symlink that will be unpacked or renamed to.
Delete the file only if it doesn't have the target checksum.

Bug: 23646151
Change-Id: Ie322abb6022b6fa812c6b36a3127872d9614fc3b
2015-09-02 17:51:16 -07: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
Tao Bao
4988f18b1f am 6458fd96: Merge "rangelib.py: Fix the bug in monotonic check."
* commit '6458fd96d5d0cd3b54a02a5f9c276f49e566cb53':
  rangelib.py: Fix the bug in monotonic check.
2015-08-27 20:44:35 +00:00
Tao Bao
575643a85d am 14342066: Merge "Add unit tests for rangelib.py."
* commit '14342066dbaec25593c12fdba5396d4ca9cad841':
  Add unit tests for rangelib.py.
2015-08-27 05:23:08 +00:00
Tao Bao
e8f756137c rangelib.py: Fix the bug in monotonic check.
RangeSet("2-10").monotonic gives a wrong result of "False". Fix the bug
and add more tests into test_rangelib.py.

Change-Id: I04780571b45ecafd34040f405756b9745a9e21a5
2015-08-26 21:16:43 -07:00
Tao Bao
873a15e267 Add unit tests for rangelib.py.
Separate the test cases in rangelib.py comments into a python unittest
file.

To invoke:
  $ python -m unittest test_rangelib

Change-Id: I59e4ce0aaccc83bcbb42fee15775683dcd559d99
2015-08-26 16:13:18 -07:00
Tao Bao
8b528fc3ef am 68319cdf: am 95708eea: Merge "Split large files for BBOTA v3."
* commit '68319cdf4762c7c48cff68ede2b7f4bc267db735':
  Split large files for BBOTA v3.
2015-08-26 19:55:20 +00:00
Tao Bao
9a5caf2c30 Split large files for BBOTA v3.
For BBOTA v3, we need to stash source blocks to support resumable
feature. However, with the growth of file size and the shrink of the
cache size, source blocks that represent a file are too large to be
stashed as a whole. CL in [1] solves the issue by replacing the diff
command with a "new" command. However, it may increase the generated
package size substantially (e.g. from ~100MB to ~400MB).

With this CL, if a file spans too many blocks, we split it into smaller
pieces by generating multiple commands. For the same case above, it
reduces the package size to ~150MB.

One potential downside is that after splitting, files like .jar,
.apk and .zip can no longer use imgdiff. We may lose the potential
benefit of using imgdiff for patch size reduction.

[1] commit 82c47981bd

Bug: 22430577
Change-Id: I5684fab0ac41c8d94fe18f52a34cef77e06f741c
2015-08-26 10:50:11 -07:00
Tao Bao
20c68b7494 am 5d690a37: am ab9a3588: Merge "Revise stash for BBOTAs when needed."
* commit '5d690a37d4b3b33dee1cfc2a64b66ed4e9c03460':
  Revise stash for BBOTAs when needed.
2015-08-18 17:25:09 +00:00
Tao Bao
ab9a358801 Merge "Revise stash for BBOTAs when needed." 2015-08-18 16:59:05 +00:00
Tao Bao
e3103ce2a5 am 3b409d56: am dae6455c: Merge "Add an option to include a full bootloader in incremental OTA."
* commit '3b409d56f4e142dd4afc7e11bbe4502123a46f31':
  Add an option to include a full bootloader in incremental OTA.
2015-08-17 17:55:34 +00:00
leozwang
aa6c1a1445 Add an option to include a full bootloader in incremental OTA.
Bug: 23101469
Change-Id: Iac466b83f789f10d26e8d289dce766cf0d05148b
(cherry picked from commit c1324751e79b23a63ea494f4bc784446c8f32435)
2015-08-17 10:34:01 -07:00
Tao Bao
82c47981bd Revise stash for BBOTAs when needed.
When generating incremental BBOTAs (v2 and above), we need to ensure
that the needed runtime stash is below the given threshold. If it's
running out of space on /cache, we replace the command that uses a
stash with a "new" command instead.

This may increase the OTA package size, since it is carrying more full
blocks instead of patches. It gets even worse for large files that span
a number of blocks, because currently we will store all the blocks for
the file as "new" blocks if stashing cannot be satisfied. We may further
optimize by splitting them into smaller chunks so that most of them can
still be stashed.

Bug: 22430577
Change-Id: I5a49e361adc7d3d41de2e9c08ee9b08c1e6c091a
2015-08-17 10:21:49 -07:00
Tao Bao
6968a724a5 am 3a2e91ca: am 8765fca2: Merge "Free the stash after its use in BBOTA v2."
* commit '3a2e91cad7ec1309c07e9d96d572c6a0bed52346':
  Free the stash after its use in BBOTA v2.
2015-08-13 22:31:27 +00:00
Tao Bao
bb625d2099 Free the stash after its use in BBOTA v2.
In BBOTA v2, the stash size computation is inaccurate. A stash will be
used only once, so we deduct its size from stashed_blocks right after
its use. However, the stash doesn't actually get freed until being
overwritten by another stash or destroyed at the end of an update. This
leads to OTA failures due to insufficient space on /cache. This CL
changes the BBOTA v2 script to generate an explicit free right after
its use.

Bug: 23119955
Change-Id: Icdd8352bb0ff778945937c870990a888c7a4d38b
2015-08-13 14:44:38 -07: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
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
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
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
22354d3c49 Merge "Add support for system images that contain the root directory" 2015-08-01 00:10:02 +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
29d6fb24d7 am cce673b6: Read fstab from the source build.
* commit 'cce673b675fadb9e509779cec838a1b545126cc4':
  Read fstab from the source build.
2015-07-29 21:49:32 +00:00
Simon Wilson
37700c9ad1 Merge "Add compressor options for squashfs system images" 2015-07-29 21:35:57 +00:00
Tao Bao
cce673b675 Read fstab from the source build.
When creating incremental OTAs, we should always use the fstab from the
source build instead of the target.

Bug: 21948974
Change-Id: I8b6a18f64b412f782184f9d382544ed0ce093fb4
(cherry picked from commit dd24da9ec9)
2015-07-29 14:30:08 -07:00
Tao Bao
dd24da9ec9 Read fstab from the source build.
When creating incremental OTAs, we should always use the fstab from the
source build instead of the target.

Bug: 21948974
Change-Id: Iff44130f88a679b253ea1adcfac4ed8566ce9cc7
2015-07-29 14:11:55 -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
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
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
2ad55edfd6 am 0d4a9405: am ecb7b37b: Merge "Assert the stash size when generating OTAs."
* commit '0d4a9405938210618bb305e33285f555daf2fb5d':
  Assert the stash size when generating OTAs.
2015-07-14 23:07:15 +00:00
Tao Bao
8dcf738234 Assert the stash size when generating OTAs.
With block-based OTA v2 and v3, it requires stash space on the /cache
partition to back up blocks during an update. We need to ensure that
it doesn't exceed the partition size. Since there might be other files
on /cache as well, we use cache_size * threshold as the maximum allowed
size. The threshold defaults to 0.8, which can be overridden by command
line option '--stash_threshold'.

Change-Id: I5c2e353ea4716328d6cdc6a7f758520de8d88b8e
(cherry picked from commit 23ac404212)
2015-07-14 13:36:50 -07: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