Commit Graph

5503 Commits

Author SHA1 Message Date
Zhi An Ng fffa70a1b7 Merge "Fix order of args passed to mksquashfsimage.sh" am: 8eae9fc5f5
am: 7db3875c4c

Change-Id: I7c6ee9fad1665bfe72a3ae6bb50cb06c1a20c20a
2018-01-20 06:09:41 +00:00
Ng Zhi An 9446c1df98 Fix order of args passed to mksquashfsimage.sh
Bug: 72234456
Test: make systemimage
Change-Id: I1b4b07f0a488eade2f297fea12d02b6e8ccba7d8
2018-01-19 15:55:39 -08:00
Tao Bao 3bc775a4fc Merge "releasetools: Dump mkfs/fsck/simg2img outputs on error." am: 3221f0f387 am: c20b59eabe
am: ed184a50ea

Change-Id: If13865e513d12ad58e0874b6504ef777398df783
2018-01-19 22:48:17 +00:00
Tao Bao ed184a50ea Merge "releasetools: Dump mkfs/fsck/simg2img outputs on error." am: 3221f0f387
am: c20b59eabe

Change-Id: Iede2a76f87298fc0c389883b4e57d87d32968fb6
2018-01-19 22:45:34 +00:00
Treehugger Robot 3221f0f387 Merge "releasetools: Dump mkfs/fsck/simg2img outputs on error." 2018-01-19 22:35:47 +00:00
Tao Bao fabe08352c releasetools: Add PayloadSigner class.
Create a wrapper class that handles the payload signing, which unifies
the paths with and without external signer. Also add tests for the newly
added class.

The test keys under testdata/ are created with the script in
development/tools/make_key. testdata/testkey_with_passwd.pk8 uses
password "foo".

Test: python -m unittest test_ota_from_target_files
Test: Get identical A/B OTA packages w/ and w/o the CL.
Change-Id: Ic770aec726498a3babb88ec509985e7f1210fb18
2018-01-19 13:25:04 -08:00
Tao Bao de2fd74ebf Merge "releasetools: Clean up three functions in add_img_to_target_files.py." am: a5b48fcf7f am: 6ff60cee22
am: 96041d3435

Change-Id: I13d7b98f028652442889ca4d5003a4a1a3894a11
2018-01-19 20:47:22 +00:00
Tao Bao 4f47b05060 Merge "releasetools: Refactor AddImagesToTargetFiles()." am: 1eddcad909 am: 53c3f1589b
am: 8ede95e991

Change-Id: I6ae707a06e82b4e784c40ddb8902e6adf1fdca03
2018-01-19 20:46:15 +00:00
Tao Bao 96041d3435 Merge "releasetools: Clean up three functions in add_img_to_target_files.py." am: a5b48fcf7f
am: 6ff60cee22

Change-Id: I54d8ba7656c4fc1c4ca2b0454649ce66bc5ba185
2018-01-19 20:43:47 +00:00
Tao Bao 8ede95e991 Merge "releasetools: Refactor AddImagesToTargetFiles()." am: 1eddcad909
am: 53c3f1589b

Change-Id: Ibc2656d220cf0cdf8eb9947c928fd11736f30c86
2018-01-19 20:43:12 +00:00
Tao Bao cd53a89599 releasetools: Dump mkfs/fsck/simg2img outputs on error.
The output (stdout and stderr combined) would be helpful in understanding
the cause of the failure.

Not changing other occurrences in build_image.py yet, since it's less
obvious if a failed call should be considered fatal (thus whether to
dump such outputs). For example, GetVeritySize() simply returns 0 on
failed calls. They deserve further clean-ups in later CLs (with unit
tests).

Bug: 71864688
Test: Inject errors into mke2fs/e2fsck/simg2img. `m snod` prints outputs.
Test: `m snod` remains quiet on successful runs.
Change-Id: I172403f6cd05bce93767265dbcb110271a68e2a8
2018-01-19 11:15:42 -08:00
Tao Bao a2ff4c9b06 releasetools: Clean up three functions in add_img_to_target_files.py.
This CL makes the following changes:
 (a) cleans up the similar codes in AddCareMapTxtForAbOta() that handle
     'system' and 'vendor' partitions;
 (b) fixes an issue with the arcname in AddPackRadioImages() and
     AddRadioImagesForAbOta(), where forward slash should always be used
     in zip entry names;
 (c) refactors the branching statements in AddRadioImagesForAbOta() to
     reduce indentation levels.

Test: python -m unittest test_add_img_to_target_files
Test: `m dist` with aosp_marlin-userdebug. Check META/care_map.txt in the
      generated target_files.zip.
Change-Id: I3d6f794962d0c68390fbd18eb13c2622acab3ff5
2018-01-18 23:37:29 -08:00
Tao Bao bea20ac722 releasetools: Refactor AddImagesToTargetFiles().
Separate three functions out of AddImagesToTargetFiles(), into
AddCareMapTxtForAbOta(), AddRadioImagesForAbOta() and
AddPackRadioImages() respectively. This CL tries to apply minimal
changes for the refactoring purpose.

Also add tests for AddRadioImagesForAbOta() and AddPackRadioImages().
The tests for AddCareMapTxtForAbOta() require better testing support to
mock sparse_img.SparseImage, which will be added in later CLs.

Test: python -m unittest test_add_img_to_target_files
Test: `m dist` with aosp_marlin-userdebug. Check META/care_map.txt in
      the generated target_files.zip.
Change-Id: I1bb723c15237ff721f165cfce0ce996008ce9948
2018-01-18 23:37:23 -08:00
Tao Bao 9daf3419ba Merge "releasetools: Remove the reloading of target info dict." am: 13f228ebde am: 815a167ae4
am: ee3155c09c

Change-Id: I97f63a561634bb7ded0e0968e5751eaaaf60e5fa
2018-01-18 23:03:38 +00:00
Tao Bao ee3155c09c Merge "releasetools: Remove the reloading of target info dict." am: 13f228ebde
am: 815a167ae4

Change-Id: I416dfa299dd05980e11fb2e8b39bc68cb9cfb888
2018-01-18 23:01:30 +00:00
Treehugger Robot 13f228ebde Merge "releasetools: Remove the reloading of target info dict." 2018-01-18 22:48:15 +00:00
Andreas Gampe 59c837d0c3 Merge "Warn: Change GuardedBy regular expressions" am: 57923be123 am: 824dad93b0
am: e43c8a66d6

Change-Id: If1cec5fe75191a6181138352bbd66701d6fa520a
2018-01-18 10:45:01 +00:00
Andreas Gampe e43c8a66d6 Merge "Warn: Change GuardedBy regular expressions" am: 57923be123
am: 824dad93b0

