Commit Graph

7925 Commits

Author SHA1 Message Date
Dan Willemsen
6b2bd9d652 Merge "Fix potential error for sys.platform" am: 59f36c1950 am: fa7bb8304a
Original change: https://android-review.googlesource.com/c/platform/build/+/2127932

Change-Id: I9ab6f15da248c7be9b73df84da0a67787b291167
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 21:12:26 +00:00
jiajia tang
7e0c12b1ba Fix potential error for sys.platform
This CL is to fix gap between python2.x and 3.x.
For python2.x: sys.platform returns 'linux2'
For python3.x: sys.platform returns 'linux'

python3.x(https://docs.python.org/3.6/library/sys.html#sys.platform)
python2.x(https://docs.python.org/2.7/library/sys.html#sys.platform)
Both 2.x and 3.x recommend to use 'startswith' to identify sys.platform.

Change-Id: Id5a0a007518b329d1320baf96ecf1164cd3ebec1
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
2022-06-15 15:06:38 +00:00
Treehugger Robot
ae68a90b54 Merge "Remove danielnorman@ from OWNERs." am: 6417dca03f am: 123a85e7fb
Original change: https://android-review.googlesource.com/c/platform/build/+/2118053

Change-Id: Ibcc6f866114a7c267aa89cd9b98c13dfcbe90f39
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 21:55:55 +00:00
Daniel Norman
731767c99d Remove danielnorman@ from OWNERs.
Bug: 235251309
Change-Id: I164b4fcd2abbe0bd5a0a73c29887d7804f87544a
2022-06-07 19:26:54 +00:00
Treehugger Robot
1ac559c009 Merge "Improve flags for compliance tools." am: 10714789a9 am: 4033d64768
Original change: https://android-review.googlesource.com/c/platform/build/+/2116674

Change-Id: I3c1bd5554060aad67d604fbbb15de3db53a1bad0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 01:31:24 +00:00
Treehugger Robot
10714789a9 Merge "Improve flags for compliance tools." 2022-06-07 00:51:23 +00:00
Treehugger Robot
71880d9de6 Merge "[Bugfix] Check for presence before ZipWrite" am: bb8d9ed70f am: c3a915294b
Original change: https://android-review.googlesource.com/c/platform/build/+/2115654

Change-Id: Ifb49b4e8f30ea1da194e914c68cd01f63d8ccd4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 05:36:55 +00:00
Bob Badour
986a839161 Improve flags for compliance tools.
Test: m droid dist reportmissinglicenses

Change-Id: I4090dae3d5d33d1908d67dff31aeee92d2b261da
2022-06-03 12:44:22 -07:00
jiangxu5
b67b0d5bc0 [Bugfix] Check for presence before ZipWrite
There are vendor products but no *.map situation

Signed-off-by: jiangxu5 <jiangxu5@xiaomi.com>
Change-Id: I93a710fd10870b7406b1d7beb5a6f51b6badc104
2022-06-03 14:46:56 +08:00
Melisa Carranza Zúñiga
8e3198ace3 Revert "Merge "Adding flags and logic to sign updateable SEPolicy in APEX" am: 77c1dfa6d9 am: 5a0d81a0be am: 54e08307dc"
Test: mma and run sign_apex

This reverts commit 8fe9e3a2c7.

Reason for revert: Updateable SEPolicy is punted.

Change-Id: I28ae2afbb1083e215f4e0a27a9164133cd73dd76
Merged-In: I28ae2afbb1083e215f4e0a27a9164133cd73dd76
2022-06-01 12:01:03 +02:00
Melisa Carranza Zúñiga
da308bf773 Revert "Merge "Adding sepolicy sign params to sign_target_files_apks." am: fb042449e0 am: bd8c313275 am: a2db49becd"
Test: sign_target_files_apks target_files.zip target_out.zip

This reverts commit 6e6c22c70e.

Reason for revert: Updateable SEPolicy is punted.

Change-Id: I99524d13811028a4036aa85c74cf10974fe08165
Merged-In: I99524d13811028a4036aa85c74cf10974fe08165
2022-05-31 09:55:22 +00:00
Chih-hung Hsieh
2df67498e9 Merge "Add date time, checks on android_root, etc." am: c15b738a7c am: 13faf1ec21
Original change: https://android-review.googlesource.com/c/platform/build/+/2101076

Change-Id: Ie748e934ce2252b196bfa9d57de8e47f5c1cd705
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 23:57:02 +00:00
Chih-Hung Hsieh
dd58ab0dc1 Add date time, checks on android_root, etc.
* Dump current date/time to the output .html file
  to distinguish files from different build dates.
* Guess android_root from the path of warn_common.py,
  but only if it contains build/make and build/soong.
* Do not depend on the TOP variable,
  which is no longer emitted by build/soong make.
* Do not depend on the USE_RBE variables,
  which is not emitted in local makes.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Bug: 198657613
Change-Id: Ib75c60216f9e06f9a768e63b536495fb9658843f
2022-05-19 15:28:41 -07:00
Dmitrii Merkurev
03e324006b Merge "Introduce EROFS compress hints to the Android build system" am: 494358dec8 am: a13fbaa01f
Original change: https://android-review.googlesource.com/c/platform/build/+/2098052

Change-Id: I3ed091156c4b39dad6eaf578144ac3d070025988
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 11:41:19 +00:00
Dmitrii Merkurev
494358dec8 Merge "Introduce EROFS compress hints to the Android build system" 2022-05-19 11:00:11 +00:00
Chih-hung Hsieh
992d08602c Merge "Handle more mixed warning lines from RBE" am: b28e4c2235 am: c7638c668c
Original change: https://android-review.googlesource.com/c/platform/build/+/2094756

Change-Id: I42c5719052895460eb52e9e28e57c82d9ce02225
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 22:04:06 +00:00
Chih-hung Hsieh
b28e4c2235 Merge "Handle more mixed warning lines from RBE" 2022-05-18 21:31:22 +00:00
Chih-hung Hsieh
9fe03ee318 Merge "Add warning type into TopDirs and TopFiles index" am: 89703b6374 am: 3fc466adad
Original change: https://android-review.googlesource.com/c/platform/build/+/2100523

Change-Id: Idc5de621534beb043a942a0d1756894bfce3be66
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 21:30:40 +00:00
Dmitrii Merkurev
8ab6603a43 Introduce EROFS compress hints to the Android build system
Make it possible to provide a prebuilt hints file to specify different compression strategies on a file basis for all partitions using:

BOARD_EROFS_COMPRESS_HINTS := <path>/erofs-hints.txt

or separately for every partition using:

BOARD_SYSTEMIMAGE_EROFS_COMPRESS_HINTS := <path>/system-partition-erofs-hints.txt
BOARD_VENDORIMAGE_EROFS_COMPRESS_HINTS := <path>/vendor-partition-erofs-hints.txt

Hints format: Each line is defined by tokens separated by spaces in the following form:

<pcluster-in-bytes> <match-pattern>

pcluster-in-bytes can be specified as 0 which mean file will not be compressed

Bug: 231934752
Test: used dump.erofs -S system.img to verify the system image isn't compressed after specifying BOARD_SYSTEMIMAGE_EROFS_COMPRESS_HINTS := no-compress.txt, where no-compress.txt contains 0 .*
Test: used dump.erofs --nid=<inode-for-all-apk-files> vendor.img to verify apk files are not compressed (the rest of the partition content is compressed)
Test: used dump.erofs -S <all-images> to verify all images are not compressed after specifying BOARD_EROFS_COMPRESS_HINTS := <path>/no-compress.txt
Change-Id: I64054e26af5ea5781c45d2183b7796a9ad2b7927
2022-05-17 23:10:37 +00:00
Chih-Hung Hsieh
a55837c7d1 Handle more mixed warning lines from RBE
* Use android_root or __file__ path to find
  the source tree root and its sub directories.
* Use the sub directory list to clean up RBE-returned
  warning lines, removing all mixed prefix before
  the top sub directories.
* Change some re.match rules and order to save
  unnecessary comparisons.

Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Bug: 198657613
Change-Id: I78cc17d04b8ab9e12935ef04797f3272298d5267
2022-05-17 11:46:58 -07:00
Chih-Hung Hsieh
4b020cd1d3 Add warning type into TopDirs and TopFiles index
* The index was a directory or file path.
  This change adds additional entries that have
  warning type prefix in the index.
* In the "Directories/Files with at least 1% warnings"
  section, the list will include number of warnings for
  (1) "all warnings in a directory/file"
  (2) "warnings of a type in a directory/file"
  (3) "warnings of a type in all directories/files"
  Examples:
    4273 (8.7%) frameworks/av/...
    4130 (8.4%) packages/...
    2427 (5.0%) [google-explicit-constructor] */...
    1628 (3.3%) [cert-err34-c] */...
    1099 (2.2%) [google-runtime-int] bionic/tests/math_data/...
     608 (1.2%) [cert-err34-c] external/...

Bug: 231245501
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I13bb54c846ad514334f78c5a71e994a131a92963
2022-05-17 11:46:15 -07:00
Michael Groover
96bfead5db Merge "Add support for -providerArg in signapk" am: 9d1a0a47d5 am: 9401efe64f
Original change: https://android-review.googlesource.com/c/platform/build/+/1760832

Change-Id: Ie876bfee50a8e3dccc59bd8b5ba68ff1bb113fdd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 19:39:26 +00:00
Michael Groover
2f8aad4f7f Add support for -providerArg in signapk
signapk currently accepts a Provider class that can be instantiated
and inserted before the signing. This commit adds support to specify
a -providerArg parameter that can be used to configure the Provider.
Prior to JDK 9 a Provider would accept a providerArg in a constructor
accepting a String; in JDK 9+ a Provider should first be instantiated
with the zero-arg constructor, then the configure method should be
called with the providerArg.

Bug: 142334653
Bug: 190974913
Fixes: 232134730
Test: Manually verified new Provider can be inserted with pre- and
      post-JDK 9 behavior.
Change-Id: I96f027640c59d3357e8dcf656626d1601bfef861
2022-05-11 21:55:24 +00:00
Kelvin Zhang
af7731528b Temporary hack for making T->S downgrade work am: 25d69c8bf5
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/18246946

Change-Id: I1f8044750c7754965cba7ed0bea654fb30b0befc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 22:53:37 +00:00
Kelvin Zhang
25d69c8bf5 Temporary hack for making T->S downgrade work
Downgrade OTA was broken because generic_ramdisk was removed from boot
partition in android T. Neither does O6 have init_boot. O6 also doesn't
include generic ramdisk in vendor boot, so no way for otatools to locate
contents of generic ramdisk. As a hack, omit boot partition timestamp if
we can't find ramdisk.

Test: generate T->S downgrade OTA for O6
Bug: 231656318
Merged-In: I9f5359462332aadadc324348873a3a4b2b126068
Change-Id: I9f5359462332aadadc324348873a3a4b2b126068
2022-05-10 05:06:47 +00:00
Kelvin Zhang
9a698e6a9f Temporary hack for making T->S downgrade work
Downgrade OTA was broken because generic_ramdisk was removed from boot
partition in android T. Neither does O6 have init_boot. O6 also doesn't
include generic ramdisk in vendor boot, so no way for otatools to locate
contents of generic ramdisk. As a hack, omit boot partition timestamp if
we can't find ramdisk.

Test: generate T->S downgrade OTA for O6
Bug: 231656318
Change-Id: I9f5359462332aadadc324348873a3a4b2b126068
2022-05-09 10:20:52 -07:00
Kelvin Zhang
f4406ca129 Merge identical key/val pairs in dynamic partition info
We might add new values to dynamic_partition_info.txt, so some kind of
generic fallback mechanism is needed. If keys are different, we need to
decided on a case-by-case basis which side takes precedence. For
example, Virtual AB requires vendor support, so vendor side takes
precedence. VABC on T+ devices are implemented entirely in system, so
system/framework side takes precedence.

Bug: 230876542
Test: th
Change-Id: I67747368547d3ef3e29ad64f8f818ef4c5896246
(cherry picked from commit 6a683ce02b)
Merged-In: I67747368547d3ef3e29ad64f8f818ef4c5896246
2022-05-06 21:40:14 +00:00
Treehugger Robot
1ca14f8415 Merge "Disable verity for VABC updates on android R" am: 46c4bb37d1 am: e654cbdfcd
Original change: https://android-review.googlesource.com/c/platform/build/+/2087483

Change-Id: I1e1c6583021ea106503a993fc844ce04f31a1317
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 00:37:11 +00:00
Kelvin Zhang
a9a87ec204 Disable verity for VABC updates on android R
Bug: 230277030
Test: th
Change-Id: I2872c490c852fb7d3784721e191ece80b4b1fd58
2022-05-04 16:45:14 -07:00
Treehugger Robot
69c7308fa4 Merge "Only enable zucchini if configuration file exists" am: 7b53ae67f1 am: 73590ef083
Original change: https://android-review.googlesource.com/c/platform/build/+/2085423

Change-Id: I509cf3d7af4ef52adbf1d83bc3fbb66a8ebdb66c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 04:34:42 +00:00
Treehugger Robot
7b53ae67f1 Merge "Only enable zucchini if configuration file exists" 2022-05-04 02:39:39 +00:00
Håkan Kvist
3db1ef61de Only enable zucchini if configuration file exists
Only enable zucchini if configuration file zucchini_config.txt exits
in target files and version in source and target is the same.

Without this patch zucchini would be enabled if configuration file
was missing from both target files.

Bug: 231204699
Test: Run ota package generation with zucchini_config.txt missing from
      both source and target zips. Confirm that zucchini is disabled.
Change-Id: Ia34998fd911d5860b38fe49fa5a88056a22d661e
2022-05-03 13:00:32 +02:00
Treehugger Robot
e691c3c719 Merge "Expose GetRamdiskFormat and use in ota_utils.py" am: 98050a4e97 am: fbfd46e545
Original change: https://android-review.googlesource.com/c/platform/build/+/2084045

Change-Id: I7125266e39d7f1b199a35e7a42273ae12e195c21
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 10:26:16 +00:00
Treehugger Robot
98050a4e97 Merge "Expose GetRamdiskFormat and use in ota_utils.py" 2022-05-03 08:27:35 +00:00
Treehugger Robot
7474ce637f Merge "Merge identical key/val pairs in dynamic partition info" am: d9e0788ee7 am: 77bd852ff0
Original change: https://android-review.googlesource.com/c/platform/build/+/2084183

Change-Id: I8d66aee14c8858294f7449c1b0409bda3215db40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 05:24:45 +00:00
Treehugger Robot
d9e0788ee7 Merge "Merge identical key/val pairs in dynamic partition info" 2022-05-03 02:37:34 +00:00
TJ Rhoades
6f488e9e33 Expose GetRamdiskFormat and use in ota_utils.py
Some OTA files may have additional OTA props; when this is being computed within
ota_utils.py -> ComputeRuntimeBuildInfos, the ramdisk type needs to be passed into
PartitionBuildProps.FromInputFile as not all ramdisk may still use gzip. This check
is already defined in common.py, so this change also exposes the function GetRamdiskFormat.

Bug: 231075507

Signed-off-by: TJ Rhoades <tjr@microsoft.com>
Change-Id: If1b93b887990f0d90df2c6003122821c1e66a1ac
2022-05-02 13:19:49 -07:00
Kelvin Zhang
6a683ce02b Merge identical key/val pairs in dynamic partition info
We might add new values to dynamic_partition_info.txt, so some kind of
generic fallback mechanism is needed. If keys are different, we need to
decided on a case-by-case basis which side takes precedence. For
example, Virtual AB requires vendor support, so vendor side takes
precedence. VABC on T+ devices are implemented entirely in system, so
system/framework side takes precedence.

Bug: 230876542
Test: th
Change-Id: I67747368547d3ef3e29ad64f8f818ef4c5896246
2022-05-02 12:19:45 -07:00
Daniel Norman
02d41af731 Merge "Infers custom vendor partitions." am: d3eb2e30dc am: de1f8d583b
Original change: https://android-review.googlesource.com/c/platform/build/+/2032572

Change-Id: I921e395da6964496203ab15d4251f26ff98313bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-02 17:14:58 +00:00
Daniel Norman
d3eb2e30dc Merge "Infers custom vendor partitions." 2022-05-02 16:25:58 +00:00
Daniel Norman
679242b877 Infers custom vendor partitions.
Rather than hardcoding a list of allowed vendor partitions, we accept
anything in the vendor target files that is not a framework partition.

Also extend support for inferred misc_info keys when the device uses
SYSTEM/product or SYSTEM/system_ext.

Test: test --host releasetools_test
Test: Use to merge a device with a custom IMAGES/*.img in the vendor
      build, and SYSTEM/system_ext in the system build.
Bug: 225902565
Change-Id: I638c0f9c019357150516ea6c208ecd60c03c450f
2022-04-29 15:07:48 -07:00
Cole Faust
5a6481f0ea Merge "Sort rblf_wildcard results and remove file existence functions" am: 76413f4c58 am: 75ed0c7cdf
Original change: https://android-review.googlesource.com/c/platform/build/+/2076126

Change-Id: I82f3d55bba268e5603b2996b5c298986b80d68d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:07:43 +00:00
Cole Faust
76413f4c58 Merge "Sort rblf_wildcard results and remove file existence functions" 2022-04-28 19:54:32 +00:00
Cole Faust
c7b8b6ed88 Sort rblf_wildcard results and remove file existence functions
Kati's $(wildcard) results are guaranteed to be sorted,
but go's filepath.Glob() is not.

Remove the file existence functions because they can
just be replaced with wildcards.

Bug: 226974242
Test: go test
Change-Id: I02fb6292b932bc28cd856ec3c7cb9ed9e96ca630
2022-04-26 12:15:41 -07:00
Treehugger Robot
b1a7268ef2 Merge "[Bugfix] Check for presence before moving" am: f3f9672549 am: 244cbdf09d
Original change: https://android-review.googlesource.com/c/platform/build/+/2059633

Change-Id: If57c75832a7eca9ab5b2399b946b16eb80abf23a
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-25 12:09:51 +00:00
Treehugger Robot
f3f9672549 Merge "[Bugfix] Check for presence before moving" 2022-04-25 11:13:48 +00:00
Jooyung Han
2d9639bb1b Merge "build_image: Support common args" am: 94e79ece44 am: 1c5a2a8407
Original change: https://android-review.googlesource.com/c/platform/build/+/2071827

Change-Id: Ic9750494da0dcd8a0956495da0818f796350ac5c
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-23 02:42:12 +00:00
Jooyung Han
94e79ece44 Merge "build_image: Support common args" 2022-04-23 01:34:30 +00:00
Iavor-Valentin Iftime
42a7160300 Merge "Rebuild and copy recovery and boot img when using vendor_otatools" am: 71585eae2b am: 7ee275cb81 am: 9fd594c53c
Original change: https://android-review.googlesource.com/c/platform/build/+/2068347

Change-Id: Id6c31fc941b14f5349b3b43f314c1a97872a4b4e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 17:06:22 +00:00
Jooyung Han
d9d0d69c4d build_image: Support common args
Even though build_image uses logger but there was no way to configure it
and even -v (verbose) didn't work.

common.ParseOptions() parses common arguments (e.g. -v -h --logfile).

Bug: n/a
Test: m
Test: build_image -v ... should print logs
Change-Id: I45a61ada9c6a5a616f05d3214e185d08b0f1c152
2022-04-22 01:59:33 +09:00