Commit Graph

6093 Commits

Author SHA1 Message Date
Baligh Uddin b3517c0d18 Add ability to sign bundled APEX into device signing process.
Bug: 123716522
Change-Id: I58a8b03e5a636338317302f254403c88dec61f8c
2019-02-27 12:00:40 -08:00
Bill Peckham 3a21cc6a50 Merge "Extract common.UnzipToDir, invoke that from merge_target_files.py" am: a2f536f9fa am: 0ea998133c
am: 5f2ae4e685

Change-Id: Ife1cc6f0fdca99c27aed06b69d7d371e73b098e2
2019-02-25 22:25:12 -08:00
Bill Peckham 0ea998133c Merge "Extract common.UnzipToDir, invoke that from merge_target_files.py"
am: a2f536f9fa

Change-Id: I10fcfc3008d0699c92c53405d488c66571ef66ec
2019-02-25 15:55:39 -08:00
Bill Peckham d8c9c2d58f Merge "Convert common.RunAndWait method to raise an exception on subprocess failure." am: dd4e2e59aa am: ecd47a1991
am: 108afbcde6

Change-Id: Ic1b389d8114229aaa3d45ebdcdfb74f4ebad85b3
2019-02-22 20:52:42 -08:00
Bill Peckham 108afbcde6 Merge "Convert common.RunAndWait method to raise an exception on subprocess failure." am: dd4e2e59aa
am: ecd47a1991

Change-Id: Ie0609d3e09dcc060bb98b9b67d70a7128e6da420
2019-02-22 20:37:30 -08:00
Xin Li 1cc579adef Merge "DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master" into stage-aosp-master 2019-02-23 00:39:21 +00:00
Bill Peckham 8ff3fbdd08 Extract common.UnzipToDir, invoke that from merge_target_files.py
This change adds another utility function to common.py: UnzipToDir, which is
generally useful. Refactor merge_target_files.py to use it, and also refactor
other uses in common.py to use it.

Test: ota_from_target_files.py, validate_target_files.py, test_common.py
Bug: 124464492
Change-Id: Ia571070bceb7d3c8002304836bdf688485bf0dd9
2019-02-22 10:57:43 -08:00
Bill Peckham 889b0c6b09 Convert common.RunAndWait method to raise an exception on subprocess failure.
Then refactor the code in merge_target_files.py to adapt to this semantic
change. This makes the code more consistent with existing releasetools code,
and it's easier to follow.

Test: Failure cases (verify exception), success cases (merged target generated)
Bug: 124521133
Change-Id: I56f04e360d8ff8ffcd6245359cdeb79f4565a9c4
2019-02-21 19:02:07 -08:00
Xin Li 0e2ccf21c9 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: Ic9e8ff5af22140dc6ef8ff87a09f9292f9d30dc5
2019-02-21 09:32:40 -08:00
Bill Peckham ab2f68f38a Merge "Include merge_target_files.py deps in otatools.zip, use common argv processing." am: 30ee35f908 am: a3c90f2ac7
am: 68ac3ecf15

Change-Id: I3d9a1179d05cdbf1261a30f70869ca32041b5f09
2019-02-20 20:27:02 -08:00
Bill Peckham 68ac3ecf15 Merge "Include merge_target_files.py deps in otatools.zip, use common argv processing." am: 30ee35f908
am: a3c90f2ac7

Change-Id: I61cb000759ffdf012ce570ba20f83d060164310c
2019-02-20 20:22:53 -08:00
Bill Peckham 30ee35f908 Merge "Include merge_target_files.py deps in otatools.zip, use common argv processing." 2019-02-21 04:13:23 +00:00
Tianjie Xu 28a8ca98d0 Merge "Check the completeness of original blocks during target files validation" am: ef7737f921 am: 1f80b12aa0
am: 9312c2acc0

Change-Id: I7e49152b65ca4a96339ad7e83527a8a537f66165
2019-02-20 20:06:53 -08:00
Tianjie Xu 9312c2acc0 Merge "Check the completeness of original blocks during target files validation" am: ef7737f921
am: 1f80b12aa0