Change-Id: I01bc932632d94e854c7eeb1bbaa750e2f85cac91
2018-01-18 10:35:56 +00:00
Andreas Gampe 7f494c121f Warn: Change GuardedBy regular expressions
This was modified in commits 20a8664 "Change canonical name for
GuardedByChecker to GuardedBy" and 1f6dc3dc "Merge GuardedByValidator
into GuardedByChecker."

Test: m
Test: manual
Change-Id: I07305e59694a955e52bd69c1cbe53346808b78aa
2018-01-17 21:28:21 -08:00
Tao Bao 7215d15542 Merge "releasetools: Add a note for the ZipInfo._decodeExtra() workaround." am: 65c90ca5b9 am: e88b90a9ad
am: 221df77fda

Change-Id: I49c4182dc2f4d511c6fcb176e8f6ce1c91c849c9
2018-01-17 20:10:51 +00:00
Tao Bao 221df77fda Merge "releasetools: Add a note for the ZipInfo._decodeExtra() workaround." am: 65c90ca5b9
am: e88b90a9ad

Change-Id: I8e099aaeae0b5b5221ea4281f4fd9693bb713d66
2018-01-17 20:08:15 +00:00
Tao Bao d32e78fd3c releasetools: Add a note for the ZipInfo._decodeExtra() workaround.
Test: N/A
Change-Id: I9e84fc27230182f17c2fda0df57a2c149281dcda
2018-01-17 10:10:00 -08:00
Tao Bao 058b7e157e Merge "releasetools: Consolidate the codes that generate metadata dict." am: 676c20f285 am: efbd0f881c
am: ffd8f6e439

Change-Id: Ic389d6c246e26719e9ada448b8f64d35a3da42fd
2018-01-17 02:13:41 +00:00
Tao Bao ffd8f6e439 Merge "releasetools: Consolidate the codes that generate metadata dict." am: 676c20f285
am: efbd0f881c

Change-Id: Ic47fdf387ed31ad5da3e1392be5d8f5511e31cb3
2018-01-17 02:04:32 +00:00
Tao Bao df3a48b43e releasetools: Consolidate the codes that generate metadata dict.
Now they (A/B, non-A/B full and non-A/B incremental) share the same
code. Also add tests for the newly added function.

Test: python -m unittest test_ota_from_target_files
Test: Build A/B and non-A/B packages respectively.
Change-Id: I5499dd9c683ac1a18d8a24f21ff8845fe69f343e
2018-01-16 15:34:27 -08:00
Tianjie Xu c6d7fc50c1 Merge "Iterate through the sorted file map when finding transfers" am: a7229a08b7 am: 0541a6a556
am: 5ed32ce7a0

Change-Id: I3e5a5985e98dfd3371591b5168bf846d7e5d12ac
2018-01-13 01:03:47 +00:00
Tianjie Xu 5ed32ce7a0 Merge "Iterate through the sorted file map when finding transfers" am: a7229a08b7
am: 0541a6a556

Change-Id: Idd384a1a089dc05a329b0e5e640d9cd4481e1ef7
2018-01-13 00:51:27 +00:00
Tianjie Xu a7229a08b7 Merge "Iterate through the sorted file map when finding transfers" 2018-01-13 00:01:03 +00:00
Tianjie Xu 20a86cdd8d Iterate through the sorted file map when finding transfers
This helps to generate a deterministic package.

Bug: 71770360
Test: Generate a incremental package and transfers are added by file name.
Change-Id: I7562a200b97a1babbb09a77801324cc9408cc01f
2018-01-12 12:21:00 -08:00
Tao Bao 2db1385db5 releasetools: Remove the reloading of target info dict.
In non-A/B OTA path, we've been loading the info dict for the target
build twice (once to have a peek at the OTA type, with a reload after
unzipping the target-files zip). Remove the reloading.

This CL moves the loading of the source info dict up a bit to avoid
having two copies in the A/B and non-A/B paths. It also moves up the
sanity checks of the loaded info dicts before unzipping the target-files
zips.

Test: Generate full and incremental packages for bullhead and marlin.
Change-Id: Iccb953feb0b6ecf62e6f73d6e9ceea00077d098d
2018-01-11 21:59:30 -08:00
Tao Bao 6c9202b6fd Merge "releasetools: Remove the fallback-to-full logic." am: 896fa043bc am: c6548f8df4
am: a4b102c012

Change-Id: Ifba99e3c52bc269fc1fe9999406aa6f8726e8eb7
2018-01-11 22:59:28 +00:00
Tao Bao e70cb693c4 Merge "releasetools: Remove two dead functions in ota_from_target_files.py." am: 155a140c82 am: 11348df23b
am: 8c7013631b

Change-Id: I0814587cbdf2cb50732b8e2f3bbc4acd0668ecc1
2018-01-11 22:58:39 +00:00
Tao Bao a4b102c012 Merge "releasetools: Remove the fallback-to-full logic." am: 896fa043bc
am: c6548f8df4

Change-Id: I339b96181b4887cbc726d2111fd109a086eb5001
2018-01-11 22:54:59 +00:00
Tao Bao 8c7013631b Merge "releasetools: Remove two dead functions in ota_from_target_files.py." am: 155a140c82
am: 11348df23b

Change-Id: I7f941e6ff93e002d27d98b9d6b39384fffae505a
2018-01-11 22:54:11 +00:00
Treehugger Robot 896fa043bc Merge "releasetools: Remove the fallback-to-full logic." 2018-01-11 22:24:36 +00:00
Treehugger Robot 155a140c82 Merge "releasetools: Remove two dead functions in ota_from_target_files.py." 2018-01-11 22:23:18 +00:00
Tianjie Xu f9ab3c6319 Merge "Sort the split transfers to generate a determinate package" am: c56071b21b am: 4c17a597d2
am: adffc700a8

Change-Id: I0fca63ca3de62b875042142afeaac09552f2bcb9
2018-01-11 05:26:01 +00:00
Tianjie Xu adffc700a8 Merge "Sort the split transfers to generate a determinate package" am: c56071b21b
am: 4c17a597d2

Change-Id: Iae594600273f8e424fd03b5469ea98072a50d13d
2018-01-11 05:18:28 +00:00
Tianjie Xu c56071b21b Merge "Sort the split transfers to generate a determinate package" 2018-01-11 04:15:28 +00:00
Tao Bao 175df38e6c releasetools: Remove two dead functions in ota_from_target_files.py.
GetBuildProp() and GetVendorBuildProp() have been factored into
BuildInfo class. These two functions were meant to be deleted in commit
481bab8d48.

