Commit graph

6582 commits

Author SHA1 Message Date
Tao Bao
f0c4aa204c releasetools: Fix the target files diffing.
This CL refactors the non-A/B OTA generation code into a function,
so it allows adding common post-generation code for both flows.

It moves the code for target files diffing to common path, and fixes the
diffing functionality (broken due to the use of unzip pattern).

Test: Run ota_from_target_files with `--log_diff` flag to generate
      non-A/B and A/B OTAs respectively.
Change-Id: I92e5549a58344fc56a151a709c06534913d265d5
2019-08-07 14:53:08 -07:00
Treehugger Robot
c5cb45b7da Merge "Fix typo in error message in tools/fs_config/fs_config_generator.py." 2019-08-07 21:35:33 +00:00
Tao Bao
f882684d85 Merge "Move make_recovery_path and sparse_img to modules."
am: 4c9527b314

Change-Id: I13a67cfe58450696c37a0e7e4ecc3261d8bd7d5a
2019-08-07 13:15:15 -07:00
Tao Bao
496748378d releasetools: ota_from_target_files uses target_files_diff.
The dependency was overlooked as the module was conditionally imported.

Bug: 63866463
Test: `m -j ota_from_target_files`; Run ota_from_target_files with
      `--log_diff` flag (on a non-A/B target).
Change-Id: I71eff2e55cc28fd649f0ca1b38da53907dac6597
2019-08-07 13:01:27 -07:00
Tao Bao
4c9527b314 Merge "Move make_recovery_path and sparse_img to modules." 2019-08-07 18:49:20 +00:00
Roland Levillain
5ca32dfec5 Fix typo in error message in tools/fs_config/fs_config_generator.py.
Test: n/a
Change-Id: I46682483803e1c7c71fb07157d0ef9c990152d93
2019-08-07 15:51:01 +01:00
Tao Bao
e11a46000c Move make_recovery_path and sparse_img to modules.
These two tools are only used within build system, so not adding them
to otatools.zip.

Bug: 63866463
Test: TreeHugger
Test: Build a non-A/B target that calls make_recovery_patch.
Change-Id: Iaeddc98a2c4a27c6b49d91047500029e460db9e3
2019-08-06 23:27:48 -07:00
Tao Bao
7552bbdfb6 Merge "releasetools: merge_target_files sets verbose in main."
am: 3738f37e22

Change-Id: I0e193d444af6e8a05289e22bbc02fc084972750a
2019-08-06 19:47:51 -07:00
Tao Bao
abb806b3f0 releasetools: merge_target_files sets verbose in main.
The flag would otherwise be turned on unconditionally even when
importing merge_target_files as a module. As a result, `atest
releasetools_test` was broken / flaky prior to this change, as
PythonUnitTestResultParser doesn't like unexpected outputs in stderr.

Test: `atest releasetools_test releasetools_py3_test`
Change-Id: Ifd614c797d2cee3b33e4c2a7ad8e598850e9d60c
2019-08-06 14:13:19 -07:00
Tao Bao
e5f0839c4b Merge "releasetools: Build build_super_image as a lib."
am: 7edc2b1994

Change-Id: Ib9fb0144b79d183aacc08ed0f661a0c7356b5372
2019-08-06 12:18:31 -07:00
Tao Bao
7edc2b1994 Merge "releasetools: Build build_super_image as a lib." 2019-08-06 19:01:20 +00:00
Tao Bao
a4a236e318 Merge "releasetools: Drop the support for creating image archive from dir."
am: 28dd0c83a2

Change-Id: I5a7cb6fc33c2ebdc8eb6d44302f038b5c88540a4
2019-08-06 11:57:35 -07:00
Tao Bao
28dd0c83a2 Merge "releasetools: Drop the support for creating image archive from dir." 2019-08-06 18:45:17 +00:00
Tao Bao
3810585592 Merge "releasetools: Don't write outputs if not in verbose mode."
am: a514c4ec22

Change-Id: I3cbc864609975cd38c90d68ef2c24caeede8ef4e
2019-08-06 11:08:15 -07:00
Tao Bao
93d52312d3 Merge "Build and use ota_from_target_files as a module."
am: b7957f112b