Change-Id: Ieaa5d86aa24b220df42ac639408bcc659e2359fd
2019-02-20 19:58:07 -08:00
Tianjie Xu ef7737f921 Merge "Check the completeness of original blocks during target files validation" 2019-02-21 03:41:35 +00:00
Tianjie Xu 6e25835bd8 Merge "OTA: Add an option to dump the metadata in ota package" am: 65cd6be679 am: f95abe47e4
am: 7934f14849

Change-Id: Ie7a33e28c2edae1df1577969f0872b27751a2eba
2019-02-20 19:23:49 -08:00
Tianjie Xu 7934f14849 Merge "OTA: Add an option to dump the metadata in ota package" am: 65cd6be679
am: f95abe47e4

Change-Id: Id54d08210242dc9c6d5fccd7b6ed8d310564129b
2019-02-20 19:20:44 -08:00
Bill Peckham f753e15791 Include merge_target_files.py deps in otatools.zip, use common argv processing.
The merge_target_files.py script needs fc_sort and sefcontext_compile, so
include these tools into otatools.zip via core/Makefile.

Modify tools/releasetools/merge_target_files.py to use the otatools common argv
processing to take advantage of the '--path' option so that we add point the
'--path' option to an extracted otatools.zip package to gain access to fc_sort,
sefcontext_compile, and soong_zip (previously included in otatools.zip).

Bug: 123600124
Test: extract otatools.zip, use --path option to point to it, verify result
Change-Id: I7d84525981b8741c6bdbcac9984256920fc7f417
2019-02-21 00:50:54 +00:00
xunchang c0f77ee489 Check the completeness of original blocks during target files validation
The validate_target_files.py checks the 'incomplete' field of the range
in file_map. And range has already considered the shared blocks and
could be smaller in size than the original file range. Therefore, the
'incomplete' flag was set on the original range in common.py; and we
should switch to use the original range also during validation.

I also checked another flag usage in CanUseImgdiff(), and it has
explicitly rejected cases of shared blocks.

Bug: 124868891
Test: unit tests pass
Change-Id: I03959625d7b81fd83420db98f01d23f54064bcd2
2019-02-20 15:47:30 -08:00
xunchang 1cfe25155e OTA: Add an option to dump the metadata in ota package
Add a flag to write a copy of the metadata to a separate file. Therefore,
users can read the post build fingerprint without extracting the OTA package.

Bug: 124783265
Test: Check the dumped metadata file after generate A/B and non-A/B OTA.
Change-Id: I8918aec87bb81906ef0a7eee774178e9f689d91d
2019-02-20 15:32:09 -08:00
Tianjie Xu 8b8de7470e Merge "Add a flag to skip compatibility check" am: 79b52c9ce1 am: 2d97c96527
am: 0875e002aa

Change-Id: Ieaf6975f1ac2eb6d344b89334e8d040f8b24d769
2019-02-19 21:26:06 -08:00
Tianjie Xu 0875e002aa Merge "Add a flag to skip compatibility check" am: 79b52c9ce1
am: 2d97c96527

Change-Id: Iaac01a8fa0a37e623f32cc93416a6eafcf264ab2
2019-02-19 21:17:34 -08:00
xunchang abfa265f81 Add a flag to skip compatibility check
This serves as a workaround to skip the compatibility check for devices
with incompatible kernels.

Bug: 114240221
Test: generate and check the OTA package for wear device
Change-Id: I65b523a66648af7a77fc3ea79176764fe8ae8d02
2019-02-19 16:27:10 -08:00
Bowgo Tsai 9f09ae4223 Merge "Support verifying system_other" am: 01a05483ed am: f509e54bd0
am: a18a5fe46f

Change-Id: If1862045cbaf8ad207adad3d54733cb7dda693a9
2019-02-17 21:42:50 -08:00
Bowgo Tsai a18a5fe46f Merge "Support verifying system_other" am: 01a05483ed
am: f509e54bd0