Test: python -m unittest test_ota_from_target_files
Test: No users of these two functions.
Change-Id: Id590a46d597939973ef2339cdfea4f5163548d4d
2018-01-10 19:57:57 -08:00
Tao Bao 08df009083 Merge "releasetools: Add a BuildInfo class." am: b54f6157a4 am: 177f57df64
am: 82749884e4

Change-Id: I6a83b5d3c62b9cdb4ac2e020333a9b373ff0f4e9
2018-01-10 22:54:50 +00:00
Tao Bao 32b80dca9f releasetools: Remove the fallback-to-full logic.
The fallback-to-full logic doesn't look beneficial, but may hide away
real bugs, especially when it's on by default.

Test: Generate an incremental non-A/B OTA successfully.
Test: Inject bugs into script; observe that incremental OTA
      generation errors out instead of silently falling back.
Test: No internal users of the flag from code search.
Change-Id: Ifc627d898552c0bd72463e8c107e36610421608e
2018-01-10 14:03:16 -08:00
Tao Bao 82749884e4 Merge "releasetools: Add a BuildInfo class." am: b54f6157a4
am: 177f57df64

Change-Id: Id579d8dfffcc2ee6cb3009dce4b27568e2ace77d
2018-01-10 21:25:58 +00:00
Tao Bao b54f6157a4 Merge "releasetools: Add a BuildInfo class." 2018-01-10 20:37:41 +00:00
Tianjie Xu d3bf67e1d3 Sort the split transfers to generate a determinate package
We split large apks and generated patches for them in parallel,
resulting in nondeterminate packages between different runs. This CL
sort the split transfers by target name first; and then add them
sequentially to the final transfer list.

Also fix a side effect where we may generate a wrong sha1 for split
ranges due to synchronization error.

Bug: 71770360
Bug: 71759418

Test: Generate the package several times, compare the log and the transfer list.
Change-Id: I2a49e22594d59ffaa98b11edc776be4e3c4c561f
2018-01-10 12:23:57 -08:00
Tao Bao 481bab8d48 releasetools: Add a BuildInfo class.
Prior to this CL, we have similar codes in different paths
(WriteFullOTAPackage / WriteBlockIncrementalOTAPackage /
WriteABOTAPackageWithBrilloScript). This CL factors out the common codes
that deal with OEM-specific properties into BuildInfo class, and adds
tests for the new class.

Test: python -m unittest test_ota_from_target_files
Test: Create an incremental package that uses and doesn't use OEM
      properties respectively.
Test: Create a full package that uses and doesn't use OEM properties
      respectively.
Change-Id: Ida914cace12803d55396fa503bafcac2db2a520e
2018-01-09 15:08:23 -08:00
Elliott Hughes 3eca5d27ff Merge "adbs was broken for a year and no-one noticed." am: 5a436f10e5 am: 260b272319
am: 001396ba85

Change-Id: Ia0c08e5d41c6b7f924fc607ee4bc5582183bdad7
2018-01-09 01:52:48 +00:00
Elliott Hughes 001396ba85 Merge "adbs was broken for a year and no-one noticed." am: 5a436f10e5
am: 260b272319

Change-Id: Idcd7ebfda2f5b5351fee06762096004e322321ce
2018-01-09 00:54:43 +00:00
Elliott Hughes 1a701d93f9 adbs was broken for a year and no-one noticed.
Time to remove it.

Bug: https://b/15270043
Test: N/A
Change-Id: Idb56fc99c213732eca75f81ddd9d7a8a19374b42
2018-01-08 13:55:00 -08:00
Tao Bao cf6a42f055 Merge "releasetools: Add tests for common.ReadApkCerts()." am: e3692095a1 am: 05d63dc7b0
am: 19fc696154

Change-Id: Ia25dd1a17e71beb96885655ddc151715f97bc5e1
2018-01-06 01:06:40 +00:00
Tao Bao 19fc696154 Merge "releasetools: Add tests for common.ReadApkCerts()." am: e3692095a1
am: 05d63dc7b0

Change-Id: I9e849a806db2accc02c26c803f2054382eb18603
2018-01-06 00:59:47 +00:00
Treehugger Robot e3692095a1 Merge "releasetools: Add tests for common.ReadApkCerts()." 2018-01-05 23:30:53 +00:00
Tao Bao 818ddf5e7e releasetools: Add tests for common.ReadApkCerts().
Test: python -m unittest test_common
Test: Run sign_target_files_apks.py on a target with compressed APKs.
Change-Id: I107a8b8f2f0f82e2d1947f14c8a8b3778f633b11
2018-01-05 11:53:55 -08:00
Colin Cross abc4bb71db Merge changes I9fda7fe3,I0a34b2b4,Ie64a283d am: 96029a1276 am: e3d02af57d
am: 23ab1f1580

Change-Id: I1489f5725d252ddf6beb9bbc3a4123612466f64d
2018-01-05 06:32:28 +00:00
Colin Cross 23ab1f1580 Merge changes I9fda7fe3,I0a34b2b4,Ie64a283d am: 96029a1276
am: e3d02af57d

Change-Id: Iefd8871754f8aae4ca8de2468d2a3774e7ed76c0
2018-01-05 06:29:55 +00:00
Colin Cross 96029a1276 Merge changes I9fda7fe3,I0a34b2b4,Ie64a283d
* changes:
  Clear resource_export_package outside conditionals
  Fix adbs after move from build/tools to build/make/tools
  Use proguard.jacoco.flags for EMMA_INSTRUMENT_STATIC
2018-01-05 06:22:35 +00:00
Tao Bao 055dcc96f9 Merge "releasetools: Clean up build_image.py." am: 7c53288810 am: 7c8c39179a
am: 74713e35fe

Change-Id: I37753878ad7fe9994f4dfc3e0a1124d6ae751f7f
2018-01-04 22:35:02 +00:00
Tao Bao 74713e35fe Merge "releasetools: Clean up build_image.py." am: 7c53288810
am: 7c8c39179a

Change-Id: Ie760c6387ac9546edc8dc301ab664ecab96db58e
2018-01-04 22:30:06 +00:00
Tao Bao 550012ea79 Merge "releasetools: Move assertions into CheckHeadroom()." am: b050f66e42 am: 780be982a7
am: 000c76c68b

Change-Id: Idb98698d18da2797c862c5d1992cbb5044705287
2018-01-04 18:51:22 +00:00
Tao Bao 000c76c68b Merge "releasetools: Move assertions into CheckHeadroom()." am: b050f66e42
am: 780be982a7

Change-Id: I0848092782d30436885b3da3716e302e583da503
2018-01-04 18:47:17 +00:00
Colin Cross d31ff8ff32 Fix adbs after move from build/tools to build/make/tools
adbs broke when build/tools was moved to build/make/tools in
aosp/286781.