Change-Id: I2c2d6d17f0b52c83a591ebe28b31076741b3e967
2019-08-06 11:00:19 -07:00
Tao Bao
a514c4ec22 Merge "releasetools: Don't write outputs if not in verbose mode." 2019-08-06 17:33:22 +00:00
Tao Bao
005305adf8 releasetools: Build build_super_image as a lib.
The lib will be shared by more users (e.g. add_img_to_target_files) in
follow-up changes.

Test: TreeHugger
Test: atest releasetools_test releasetools_py3_test
Change-Id: Iaa48bfc8c1dada41362d974773c124a001471ef8
2019-08-05 13:02:26 -07:00
Tao Bao
8821d64481 Build and use ota_from_target_files as a module.
Bug: 63866463
Test: TreeHugger
Test: m -j otapackage
Test: `m -j otatools-package`. Check bin/ota_from_target_files is
      available. Build an OTA package with standalone otatools.
Change-Id: I533dee1c6997d233601e7f4eae637ff5743ed637
2019-08-05 12:57:41 -07:00
Daniel Norman
06975fa319 Merge "Adds support for optionally generating vbmeta.img in merge_builds."
am: 477d2894e4

Change-Id: I1af7d7ff9f4d55373868702d992e3db3ea1bfcb4
2019-08-02 16:46:35 -07:00
Tao Bao
2aac9c9d6d releasetools: Drop the support for creating image archive from dir.
Taking an extracted target_files dir input is only needed for
add_img_to_target_files.py, in particular for the call from build
system. For the case of img_from_target_files.py, it goes much faster
with zip2zip (3m vs 7s in my local test). This CL drops the unneeded
code path in preparation for the switch to zip2zip.

Test: `python build/make/tools/releasetools/img_from_target_files.py \
         -v aosp_taimen-target_files.zip aosp_taimen-img-test.zip`
Change-Id: I7f85d7d629d6fd1621a082f94a11cac7c3e6bbf2
2019-08-02 16:02:32 -07:00
Tao Bao
718faed3dc releasetools: Don't write outputs if not in verbose mode.
The change in [1] allows brillo_update_payload to write to stdout/stderr
directly without buffering, to ensure dumping progress to screen
continously. However, it now unconditionally writes to stdout/stderr
even if caller doesn't specify `-v`. The behavior upsets
PythonUnitTestResultParser in [2], which doesn't want any unexpected
output from stderr for result parsing.

This CL updates the logic to only give continous outputs in verbose
mode.

[1] commit 2f7e11ef27
[2] https://android.googlesource.com/platform/tools/tradefederation/+/refs/heads/master/test_framework/com/android/tradefed/testtype/PythonUnitTestResultParser.java

Test: Run ota_from_target_files.py with `-v`. Check there's continous
      output from brillo_update_payload.
Test: `python -m unittest -v test_ota_from_target_files > /dev/null`
      doesn't show outputs from brillo_update_payload.
Change-Id: I3b851203ef011a5b4d982948cf52793f6fb6ad2d
2019-08-02 13:36:49 -07:00
Daniel Norman
276f06275b Adds support for optionally generating vbmeta.img in merge_builds.
Bug: 137853921
Bug: 138671115
Test: python -m unittest test_common
Test: python -m unittest test_add_img_to_target_files
Test: Ran 'merge_builds --build_vbmeta' for two devices, one with the
vbmeta struct on system.img and another with vbmeta_system.img. Flashed
the regenerated vbmeta.img files on devices, devices boot.

Change-Id: I8d7585c7af468be3d242d8aceeed6d27e6fc6d96
2019-08-02 20:13:03 +00:00
Tao Bao
74dcbad8f2 Merge "releasetools: Add FORCE_RUN_RELEASETOOLS."
am: 1bc828c97e

Change-Id: I08cd4632611b8053c0457846b0a170488640fb80
2019-08-01 21:33:22 -07:00
Tao Bao
1bc828c97e Merge "releasetools: Add FORCE_RUN_RELEASETOOLS." 2019-08-02 03:57:39 +00:00
Dan Willemsen
58be946140 Merge changes from topic "rm_ONE_SHOT_MAKEFILE"
am: 8b8b9b6bf8