Change-Id: I16f65c01659fa1664451a25395c340e55f0b39b5
2019-02-17 21:38:41 -08:00
Treehugger Robot 01a05483ed Merge "Support verifying system_other" 2019-02-18 05:21:27 +00:00
Bill Peckham 4a978d3ec1 Merge "Adding initial merge_target_files.py script to merge two target files packages." am: 194b1c8508 am: 7591615cb4
am: ad2967f980

Change-Id: I71ec7422e2e9ea20b491b15b38bf5cc3037b8c80
2019-02-15 17:53:31 -08:00
Bill Peckham ad2967f980 Merge "Adding initial merge_target_files.py script to merge two target files packages." am: 194b1c8508
am: 7591615cb4

Change-Id: I3c15c100c32999896bcfdb49827758b91b1b4f02
2019-02-15 17:49:20 -08:00
Bill Peckham 194b1c8508 Merge "Adding initial merge_target_files.py script to merge two target files packages." 2019-02-16 01:40:36 +00:00
Tom Cherry 527e194d18 Merge "Use fs_config_generator.py to generate fs_config_files/dirs directly" am: b21b108ddf am: b133ed8e18
am: 5fff1244be

Change-Id: I936cacfcdb8fdd8915a327ca73b16a326d24e0ff
2019-02-15 15:01:15 -08:00
Tom Cherry 5fff1244be Merge "Use fs_config_generator.py to generate fs_config_files/dirs directly" am: b21b108ddf
am: b133ed8e18

Change-Id: I9ce904fbe25fd4bfbf20e5775767f6f8dd5aa5d9
2019-02-15 14:56:05 -08:00
Bill Peckham e9eb5f96e0 Adding initial merge_target_files.py script to merge two target files packages.
This script takes as input two partial target files (one contains system bits,
and the other contains non-system, or other, bits). The script merges the
contents of the two partial target files packages to produce a complete target
files package.

Bug: 123430711
Test: Build two partial target files, merge, compare with full target files.
Test: Validate merged target files via validate_target_files.py.
Change-Id: Ic24acf43b86fc703fb4c970688b006291a1861f8
2019-02-15 13:25:16 -08:00
Tom Cherry 9d924f67d3 Use fs_config_generator.py to generate fs_config_files/dirs directly
We want to remove target specific host tools and since
fs_config_generate is compiled with a target specific header file, we
instead remove fs_config_generate entirely and allow python to build
the fs_config_files/dirs files directly from config.fs files and
parsed C headers.

Test: associated unit tests and new end to end test
Test: aosp_sailfish, aosp_crosshatch build produces valid fs_config files
Test: aosp_cf_x86_phone build correctly produces empty fs_config files
Change-Id: Idbc63ff56c0979e1e4c17721371de9d9d02dc8ff
2019-02-15 09:44:09 -08:00
Tom Cherry d33b3198c3 Merge "Error if $(TARGET_DEVICE_DIR)/android_filesystem_config.h exists" am: 506a796bd8 am: 201f5e5a3c
am: 560a8101af

Change-Id: Id84d05ed82fe10d21694823662e7ccc19519976e
2019-02-14 13:15:36 -08:00
Tom Cherry 560a8101af Merge "Error if $(TARGET_DEVICE_DIR)/android_filesystem_config.h exists" am: 506a796bd8
am: 201f5e5a3c

Change-Id: I8262d77366d1dabf552ba6286b7c4f4b7ecff601
2019-02-14 13:11:23 -08:00
Tom Cherry 1a9f8356fd Error if $(TARGET_DEVICE_DIR)/android_filesystem_config.h exists
This was deprecated along with TARGET_ANDROID_FILESYSTEM_CONFIG_H so
warn if it still exists.

Test: successful error if it exists, no error if it does not
Change-Id: I7dde3c88aaf7ecec23ffe018cbe8b42ebadb2bf8
2019-02-14 10:02:04 -08:00
Tom Cherry 0241c8e6e7 Merge "Fix failing test_fs_config_generator.py tests" am: f83ba4e8b1 am: cff9af302b
am: 43fa4a9985