Bug: 15270043
Test: build/tools/adbs
Change-Id: I0a34b2b446f996bcc53a7dde6381402f8eed9bd0
2018-01-03 14:21:35 -08:00
Tao Bao c72727ac3f releasetools: Clean up build_image.py.
Mostly cosmetic changes, such as moving print statement to print
function. The only functional change is to wrap the file opening in
Append() with try statement, which would dump the error message as
needed.

Test: `m dist`
Test: python -m unittest test_build_image
Change-Id: I4e6c593517cf737bfcbe51bc533b22a247b10e44
2018-01-03 11:52:28 -08:00
Tao Bao d8a953d7ab releasetools: Move assertions into CheckHeadroom().
Assert the input arguments inside CheckHeadroom() function, and add
matching tests. Also use common.MakeTemp{File,Dir} in tests.

Test: `m dist`
Test: python -m unittest test_build_image
Change-Id: Ib45f24651af9591a9cfdd72aac3558f6c9a80f44
2018-01-03 11:52:16 -08:00
Tao Bao 29a2cc5803 Merge "releasetools: Clean up ReplaceVerityKeyId and add tests." am: b35128521d am: 2a0f657c56
am: 413a88b386

Change-Id: I50d530fe8a262f601adf61755a42bf19d0c7f75a
2018-01-03 19:52:01 +00:00
Tao Bao 413a88b386 Merge "releasetools: Clean up ReplaceVerityKeyId and add tests." am: b35128521d
am: 2a0f657c56

Change-Id: I0da4fccfbf7d6873de59e5a019cb13f3414e3b40
2018-01-03 19:46:56 +00:00
Tao Bao b601efd8b9 Merge "releasetools: Add common.MakeTempDir()." am: ec728cbad0 am: 043544035e
am: 9c097cf8a7

Change-Id: I5ac425d41656de9cc6cbba89e6859772ea8718f8
2018-01-02 23:43:44 +00:00
Tao Bao 9c097cf8a7 Merge "releasetools: Add common.MakeTempDir()." am: ec728cbad0
am: 043544035e

Change-Id: I1ac5a296f9af4b3989642e1bf6cfc623fa72404f
2018-01-02 23:37:38 +00:00
Tao Bao e838d1446c releasetools: Clean up ReplaceVerityKeyId and add tests.
Test: python -m unittest test_sign_target_files_apks
Test: Run sign_target_files_apks.py on marlin target_files.zip.
Change-Id: Ic3c3f4f14c73f8f8e48a8341e024e0861e665989
2018-01-02 12:29:31 -08:00
Tao Bao 1c830bfbaa releasetools: Add common.MakeTempDir().
This simplifies the work to track mkdtemp()'d dirs. This CL also cleans
up the temporary file creation in build_image.py.

Test: `m dist`
Test: python -m unittest test_common
Change-Id: Ied7d86126714b9b26e5df7bcca1dfdea21cfcf60
2018-01-02 12:22:01 -08:00
Tao Bao 7eb7637f6b Merge "releasetools: Clean up sign_target_files_apks.py." am: 7d100ce03b am: 336f2cce7d
am: 2b8f63693e

Change-Id: Iad866e0a5dd3ab2257f19fab3511ecda88de3285
2018-01-02 20:09:58 +00:00
Tao Bao 192101a6e8 Merge "releasetools: Fix a bug in blockimgdiff.HeapItem." am: a5e3a258fd am: 442be8f1e5
am: 3859f0d09f

Change-Id: I9dcb7c9d444512c27324e932093b5036c9c57311
2018-01-02 20:05:57 +00:00
Tao Bao 2b8f63693e Merge "releasetools: Clean up sign_target_files_apks.py." am: 7d100ce03b
am: 336f2cce7d

Change-Id: Idb8b486616222a809e34d61d721e8f3f2a6d41ae
2018-01-02 20:05:56 +00:00
Tao Bao 3859f0d09f Merge "releasetools: Fix a bug in blockimgdiff.HeapItem." am: a5e3a258fd
am: 442be8f1e5

Change-Id: I81040b7cb4acbd4ea791a0eb9b251b8d39cabfe3
2018-01-02 20:02:22 +00:00
Treehugger Robot 7d100ce03b Merge "releasetools: Clean up sign_target_files_apks.py." 2018-01-02 19:56:03 +00:00
Tao Bao 0c28d2d02d releasetools: Clean up sign_target_files_apks.py.
Mostly cosmetic changes, such as replacing print statement with print
function. Also change 'import cStringIO' to optionally look for the one
in io module, to allow Python 2/3 compatibility.

Test: pylint --rcfile=pylintrc sign_target_files_apks.py
Test: Run sign_target_files_apks.py on marlin target_files.zip.
Change-Id: I4dc98b01da6f89e624114bbca5522f659901c1f2
2018-01-02 09:57:29 -08:00
Tao Bao 186ec99eb9 releasetools: Fix a bug in blockimgdiff.HeapItem.
HeapItem defines __bool__(), which contains a logical error that should
return the opposite value.

Note that the bug only manifests while using Python 3, which calls
__bool__(). With Python 2, `if x:` or bool(x) actually calls
x.__nonzero__() or x.__len__(). If a class defines neither __len__() nor
__nonzero__(), as the case in HeapItem, it always returns True.

Test: python -m unittest test_blockimgdiff
Test: python3 -m unittest test_blockimgdiff
Test: Generate an incremental non-A/B OTA package successfully.
Change-Id: Ibe8430e0b495a7d2f430cfffb716d2536ffb53d2
2018-01-02 09:54:32 -08:00
Dan Shi 5a96e18528 Merge "Test config should use manifest package attribute" am: a6c3cece9e am: 4647f8125a
am: 7abb8ccbca

Change-Id: I0926bcf899c022dd17afd5ecdaba6d327e070e3f
2017-12-22 23:46:52 +00:00
Dan Shi 7abb8ccbca Merge "Test config should use manifest package attribute" am: a6c3cece9e
am: 4647f8125a

Change-Id: Ie0ede8acaf7085c0312f5305ad6c7b54fd8a09aa
2017-12-22 23:41:46 +00:00
Dan Shi 9a50168c85 Test config should use manifest package attribute
Bug: 70981774,69929803
Test: m -j SetupWizardActivityTests
Change-Id: I6d50744504eac71d6ecae5db9b14e6d30eb923fe
2017-12-22 13:34:50 -08:00
Tao Bao da7adc9f58 Merge "releasetools: Remove the dead code for blockimgdiff_version <= 2." am: be8ea6ec11 am: d052700179
am: b4a93bd4c8