Change-Id: I5764b2ce848710584d2d837e9e33fb9fb71c8d33
2019-08-01 14:31:32 -07:00
Dan Willemsen
8b8b9b6bf8 Merge changes from topic "rm_ONE_SHOT_MAKEFILE"
* changes:
  Remove [jni_]link_type files
  Remove support for ONE_SHOT_MAKEFILE
2019-08-01 21:11:02 +00:00
Tao Bao
7d223c6ddd releasetools: Add FORCE_RUN_RELEASETOOLS.
This allows test runner to take care of the external tools setup, then
to start the test without a lunch'd environment. This is needed before
having supports like python_test_helper that packs dependents into
releasetools_test module.

Bug: 138791766
Test: Don't lunch any target. Use `FORCE_RUN_RELEASETOOLS=1 python -m
      unittest -v test_add_img_to_target_files` and check there's no
      skipped testcases.
Change-Id: Iafeaba54fc228d8e1fc5ff3c91f7ffebef18ad7f
2019-08-01 12:22:54 -07:00
Mitchell Wills
e2f0f13049 Merge "Add build script to create a self extracting archive with a click through license"
am: 9a1d60f5cb

Change-Id: I412c669ed7291288911f258232519c20fa136f8c
2019-07-31 19:43:27 -07:00
Treehugger Robot
9a1d60f5cb Merge "Add build script to create a self extracting archive with a click through license" 2019-08-01 02:17:33 +00:00
Dan Willemsen
0df0f6bbf1 Remove [jni_]link_type files
Now that mm/ONE_SHOT_MAKEFILE have been removed, we can expect to know
about all of our dependencies at the end of the build.

This removes 19k nodes from our build graph (aosp-master
aosp_arm64-eng), though in a default build, only 3k of those are used.

Test: ALLOW_MISSING_DEPENDENCIES=true, then trigger a missing dependency
Test: treehugger
Test: create link_type files, then apply CleanSpec.mk, ensure they're removed
Change-Id: I9506331e4a9911d2f26e59a2f72a97aef1644073
2019-07-31 18:09:22 -07:00
Dan Willemsen
93b7c1b547 Merge "Stop supporting wrapping the build with make"
am: d69e849c9b

Change-Id: If6e369f82348d9d7aebe37104072a6878f7281ea
2019-07-30 15:44:36 -07:00
Dan Willemsen
d69e849c9b Merge "Stop supporting wrapping the build with make" 2019-07-30 21:48:52 +00:00
Dan Willemsen
f02f1f16f0 Merge "Remove the PRODUCT-* goal"
am: a2d19cfd05

Change-Id: I8c83c177104117a88fa9822c48ec7fe45b69365c
2019-07-30 10:34:33 -07:00
Dan Willemsen
a2d19cfd05 Merge "Remove the PRODUCT-* goal" 2019-07-30 17:04:07 +00:00
Dan Willemsen
893948955d Stop supporting wrapping the build with make
The build servers are no longer using this. It's hard to search for
others using it -- I've cleaned them up as I've run across them, but
we'll just have to see who breaks once this goes in.

This was the last user of makeparallel, so we can remove it.

Test: make
Test: treehugger
Change-Id: If6df3f1a67d6a6df36afaa4b07cd88a48a364fe1
2019-07-29 22:43:35 -07:00
Daniel Norman
3f9554b59a Merge "Adds new merge builds script for use in merging two non-dist builds."
am: a85f0ee8a2

Change-Id: Ib7b66d5ee82df1d9f31d521917490ac1bac4a4e2
2019-07-29 17:36:57 -07:00
Dan Willemsen
8a5d597bbf Remove the PRODUCT-* goal
I've switched all the build server configs to using TARGET_PRODUCT /
TARGET_BUILD_VARIANT and explicit goals instead.

Remove tools/check_builds.sh which relied on this, but hasn't been
touched in a long time.

Test: m PRODUCT-test
Test: treehugger
Change-Id: If5f8c714567b33aeb38223c176ca24ea649eb57d
2019-07-29 14:27:04 -07:00
Mitchell Wills
1c790ca655 Add build script to create a self extracting archive with a click through license
Bug: 130257221
Test: generated an archive using the script and ran the result
Change-Id: If1147cd41fa939b0d9958196e627042b5731dc14
2019-07-29 11:04:57 -07:00
Daniel Norman
bfc51efa97 Adds new merge builds script for use in merging two non-dist builds.
Bug: 137853921
Test: python -m unittest test_common
Test: python -m unittest test_merge_target_files
Test: Built two partial builds without dist. Ran out/host/linux-x86/bin/merge_builds.
Flashed using `fastboot flashall`. Device boots.
Change-Id: Iffd0a447cdf19a7775a813b4b896178aa6f861f3
2019-07-29 16:30:56 +00:00
Tao Bao
ac280723c2 Merge "releasetools: Move recovery-two-step.img to OTA/."
am: 98efd8290e

Change-Id: I21419dc4a13271c589b8bcb4a4be7da02ef1587d
2019-07-28 11:07:07 -07:00
Tao Bao
0480850f0b releasetools: Move recovery-two-step.img to OTA/.
It used to be packed at IMAGES/recovery-two-step.img, but to serve OTA
purpose only.

Test: `m dist` with a non-A/B target. Check the file in the generated
      target_files.zip.
Test: Create two-step package. Check that recovery-two-step.img is used.
Change-Id: Iec6a73c682e0f844cd8c0b758c9470fa35dd15d8
2019-07-26 13:59:11 -07:00
Tao Bao
706eb3c566 Merge "releasetools: Fix the use of StringIO."
am: 6b466c8f56

Change-Id: I5669a070c0d98239263557c005305002739d1c1d
2019-07-25 09:55:09 -07:00
Tao Bao
bb73388acf releasetools: Fix the use of StringIO.
Based on the actual semantics, it actually wants an in-memory _bytes_
buffer (io.BytesIO), especially when running with Python 3. This CL
fixes the issue and adds a unittest.

Bug: 131631303
Test: python -m unittest test_sign_target_files_apks
Test: python3 -m unittest test_sign_target_files_apks
Change-Id: I3fb067acc26713f1842e831225607779fd0d1b7e
2019-07-24 23:34:25 -07:00
Tom Cherry
6cf1b11ead Generate /etc/{passwd,group} for all partitions
Bug: 73062966
Test: can load AIDs from partitions other than vendor
Test: bionic-unit-tests
Merged-In: Ia85abbeefe5a945369970f2aef42692e07ab8c09
Change-Id: Ia85abbeefe5a945369970f2aef42692e07ab8c09
(cherry picked from commit 8a54ec8482)
2019-07-23 17:07:11 +00:00
Tom Cherry
6722de1277 Merge "Generate /etc/{passwd,group} for all partitions" 2019-07-23 16:40:01 +00:00
Tom Cherry
fb303a5903 Generate /etc/{passwd,group} for all partitions
Bug: 73062966
Test: can load AIDs from partitions other than vendor
Test: bionic-unit-tests
Merged-In: Ia85abbeefe5a945369970f2aef42692e07ab8c09
Change-Id: Ia85abbeefe5a945369970f2aef42692e07ab8c09
2019-07-22 21:41:17 +00:00
changho.shin
0f12536e6b Switch to aapt2 for getting minSdkVersion
aapt does not support parsing some referencing attributes.
Switch to latest tool, aapt2, which works better.

Test: aapt2 dump badging test.apk and returned 0.
Test: Run check_target_files_signatures.py with a target_files.zip.
Test: Run sign_target_files_apks.py with a target_files.zip.
Change-Id: Ib3a4740506f29ebab6930767f2aa8a0b5c4ba053
2019-07-19 20:26:42 +00:00
Daniel Norman
36f8163589 Merge "Clean up merge_target_files.py."
am: ff165e31fd

Change-Id: I4bb6e084b0beb4a57df38a9e083b7e4900320a63
2019-07-19 07:41:27 -07:00
Tao Bao
e8aa7dcf19 Merge "Build build_image and build_super_image as modules."
am: 25cf50f582

Change-Id: Idb34ce99b01fe432e0fe2f7824a87cc8fa3541bf
2019-07-19 07:40:39 -07:00
Elliott Hughes
b5c68a02ae Merge "Remove perfprofd reference."
am: a627e9056b

Change-Id: I9f59616bb617d1c590eb6c923a5d8453ab4c2577
2019-07-19 07:38:56 -07:00
Daniel Norman
ff165e31fd Merge "Clean up merge_target_files.py." 2019-07-19 03:15:29 +00:00
Daniel Norman
4cc9df660b Clean up merge_target_files.py.
- Removes functions that can be replaced with one-line external methods
- Moves read_config_list to common alongside similar methods LoadDictionaryFrom*
- Runs pyformat on merge_target_files.py

Bug: 137853921
Test: python -m unittest test_merge_target_files
Test: Using merge_target_files.py to create a merged build, & booting.
Change-Id: I833c1086db41e1374057cc7447fc50d1915734a7
2019-07-18 13:04:54 -07:00
Tao Bao
2bbb07c53c Build build_image and build_super_image as modules.
Bug: 63866463
Test: TreeHugger
Test: `atest releasetools_test`
Test: `atest releasetools_py3_test`
Change-Id: I2059a4ced709d1b2ee331a9aaaa5ca30db4ebf6b
2019-07-18 10:27:38 -07:00
Treehugger Robot
a627e9056b Merge "Remove perfprofd reference." 2019-07-18 17:22:43 +00:00
Tao Bao
b9c7ed6314 Merge "logging: set stdout and stderr to None in some cases"
am: e733ed7e6b

Change-Id: Ifa43d7a811b2c288de1a2ee3a10fee0efaa43661
2019-07-17 08:55:25 -07:00
Tao Bao
e733ed7e6b Merge "logging: set stdout and stderr to None in some cases" 2019-07-17 15:40:59 +00:00
Elliott Hughes
36d86c1670 Remove perfprofd reference.
Dead and gone.

Test: treehugger
Change-Id: I8575fd9efaa371d61fac5204ee4d982e985a9a56
2019-07-17 08:16:29 -07:00
Tianjie Xu
bcc3554b74 Merge "Factor out the image classes to break circular dependency"
am: dcb6644719

Change-Id: I16371818e6e022ee75187b9c9e104836a72dd983
2019-07-16 13:30:24 -07:00
Tianjie Xu
41976c725c Factor out the image classes to break circular dependency
This helps to break the circular dependency between common and
blockimgdiff.

Bug: 32379627
Test: unit tests pass
Change-Id: I90b5ff34782acbfac86f36265bd96c207d898bf6
2019-07-15 17:02:23 -07:00
Andrew Chant
1db284ff10 Merge "Catch unicode decode errors search for kernel ver"
am: 2b4828a564

Change-Id: Ieed4020a6490d44c4be1780eec08e501ed1e2219
2019-07-15 11:58:41 -07:00
Treehugger Robot
2b4828a564 Merge "Catch unicode decode errors search for kernel ver" 2019-07-15 18:33:57 +00:00
Elliott Hughes
7a45e0ccb9 Merge "Stop building unnecessary tarballs."
am: 9a4b84de56

Change-Id: I9465ce123bc1d5ab9662069af6181dd7382eff57
2019-07-12 08:10:05 -07:00
Tao Bao
0f6c1d2b47 Merge "releasetools: Ignore nonexistent APEX overrides."
am: d077c5b88e

Change-Id: Idc8e680e3140599f81c5f9cdc33e2a647a95a300
2019-07-12 08:00:29 -07:00
Elliott Hughes
9a4b84de56 Merge "Stop building unnecessary tarballs." 2019-07-12 14:52:53 +00:00
Tao Bao
3422309d6d releasetools: Ignore nonexistent APEX overrides.
This allows sharing the same signing config on different target_files
zips. Nonexistent APEX will be ignored with a warning.

Bug: 137249701
Test: Run sign_target_files_apks with APEX overrides.
Change-Id: I2bad0f5c00753ed36ec5ae3431c7dc2ff1fc3e9c
Merged-In: I2bad0f5c00753ed36ec5ae3431c7dc2ff1fc3e9c
(cherry picked from commit b369c7226a)
2019-07-12 00:25:41 -07:00
Elliott Hughes
440c99f1f2 Stop building unnecessary tarballs.
Test: treehugger
Change-Id: Iaba2aa6d09ad891f37171cc76778d08c78c78f93
2019-07-12 05:04:12 +00:00
Vic Yang
ea3740650c Merge "Implement range-based pin list"
am: f90ec83802

Change-Id: Ie5fcabc992569a05d4d12aa3689aa2bcad0d81d4
2019-07-11 15:44:27 -07:00
Treehugger Robot
f90ec83802 Merge "Implement range-based pin list" 2019-07-11 22:21:03 +00:00
Tao Bao
213210c4d0 Merge "releasetools: Replace iteritems with items."
am: 6623fdda5a

Change-Id: I35c9e3b39897d20463aa12252a6118b427e64dfc
2019-07-11 11:39:41 -07:00
Regnier, Philippe
2f7e11ef27 logging: set stdout and stderr to None in some cases
For very long processes, we might want to keep stdout and stderr
by default to None.
So no redirection will occur in the child process as explained in:
https://docs.python.org/2/library/subprocess.html
That will result in the child process stdin and stderr to be same
than in common.py and avoid to have the logs blocked during the
child process execution and flushed only when child process terminates.
Since the logs are continously displayed, it allows to easily confirm
that the process is not blocked.

Bug: 133380588
Test: generate iota & Check that the logs are not blocked.

Change-Id: I6d6cb56547bf3a4a4334dfa22b6b2b05d2c36a5e
Signed-off-by: Regnier, Philippe <philippe.regnier@intel.com>
2019-07-11 17:05:17 +08:00
Tao Bao
3888428f29 releasetools: Replace iteritems with items.
While in theory this could incur memory overhead for Python 2, the
impact is low for the existing use cases (plus we're moving away from
Python 2).

Bug: 131631303
Test: No additional occurrence of iteritems.
Test: Build with Python 3.
Change-Id: I0205c9edf25f46e3d85967c7dd2c1af035757741
2019-07-10 22:29:20 -07:00
Tao Bao
d2ff3b5dca Merge "Additionally run releasetools_test with Python 3."
am: 576ae9628b

Change-Id: I090d9f67524c636967400d57164f26158562d3a9
2019-07-10 13:41:57 -07:00
Tao Bao
576ae9628b Merge "Additionally run releasetools_test with Python 3." 2019-07-10 18:22:37 +00:00
Vic Yang
baa9f50cb2 Implement range-based pin list
This extends the original pin list generation to support specifying a
range within a file.  If any part of a file is pinned, its local file
header in the APK file is pinned as well.

Test: Build cuttlefish.
Bug: 136040313
Bug: 135953430
Change-Id: I6de8c2b4c2f35c6bf257f61414c6bce761233e51
2019-07-09 10:37:19 -07:00
Andrew Chant
5d323c1714 Catch unicode decode errors search for kernel ver
If a kernel happens to decode to gibberish (including
non-ascii bytes), catch the decoding error when
searching for the kernel version.

Bug: 137041171
Merged-In: Ic035b3a5c8c80025cb3cede7b0fdcf8a2e5a35fd
Change-Id: Ic035b3a5c8c80025cb3cede7b0fdcf8a2e5a35fd
2019-07-09 17:02:48 +00:00
Justin Yun
8f11ad5d40 Merge "Rename product_services to system_ext"
am: b7a50ece30

Change-Id: I7a56d76d3543b2bc4b1d0b24e54e8dd82ab7f15a
2019-07-09 02:14:55 -07:00
Justin Yun
6151e3f1ea Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: I67f2e95dd29eac6a28e07e24ea973d3a134c3bfc
2019-07-09 08:57:19 +00:00
Tao Bao
ca82fc90f7 Additionally run releasetools_test with Python 3.
Bug: 131631303
Test: TreeHugger
Test: `atest releasetools_test`
Test: `atest releasetools_py3_test`
Change-Id: Ie00f48835aae41bc69ab8554b856a62aa3b497cc
2019-07-09 05:14:31 +00:00
Tao Bao
ec2f3da2a2 Merge "releasetools: Make merge_target_files and its test Python 3 compatible."
am: 6e3ae4e849

Change-Id: I0ee3f8801e194f140f32a4123100aa0e4f449a70
2019-07-08 21:19:53 -07:00
Tao Bao
2ad4b82d45 releasetools: Make merge_target_files and its test Python 3 compatible.
And a few minor clean-ups to the styling.

Bug: 131631303
Test: python -m unittest test_merge_target_files
Test: python3 -m unittest test_merge_target_files
Test: Use `python merge_target_files` to merge two target_files zips.
Test: Use `python3 merge_target_files` to merge two target_files zips.
Change-Id: I8502dfb243408f658d022e8d5e5fbb60066e4ff0
2019-07-08 16:06:15 -07:00
Kiyoung Kim
dc6566f3b2 Merge "Split merge_target_files function"
am: 09736b4aaf

Change-Id: Ic077a4bf1276ead627c1d09f67636626623a45ab
2019-07-07 23:51:33 -07:00
Kiyoung Kim
7cbeda728d Split merge_target_files function
Split merge_target_files function into several steps, so we can increate
readability and add conditional flows for other *SSI mixed build with less effort

Test: m -j & atest passed
Change-Id: I558f9dd5bca31b132a09cb36d9dfcd30c92efbc9
2019-07-08 12:13:05 +09:00
TreeHugger Robot
218adad125 Merge "DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master" into stage-aosp-master 2019-07-02 07:40:58 +00:00
Tao Bao
48a2feb670 Change the condition for building super_empty.img.
This CL changes the condition for building super_empty.img from
PRODUCT_BUILD_SUPER_PARTITION to PRODUCT_USE_DYNAMIC_PARTITIONS, as a
follow-up to the change in [1].

With the CL in [1], it skips building super.img and super_empty.img both
when turning off PRODUCT_BUILD_SUPER_PARTITION. However, the latter
should be mandatory whenever dynamic partitions is enabled. Because
fastboot relies on this file to properly flash dynamic partitions. Plus,
the cost for building super_empty.img is much lower than the one for
super.img.

As part of the change, it'll write group info into target_files when
building with PRODUCT_BUILD_SUPER_PARTITION == false. It's the work for
target_files merging script to determine the values to be picked up. The
current logic in merge_target_files.py always uses the one from vendor
target_files. This CL adds a testcase to ensure the behavior.

[1] https://android-review.googlesource.com/c/platform/build/+/928756

Bug: 135752763
Test: `m dist` with a target that sets PRODUCT_BUILD_SUPER_PARTITION to
      false. Check the built artifacts contain super_empty.img. Verify
      that the build can be flashed properly.
Change-Id: I277f087eab45663a6c3b33333d16e9e576c1c25c
2019-06-28 14:23:53 -07:00
Tao Bao
c1c52e7b3b Merge "releasetools: Prefer the avbtool specified in target_files." am: 63cf1326da
am: d84a0531e9

Change-Id: Ieb93952f093a2d6e3d3c9796d61819c46cc4fcea
2019-06-27 19:04:51 -07:00
Tao Bao
63cf1326da Merge "releasetools: Prefer the avbtool specified in target_files." 2019-06-28 01:18:21 +00:00
Tao Bao
a1b63421d9 Merge "releasetools: Make additional modules Python 3 compatible." am: e4f07795e4
am: ed7923be4f

Change-Id: Idf708c33684e7c7b96286b363d15bf947422323d
2019-06-27 17:58:45 -07:00
Tao Bao
e4f07795e4 Merge "releasetools: Make additional modules Python 3 compatible." 2019-06-27 23:52:50 +00:00
Tao Bao
2cfd9b9077 Merge "releasetools: Clean up check_target_files_signatures.py." am: f6e8d46e2f
am: d82b810a77

Change-Id: Ie4cb3dff2fb4098714a25b4cf10643cd1951aae4
2019-06-27 16:08:24 -07:00
Tao Bao
f6e8d46e2f Merge "releasetools: Clean up check_target_files_signatures.py." 2019-06-27 21:36:14 +00:00
Tao Bao
e815cec8f3 Merge "releasetools: Add sanity test for sign_apex." am: 2a917796b5
am: 03dc3694be

Change-Id: I0d2ad60b1df2f660a2a0658eaef000a19538b762
2019-06-27 11:31:55 -07:00
Tao Bao
2a917796b5 Merge "releasetools: Add sanity test for sign_apex." 2019-06-27 17:35:29 +00:00
Tao Bao
a67e12d66f releasetools: Clean up check_target_files_signatures.py.
And make it Python 3 compatibile.

Bug: 131631303
Test: python check_target_files_signatures.py target-files.zip
Test: python3 check_target_files_signatures.py target-files.zip
Change-Id: I38e868c3124387f5543ad68c92c75917e40b7d8f
2019-06-27 10:24:10 -07:00
Tao Bao
a370545a2c releasetools: Make additional modules Python 3 compatible.
Bug: 131631303
Test: `python -m unittest test_sign_target_files_apks`
Test: `python3 -m unittest test_sign_target_files_apks`
Test: `python -m unittest test_add_img_to_target_files`
Test: `python3 -m unittest test_add_img_to_target_files`
Test: `python -m unittest test_ota_from_target_files`
Test: `python3 -m unittest test_ota_from_target_files`
Test: `python -m unittest test_validate_target_files`
Test: `python3 -m unittest test_validate_target_files`
Test: Run `python3 ota_from_target_files.py` to generate an OTA.
Test: Run `python3 sign_target_files_apks.py` to sign a target_files.
Change-Id: I56b45bbcbf7aa83e690785a9640c0212e45d12d8
2019-06-27 09:05:48 -07:00
Kiyoung Kim
c2544994a4 Merge "Create common.LoadDictionaryFromFile" am: fc195fee44
am: 486bc8d590

Change-Id: I9622dbde337937345b581fd11047c339c242aab7
2019-06-26 18:25:37 -07:00
Kiyoung Kim
fc195fee44 Merge "Create common.LoadDictionaryFromFile" 2019-06-27 00:27:49 +00:00
Tao Bao
1ac886e181 releasetools: Prefer the avbtool specified in target_files.
This allows a consistent logic in using the avbtool which could be
board-specific.

Test: `atest releasetools_test`
Test: Run sign_target_files_apks.py on a target_files.zip.
Change-Id: I8cd93b8e71146985734f85c31f4662f5e2e9534c
2019-06-26 17:18:48 -07:00
Tao Bao
c9c1b864ba releasetools: Add sanity test for sign_apex.
This ensures a matching interface between sign_apex and apex_utils.

The test apex `testdata/foo.apex` is generated by running
`system/apex/apexer/runtests.sh`.

Test: python -m unittest test_sign_apex
Test: atest releasetools_test
Change-Id: I7c14b1df2a3038ad206aa3e5aac084c47baaa00b
2019-06-26 17:17:09 -07:00
Tao Bao
c515aa03b8 Merge "releasetools: Clean up additional modules for Python 3 compatibility." am: 90f638d842
am: c82d8ceffc

Change-Id: I84e7866b06ff693240272b39119d0ab5cae7e72a
2019-06-26 12:05:13 -07:00
Tao Bao
59cf0c59de releasetools: Clean up additional modules for Python 3 compatibility.
It also addresses a few linter warnings (mostly regarding indentation).

Bug: 131631303
Test: TreeHugger
Test: `python -m unittest test_ota_from_target_files`
Test: `python3 -m unittest test_ota_from_target_files`
Test: `python build/make/tools/releasetools/check_ota_package_signature.py
           build/make/target/product/security/testkey.x509.pem
           test-keys-signed-ota.zip`
Test: `python3 build/make/tools/releasetools/check_ota_package_signature.py
           build/make/target/product/security/testkey.x509.pem
           test-keys-signed-ota.zip`
Change-Id: I11a745dfec052081ab0282bb028dc27debf71f57
2019-06-26 00:15:53 -07:00