Change-Id: Ifaaf914b18620f7ffeb975c5998b77c050a459d0
2019-02-13 21:10:45 -08:00
Tom Cherry 43fa4a9985 Merge "Fix failing test_fs_config_generator.py tests" am: f83ba4e8b1
am: cff9af302b

Change-Id: Idde025803213c7f952e326065647ae41d1b8350b
2019-02-13 20:58:38 -08:00
Tom Cherry f83ba4e8b1 Merge "Fix failing test_fs_config_generator.py tests" 2019-02-14 02:18:11 +00:00
Bill Peckham 6453fe1984 Merge "Skip some build steps if not building system image." am: 4a3c68bffa am: 8a4041a18e
am: 36b230c394

Change-Id: Idc9c8e73f2b8cbc178a42281dcdc03387ce67adc
2019-02-13 16:58:56 -08:00
Bill Peckham 36b230c394 Merge "Skip some build steps if not building system image." am: 4a3c68bffa
am: 8a4041a18e

Change-Id: I17249226965c48c599da4a6f932e4d63b0c7a5d0
2019-02-13 15:59:50 -08:00
Bill Peckham cc57de3256 Skip some build steps if not building system image.
tools/releasetools/add_img_to_target_files.py: This patch excludes the
inclusion of the system path into the target files if it does not exist (which
it will not if we are not building the system image).

Bug: 123430711
Test: Disable building system image, verify that target files builds without system.
Change-Id: Iaf964ede2b1df5ea4e004b572fd91187a366e75e
2019-02-13 22:57:14 +00:00
Tom Cherry 766adc9cbc Fix failing test_fs_config_generator.py tests
Also run pylint and yapf to fix the style issues.

Test: these same tests
Change-Id: I0a783f7a6f08a90f615d94e9d16da0f314b7813f
2019-02-13 14:34:42 -08:00
Tianjie Xu 34689e2412 Merge "Code improvement to adjusted the blocks size for care_map file" am: b8ac90803c am: 9cdba9ba97
am: 89527442c9

Change-Id: I560a1be990280565851b84c1558a7e5153b88eca
2019-02-13 12:37:38 -08:00
Tianjie Xu 89527442c9 Merge "Code improvement to adjusted the blocks size for care_map file" am: b8ac90803c
am: 9cdba9ba97

Change-Id: I67efdb6a6c8e186c706b35f0dc4984d2bafc7c99
2019-02-13 12:24:07 -08:00
Tianjie Xu b8ac90803c Merge "Code improvement to adjusted the blocks size for care_map file" 2019-02-13 19:49:48 +00:00
Shashikant Baviskar 16a73897c3 Code improvement to adjusted the blocks size for care_map file
Bug: 123931528
Test: python -m unittest test_add_img_to_target_files
Change-Id: I589bc9681bccfa07588cab94f53f69d637d6f0f9
2019-02-13 18:34:50 +00:00
Bowgo Tsai 45db7cefb3 Support verifying system_other
This commit extracts the AVB key used to sign system_other.img into
system.img, for init to verify system_other's AVB metadata.

The extracted key will locate in:
    /system/etc/security/avb/system_other.avbpubkey

Bug: 123611926
Test: build and checks the following is generated
      $OUT/system/etc/security/avb/system_other.avbpubkey

Change-Id: Icdc703ff5a0d50f8140bb652507b9b4cbc8a2118
2019-02-13 17:00:49 +08:00
Tom Cherry e43a7743f3 Merge "Remove TARGET_ANDROID_FILESYSTEM_CONFIG_H" am: 8bca10ade4 am: 1e29059140
am: 531ef2df70

Change-Id: Iab36b896d1854e4d35c01f086624db95b8933715
2019-02-12 13:46:43 -08:00
Tom Cherry 531ef2df70 Merge "Remove TARGET_ANDROID_FILESYSTEM_CONFIG_H" am: 8bca10ade4
am: 1e29059140

Change-Id: I1d7273bc93d8eab2903ad7478a033902162dd836
2019-02-12 13:42:10 -08:00