Change-Id: Ia7f89941d7df6b93443e3ed019beab80cea3fb76
2017-12-21 22:48:59 +00:00
Tao Bao b4a93bd4c8 Merge "releasetools: Remove the dead code for blockimgdiff_version <= 2." am: be8ea6ec11
am: d052700179

Change-Id: I7108f50d08d13026a5dd414f74f069714b9cf793
2017-12-21 22:37:13 +00:00
Dan Shi 12e5732070 Merge "Auto generate test config files" am: 3c28ff7bff am: 4ccd1a5a00
am: 26201a4d44

Change-Id: Id65ca55a8031ae354a8c98b3c59c02fcc6de276c
2017-12-21 22:30:46 +00:00
Dan Shi 26201a4d44 Merge "Auto generate test config files" am: 3c28ff7bff
am: 4ccd1a5a00

Change-Id: Ibc089081ab2925f8e3453eddf8c64d81d3b49596
2017-12-21 22:25:40 +00:00
Tao Bao be8ea6ec11 Merge "releasetools: Remove the dead code for blockimgdiff_version <= 2." 2017-12-21 22:20:32 +00:00
Dan Shi 3c28ff7bff Merge "Auto generate test config files" 2017-12-21 21:53:12 +00:00
Tao Bao 0582cb639f releasetools: Remove the dead code for blockimgdiff_version <= 2.
The code is on infeasible path since we already have assertions in
common.BlockDifference().

Also remove the dead code that checks for OPTIONS.info_dict, as we
already set that in ota_from_target_files.main(), for both of A/B and
non-A/B.

Test: Generate incremental OTAs w/ and w/o the CL, and get identical
      packages.
Change-Id: Ifb8fc101e78f5ce58c60c8e49028b66ce0d20246
2017-12-21 11:53:27 -08:00
Tao Bao 8393ee7722 Merge "releasetools: Fix the bug that skips loading OEM dict." am: 7889375102 am: 80fb79f200
am: a61ffc1291

Change-Id: I3bcaf431c53b8ae82357f71ef41907297cd885fc
2017-12-21 19:21:57 +00:00
Tao Bao a61ffc1291 Merge "releasetools: Fix the bug that skips loading OEM dict." am: 7889375102
am: 80fb79f200

Change-Id: Iac9c5c63886406aed585fe09c1ee9ba060a6a6cb
2017-12-21 18:01:30 +00:00
Tao Bao 2f5358d38b releasetools: Fix the bug that skips loading OEM dict.
The CL in [1] unintentionally breaks the OEM dict loading logic in the
incremental BBOTA path. We should always require and load the OEM
property dict if _either_ of the source and target builds uses OEM
properties. Otherwise with the current "and" operator, it skips loading
the OEM property dict and thus fails to generate an OTA package that has
OEM property changes (e.g. updating from build with fingerprint to
another one using thumbprint).

The CL in [1] actually makes the right change in the file-based OTA
path, but introduces the bug in the block-based OTA path.

This CL also cleans up the line that reads recovery_mount_options.

[1] commit 7f804ba71f ("releasetools:
allow for multiple OEM property values.").

Test: Genearte an OTA that has OEM property changes successfully.
Change-Id: Idce4ad59825d432618535ce09ab22bd7ddc524f2
2017-12-20 23:06:02 -08:00
Dan Shi efb892d858 Auto generate test config files
This change allows one to run atest <module name>. The TradeFed test
config file will be automatically created in testcases directory based
on the settings.

Bug: 69929803, 69932044
Test: m -j NotificationStressTests libminijail_test
add following lines in notificationtests/Android.mk,
before "include $(BUILD_PACKAGE)"
LOCAL_COMPATIBILITY_SUITE := general-test

Change-Id: Ib5e9cd152d957b5d5beb6ed23a899a021a7e06d6
2017-12-20 15:05:17 -08:00
Tao Bao ccb1781cb2 Merge "build_image: Factor out CheckHeadroom() and add tests." am: b379762089 am: 0642ea4b4f
am: cdc134d19b

Change-Id: I3136ad92d600700dacc1c6fcffab3c571d4e4a0c
2017-12-19 01:02:08 +00:00
Tao Bao cdc134d19b Merge "build_image: Factor out CheckHeadroom() and add tests." am: b379762089
am: 0642ea4b4f

Change-Id: I50590620a32444c086d2b24390680d14c2f643c0
2017-12-19 00:46:56 +00:00
Treehugger Robot b379762089 Merge "build_image: Factor out CheckHeadroom() and add tests." 2017-12-19 00:00:41 +00:00
Tao Bao 9a4d2ddcec Merge "releasetools: Fix the tag replacement for ro.build.vendor.fingerprint." am: b08567cbb6 am: 1296fef56c
am: e2ab3d5c32

Change-Id: Icca5ed5716c11357a467be146d772d6b5b633eda
2017-12-18 22:32:25 +00:00
Tao Bao 90a2bcc3e0 Merge "Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS." am: d30b75190d am: 4d45f51596
am: 3652c0ba76

Change-Id: I3cd249a50eea521d019ed9b2745a62dd850df537
2017-12-18 22:31:32 +00:00
Tao Bao e2ab3d5c32 Merge "releasetools: Fix the tag replacement for ro.build.vendor.fingerprint." am: b08567cbb6
am: 1296fef56c

Change-Id: I39a7e18ed09902e001de264d2503e5ca93e43927
2017-12-18 22:28:59 +00:00
Tao Bao 3652c0ba76 Merge "Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS." am: d30b75190d
am: 4d45f51596

Change-Id: Id6da54fe3f1cd4ebba63de849a065ffcd53b261e
2017-12-18 22:27:57 +00:00
Treehugger Robot b08567cbb6 Merge "releasetools: Fix the tag replacement for ro.build.vendor.fingerprint." 2017-12-18 22:18:14 +00:00
Treehugger Robot d30b75190d Merge "Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS." 2017-12-18 22:17:46 +00:00
Tao Bao 8bd79a118d Merge "releasetools: Use delta_generator to verify payload signatures." am: e58d385df1 am: cbece24e6e
am: e6f267c4f3

Change-Id: I166bf85dadeda1f1c719e8d09160d74a3c978004
2017-12-15 23:52:17 +00:00
Tao Bao e6f267c4f3 Merge "releasetools: Use delta_generator to verify payload signatures." am: e58d385df1
am: cbece24e6e

Change-Id: Id7dff799f84acc58008544b48e8b79d9cc2a1c21
2017-12-15 23:49:43 +00:00
Treehugger Robot e58d385df1 Merge "releasetools: Use delta_generator to verify payload signatures." 2017-12-15 23:38:12 +00:00
Tao Bao 5029b5f2e3 Merge "releasetools: Remove the support for generating verify package." am: e2ffc8b887 am: 12fafaccc0
am: b1cc1ed1a7

Change-Id: I8a634d3f14c9869c4f1bbfe1499d961a60e64637
2017-12-15 22:13:21 +00:00
Tao Bao b1cc1ed1a7 Merge "releasetools: Remove the support for generating verify package." am: e2ffc8b887
am: 12fafaccc0

Change-Id: I06cf6990379e5e92c33a151bdc6a96ca6fbb7528
2017-12-15 22:08:56 +00:00
Tao Bao 750385e455 releasetools: Use delta_generator to verify payload signatures.
We used to take a hard approach by parsing the payload with Python
script. This can be done by calling deleta_generator directly, which
also avoids the dependency on protobuf.

- Passing case
$ ./build/make/tools/releasetools/check_ota_package_signature.py \
    build/target/product/security/testkey.x509.pem \
    out/dist/aosp_marlin-ota-eng.zip

Package: out/dist/aosp_marlin-ota-eng.zip
Certificate: build/target/product/security/testkey.x509.pem
  ...
Whole package signature VERIFIED

Verifying A/B OTA payload signatures...
[1215/122842:INFO:generate_delta_main.cc(171)] Verifying signed payload.
[1215/122845:INFO:payload_verifier.cc(93)] signature blob size = 264
[1215/122845:INFO:payload_verifier.cc(112)] Verified correct signature 1 out of 1 signatures.
[1215/122845:INFO:payload_verifier.cc(93)] signature blob size = 264
[1215/122845:INFO:payload_verifier.cc(112)] Verified correct signature 1 out of 1 signatures.
[1215/122845:INFO:generate_delta_main.cc(181)] Done verifying signed payload.

Payload signatures VERIFIED

$ echo $?
0

- Failing case
Sign the whole package file with a different key, but leaving payload entries intact.

$ ./build/make/tools/releasetools/check_ota_package_signature.py \
    testkey2.x509.pem \
    marlin-ota-mismatching.zip
Package: marlin-ota-mismatching.zip
Certificate: testkey2.x509.pem
  ...
Whole package signature VERIFIED

Verifying A/B OTA payload signatures...
[1215/123054:INFO:generate_delta_main.cc(171)] Verifying signed payload.
[1215/123056:INFO:payload_verifier.cc(93)] signature blob size = 264
[1215/123056:ERROR:payload_verifier.cc(118)] None of the 1 signatures is correct. Expected:
[1215/123056:INFO:utils.cc(444)] Logging array of length: 256
[1215/123056:INFO:utils.cc(461)] 0x00000000 : 00 01 ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  ...
[1215/123056:ERROR:payload_verifier.cc(121)] But found decrypted hashes:
[1215/123056:INFO:utils.cc(444)] Logging array of length: 256
[1215/123056:INFO:utils.cc(461)] 0x00000000 : 52 68 78 36 f6 9e cd 2d 5e 9f 31 d5 26 03 c9 aa
  ...
[1215/123056:ERROR:payload_signer.cc(333)] PayloadVerifier::VerifySignature( signature_blob, public_key_path, payload_hash) failed.
[1215/123056:INFO:generate_delta_main.cc(177)] VerifySignedPayload failed

    ERROR: Failed to verify payload with delta_generator: marlin-ota-mismatching.zip

$ echo $?
1

Bug: 65261072
Test: See above.
Change-Id: Id2e065655ec49b80dd2b13c6a859f41913be055b
2017-12-15 12:45:09 -08:00
Tao Bao 0c6a414fff releasetools: Remove the support for generating verify package.
We used to have "--gen_verify" that would generate a verify package for
non-A/B devices. Since a) we don't have active users; b) it works with
non-A/B only; c) we have better alternatives (e.g. using fastboot to
compute the partition checksum), this CL removes the support.

Test: `m dist`
Change-Id: Ib4a2c8c2a0394b54e66c106089aa52a0b900f034
2017-12-15 10:20:52 -08:00
Tao Bao 386bec6f65 Merge "releasetools: Add common.ZipDelete()." am: 23f7ea9e70 am: 2bc1b967c1
am: 30e4e2d154

Change-Id: I2f11543a64aba731335756ae3cf7142d21e3ae76
2017-12-15 16:48:30 +00:00
Tao Bao 30e4e2d154 Merge "releasetools: Add common.ZipDelete()." am: 23f7ea9e70
am: 2bc1b967c1

Change-Id: I83f428a689f970b6df5ee332115a8f5ee51b4fd1
2017-12-15 16:45:25 +00:00
Tao Bao 23f7ea9e70 Merge "releasetools: Add common.ZipDelete()." 2017-12-15 16:36:55 +00:00
Tao Bao 89d7ab23e8 releasetools: Add common.ZipDelete().
We have been shelling out to 'zip -d' to delete existing ZIP entries in
add_img_to_target_files.py. This CL moves the function into common.py,
and calls that for the similar work in ota_from_target_files.py. This CL
also adds unittests for the newly added function.

Test: `m dist`
Test: python -m unittest test_common
Test: ota_from_target_files.py generates identical packages w/ and w/o
      the CL (so we know the streaming property computation is intact).
Test: Run 'add_img_to_target_files.py -a' that triggers a call to
      ReplaceUpdatedFiles().
Change-Id: Icaa6c3ea3ee2166023f78fa79275295f837ea842
2017-12-14 17:17:04 -08:00
Tao Bao 3491da7bbd Merge "releasetools: Remove '-w' from ota_from_target_files options." am: 78b5724622 am: 8baa6d4dcd
am: 4e71a6caff

Change-Id: I06e4cab17324744d5c35fdb0a2177f633c7229a5
2017-12-14 22:33:03 +00:00
Tao Bao 4e71a6caff Merge "releasetools: Remove '-w' from ota_from_target_files options." am: 78b5724622
am: 8baa6d4dcd

Change-Id: Ifb3e88d45e985cb20ef8b8cf763bb3c2b834ac0c
2017-12-14 22:28:22 +00:00
Treehugger Robot 78b5724622 Merge "releasetools: Remove '-w' from ota_from_target_files options." 2017-12-14 22:18:56 +00:00
Przemyslaw Szczepaniak 6686e51b75 Merge "Add PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION" 2017-12-13 10:15:46 +00:00
Colin Cross 426ecd0f60 Merge "Replace build/tools with build/make/tools" am: 973301af79 am: e6dc6b2026
am: eb6c8444a6

Change-Id: I14d033658d219e81790ab1e730b7e477c70f4a13
2017-12-13 03:03:47 +00:00
Colin Cross eb6c8444a6 Merge "Replace build/tools with build/make/tools" am: 973301af79
am: e6dc6b2026

Change-Id: Ie3eb9e2b411603f95f91cac79ebe56eb78423da3
2017-12-13 02:49:40 +00:00
Treehugger Robot 973301af79 Merge "Replace build/tools with build/make/tools" 2017-12-13 02:34:42 +00:00
Przemyslaw Szczepaniak e554015b3a Add PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION
Exposed as ro.build.version.min_supported_target_sdk build_property

Test: make
Bug: 63926630
Change-Id: I8084fd4c54d9c2fb5e2683430e2b3aaf4c5f4a7a
2017-12-11 10:45:45 +00:00
Tao Bao a7054eede1 releasetools: Fix the tag replacement for ro.build.vendor.fingerprint.
For devices using derived fingerprint (i.e. /system/build.prop doesn't
contain ro.build.fingerprint, but has ro.build.thumbprint instead), the
current code (in android.os.Build) doesn't have a matching logic to do
the same for ro.vendor.build.fingerprint. This means we will see
ro.build.thumbprint in /system/build.prop, while there's no matching
ro.vendor.build.thumbprint in /vendor/build.prop.

From signing script point of view, it should just apply the tag
replacement (e.g. test-keys -> release-keys) for whatever it sees when
signing a target_files.zip.

This CL also adds unit tests for EditTags() and RewriteProps().

Fixes: 27950003
Test: Use 'sign_target_files_apks.py' to sign a target that uses derived
      fingerprint and vendor partition. Check VENDOR/build.prop.
Test: python -m unittest test_sign_target_files_apks
Change-Id: I09019da970840cd82f54b68a32b4e94984bc1d8d
2017-12-08 15:19:47 -08:00
Jaegeuk Kim 6149ea8637 Merge "core, release: add sload.f2fs for otatools.zip" am: 10c9f5d9d3 am: a5a2f10d79
am: cc1d0c982e

Change-Id: I6a40d04c8935627f75ccf13b467bc96e63bfb2ee
2017-12-08 17:00:37 +00:00
Tao Bao d4349f2106 build_image: Factor out CheckHeadroom() and add tests.
The test is mostly trivial, but it ensures the result parsing from
actual calls to mke2fs.

Test: python -m unittest test_build_image
Test: `m dist` on aosp_marlin-userdebug (w/ and w/o defining
      PRODUCT_SYSTEM_HEADROOM respectively).
Change-Id: I8b9964213950e76f6d7d5518414a1bab888b4706
2017-12-07 23:39:56 -08:00
Jaegeuk Kim cc1d0c982e Merge "core, release: add sload.f2fs for otatools.zip" am: 10c9f5d9d3
am: a5a2f10d79

Change-Id: Icbca3310a938e2c48d4e82c2dd1454fec2a05c92
2017-12-08 01:13:43 +00:00
Elliott Hughes ef40ea28a6 Merge "Explain why BuildImage failed." am: 9a33b96103 am: 76eb8e10ee
am: 20742517b4

Change-Id: Icee1c13e2dc8980ee697395b51e758c69e4b3cdf
2017-12-08 01:01:26 +00:00
Jaegeuk Kim 10c9f5d9d3 Merge "core, release: add sload.f2fs for otatools.zip" 2017-12-08 00:57:42 +00:00
Colin Cross baae1f3054 Merge "Add java modules to soong_to_convert.txt" am: fedcf41cc3 am: 2ea0ecdbfe
am: f2b5f371ff

Change-Id: I2598404303edb51e31aa45a864c657e08513ba29
2017-12-08 00:30:39 +00:00
Tao Bao 79d52f8798 Remove the support for BOARD_HAS_EXT4_RESERVED_BLOCKS.
This is only used in file-based OTA, where we may reserve space on
/system partition. With the deprecation of file-based OTA since O, the
code has become obsolete.

Test: `m dist`
Change-Id: I2bd686b292f93b566fe28a2bcd74c564ffc75dac
2017-12-07 14:36:21 -08:00
Elliott Hughes 20742517b4 Merge "Explain why BuildImage failed." am: 9a33b96103
am: 76eb8e10ee

Change-Id: I4d9e5dc5050d3826c02a033f856c34b0d397b6b0
2017-12-07 22:18:13 +00:00
Treehugger Robot 9a33b96103 Merge "Explain why BuildImage failed." 2017-12-07 21:45:59 +00:00
Colin Cross f2b5f371ff Merge "Add java modules to soong_to_convert.txt" am: fedcf41cc3
am: 2ea0ecdbfe

Change-Id: I0f5fd1e4fad03118989341b7b4de80c7ea4288c6
2017-12-07 08:27:52 +00:00
David Zeuthen 6fc59b3328 Merge "AVB: If building recovery.img, add AVB hash footer." am: 7b2129f101 am: 0c1c47f700
am: 3f41c5ff1f

Change-Id: If58ddd497c7b6e8a661cbc312bd519796fbfd5b3
2017-12-07 03:37:04 +00:00
David Zeuthen 3f41c5ff1f Merge "AVB: If building recovery.img, add AVB hash footer." am: 7b2129f101
am: 0c1c47f700

Change-Id: I5adecf2f45d308312c545509fd80658f00755883
2017-12-07 02:17:17 +00:00
Colin Cross fdea893833 Replace build/tools with build/make/tools
Test: m checkbuild
Change-Id: I8db6c27a6d2372f142d10568fe92d6f2e9a59252
2017-12-06 16:12:40 -08:00
David Zeuthen 0c1c47f700 Merge "AVB: If building recovery.img, add AVB hash footer."
am: 7b2129f101

Change-Id: I6b95aeb50a99a41831af4aa6374df3a6e8309ca4
2017-12-06 23:59:52 +00:00
Tao Bao 337633f2b9 releasetools: Remove '-w' from ota_from_target_files options.
'-w' is a short option for '--wipe_user_data', which happens to be the
same as the whole-file signing flag for signapk.

This CL removes the short version to make it less error-prone. Users
should use '--wipe_user_data' to generate packages with enforced data
wipe.

Bug: 70259309
Test: ota_from_target_files.py generates packages with and without
      '--wipe_user_data'.
Test: Not seeing active users that uses 'ota_from_target_files -w'.
Change-Id: Ib8c138663a87aafc6a0b5b6f7c286fb74ef6134b
2017-12-06 15:47:03 -08:00
Colin Cross 3277ba34ae Add java modules to soong_to_convert.txt
Test: examine soong_to_convert.txt
Change-Id: Ibb6db664238a4e98f5d8885dfb3ddc0f35d11ff6
2017-12-06 15:38:52 -08:00
Xin Li 5f03da0404 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:30 +00:00
Treehugger Robot 7b2129f101 Merge "AVB: If building recovery.img, add AVB hash footer." 2017-12-06 22:12:25 +00:00
Elliott Hughes 73ff57f48a Explain why BuildImage failed.
BuildImage can return false for lots of reasons. Log two of the more
plausible ones. You'll still need to edit this file and pass True to
RunCommand to work out *what* went wrong, but at least this logging will
tell you *where* things went wrong.

Bug: http://b/63142920
Test: debugged my actual problem
Change-Id: If84427058108dcac0a1b5e2216b8bb11eef522ca
2017-12-06 12:16:39 -08:00
Tao Bao 84b94b2ac7 Merge "releasetools: Address pylint warnings in add_img_to_target_files.py." am: 32c6c4a11e am: 9ad68d6e69
am: 8c689d845c

Change-Id: Iaf5da848706bdc9c72a651464cd72caae0e43a1a
2017-12-05 22:13:52 +00:00
Tao Bao 8c689d845c Merge "releasetools: Address pylint warnings in add_img_to_target_files.py." am: 32c6c4a11e
am: 9ad68d6e69

Change-Id: I796b8ee82aa2bda2f2633f434808dd519cc676f5
2017-12-05 22:07:49 +00:00
Tao Bao 9ad68d6e69 Merge "releasetools: Address pylint warnings in add_img_to_target_files.py."
am: 32c6c4a11e

Change-Id: I4e1d8ad1c6982f969b759f26cf1cb59862bd236f
2017-12-05 22:02:40 +00:00
Jaegeuk Kim 2ea1eba98c core, release: add sload.f2fs for otatools.zip
This also updates mkf2fsuserimg.sh to call sload.f2fs.

Change-Id: I245f6b3dfcd966fbc6783329d781375879fcd065
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-12-05 10:59:50 -08:00
Tao Bao aeec69ced4 Merge "releasetools: Remove deprecated pylint options." am: 3694e104b7 am: ead6281575
am: 97b4ef1583

Change-Id: I0d21d16c451cf221f1c97a83a78d520c694e5b07
2017-12-05 18:57:11 +00:00
Tao Bao 97b4ef1583 Merge "releasetools: Remove deprecated pylint options." am: 3694e104b7
am: ead6281575

Change-Id: Ic49bd5d63cdd738f22dbad1dbbf3d9ab2837db49
2017-12-05 18:52:12 +00:00
Tao Bao ead6281575 Merge "releasetools: Remove deprecated pylint options."
am: 3694e104b7

Change-Id: I87a9d6b07dc281bacc99e2935f0835958c3d67b5
2017-12-05 18:45:56 +00:00
Tao Bao 6b9fef5243 releasetools: Address pylint warnings in add_img_to_target_files.py.
C:661, 0: Wrong hanging indentation (add 2 spaces).
        OPTIONS.input_tmp, "VENDOR_IMAGES")
        ^ | (bad-continuation)
C:673, 0: Wrong continued indentation (add 14 spaces).
                os.path.join("IMAGES", img_name))
                ^             | (bad-continuation)
C: 54, 0: Import "import datetime" should be placed at the top of the module (wrong-import-position)
C: 55, 0: Import "import hashlib" should be placed at the top of the module (wrong-import-position)
C: 56, 0: Import "import os" should be placed at the top of the module (wrong-import-position)
C: 57, 0: Import "import shlex" should be placed at the top of the module (wrong-import-position)
C: 58, 0: Import "import shutil" should be placed at the top of the module (wrong-import-position)
C: 59, 0: Import "import subprocess" should be placed at the top of the module (wrong-import-position)
C: 60, 0: Import "import tempfile" should be placed at the top of the module (wrong-import-position)
C: 61, 0: Import "import uuid" should be placed at the top of the module (wrong-import-position)
C: 62, 0: Import "import zipfile" should be placed at the top of the module (wrong-import-position)
C: 64, 0: Import "import build_image" should be placed at the top of the module (wrong-import-position)
C: 65, 0: Import "import common" should be placed at the top of the module (wrong-import-position)
C: 66, 0: Import "import rangelib" should be placed at the top of the module (wrong-import-position)
C: 67, 0: Import "import sparse_img" should be placed at the top of the module (wrong-import-position)
W:391,12: Redefining built-in 'dir' (redefined-builtin)

After this CL, it still gives the warning below, which is to be
addressed with follow-ups.

R:635, 2: Too many nested blocks (6/5) (too-many-nested-blocks)

Test: `m dist`
Test: pylint --rcfile=pylintrc add_img_to_target_files.py
Change-Id: I64da184b6b69e93449dbfc989a5d7f46d5223f42
2017-12-04 12:15:35 -08:00
Tao Bao dac0c88d9d releasetools: Remove deprecated pylint options.
This option u'required-attributes' will be removed in Pylint 2.0
This option u'ignore-iface-methods' will be removed in Pylint 2.0

Test: pylint (1.6.5) no longer gives above warnings.
Change-Id: Ib07cd5aef87407260140c1fca0b11c439cbdf390
2017-12-04 12:15:23 -08:00
David Zeuthen 8fecb289ee AVB: If building recovery.img, add AVB hash footer.
In some non-A/B setups, recovery.img is still being used. If AVB is
enabled, we currently don't add a hash footer to recovery.img nor do
we include the hash digest in vbmeta.img. This CL fixes that.

This was tested on a build with the following settings

 TARGET_NO_RECOVERY := false
 BOARD_USES_RECOVERY_AS_BOOT := false
 BOARD_BUILD_SYSTEM_ROOT_IMAGE := false
 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 33554432
 BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS := --prop foo:bar

and then it was verified using 'avbtool info_image' that recovery.img
has a hash footer and a 'foo' property with the value 'bar'. This was
also checked successfully for vbmeta.img.

Test: See above.
Bug: None
Change-Id: I98124d5661ea768411416fa8d2a2ae6cc664fdc8
2017-12-04 13:54:38 -05:00
Dan Willemsen f4505a095a Fix / suppress warnings for clang+mingw am: 25c73e9156 am: 9be8a79255
am: 215b6bddbe

Change-Id: I6822c72da477cb691b387009e6c3da40af21d12e
2017-11-30 08:19:36 +00:00
Dan Willemsen 215b6bddbe Fix / suppress warnings for clang+mingw am: 25c73e9156
am: 9be8a79255

Change-Id: I5a625aa5dcaebd9255cd9b8808ec859a9c672531
2017-11-30 08:15:30 +00:00