Commit Graph

9037 Commits

Author SHA1 Message Date
Alex Buynytskyy
9ef1caabed Merge "Fix sepolicy finalization build error" into main 2023-10-11 15:31:43 +00:00
Dennis Shen
268e445503 Merge "aconfig: add missing string header to template" into main 2023-10-11 14:01:46 +00:00
Dennis Shen
da07fea741 aconfig: add missing string header to template
Bug: 304338314
Test: atest aconfig.test
Change-Id: I97e62ebd9df18d260fd272a8f63a004ba627de9b
2023-10-11 14:00:48 +00:00
Inseob Kim
4b11cd1a1c Fix sepolicy finalization build error
Bug: 304532197
Test: manually run finalization script
Change-Id: I29f62d7c703081302f1133e881e33fa2ff7d16bf
2023-10-11 22:57:58 +09:00
Treehugger Robot
dcbe60977c Merge "printflags: improve protobuf decode error message" into main 2023-10-11 13:05:02 +00:00
Zhi Dou
22a90f4f10 aconfig: add @UnsupportedAppUsage to methods in generated flags
The java generated flags are marked as @hide which breaks CTS. To
unblock CTS test add @UnsupportedAppUsage to expose the methods.

Test: atest aconfig.test.flags
Bug: 301272559
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:64ad75f50ae96f9a8b57a9e8f88ae9a53d3c1044)
Merged-In: I897573c054e70fc6e093869ba6d416c38f81e28f
Change-Id: I897573c054e70fc6e093869ba6d416c38f81e28f
2023-10-10 13:55:06 +00:00
Mårten Kongstad
6e61f84fd6 printflags: improve protobuf decode error message
Include the file path and first bytes of file in the error message in
case aconfig fails to parse one of the protobuf files.

Example output:

  $ adb shell printflags
  Error: failed to parse /vendor/etc/aconfig_flags.pb ([0a], 1 byte(s))

  Caused by:
      Unexpected EOF

Bug: 304278614
Test: atest printflags.test
Change-Id: I18ff88bd25d72dd477c4b11a32505e75884906ee
2023-10-10 10:12:29 +02:00
Kelvin Zhang
7d1b29bd5d Run validation on user specified vabc_compression_param
During OTA generation, we check the vabc compression param specified by
target files, and override compression param to gz if the specified
compression method is unsupported. Run the same validation on
compression param passed by --vabc_compression_param as well.

Test: th
Change-Id: If855a2ee8c3c280c74efd5a67df229ab6c5709c5
2023-10-09 16:47:19 -07:00
Treehugger Robot
050073eaab Merge "Add zip2zip as a required module of releasetools_common." into main am: 44a7f9ccb3
Original change: https://android-review.googlesource.com/c/platform/build/+/2772848

Change-Id: I8bfe04fed26bcb3a82c94958c535f0989961046d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-05 07:18:30 +00:00
Treehugger Robot
44a7f9ccb3 Merge "Add zip2zip as a required module of releasetools_common." into main 2023-10-05 06:46:26 +00:00
Wei Li
9e37cf263b Add zip2zip as a required module of releasetools_common.
zip2zip is used in function ZipDelete in common.py.

Bug: 303082945
Test: CIs
Change-Id: I7ff1189122aac4915d411b50a6cc76bd76d658f6
2023-10-04 22:23:13 -07:00
Dennis Song
a503a56283 Merge "Resolve conflict AVB rollback index location" into main am: 764585118f
Original change: https://android-review.googlesource.com/c/platform/build/+/2769020

Change-Id: I4f6d2278efb2f5553201d2ae15dfc9b176575972
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 17:48:05 +00:00
Treehugger Robot
006c13c27b Merge "Use deterministic salt for boot image avb footer" into main am: 2b181f9aa1
Original change: https://android-review.googlesource.com/c/platform/build/+/2768202

Change-Id: I834cfd2b29a2eb66f2f339108bfe9c511e6038f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 17:47:15 +00:00
Dennis Song
764585118f Merge "Resolve conflict AVB rollback index location" into main 2023-10-04 17:16:11 +00:00
Dennis Song
4aae62ee77 Resolve conflict AVB rollback index location
Add an `--avb-resolve-rollback-index-location-conflict`
option in merge_target_files. When this option is set,
the merge tool will resolve conflicting index locations
by assigning the smallest unused index location.

This is to support merging system and vendor target files
from two different targets. In this case, the two target
files may have conflict rollback index location because
they were built independently.

Test: atest releasetools_test
Test: validate_target_files *-target_files-*.zip
Test: merge_target_files &&
        add_img_to_target_files &&
        img_from_target_files &&
        flash device
Bug: 300604688
Change-Id: Ibd18ef2a9f3784157fe17966f5364c3c81c9bd9f
2023-10-04 06:45:15 +00:00
Kelvin Zhang
de53f7df43 Use deterministic salt for boot image avb footer
avbtool by default generates a random salt everytime, this makes builds
less reproducible. Use sha256 checksum of kernel image as the hex to
make the build reproducible.

Test: th
Bug: 293313353

Change-Id: I959b3dee77654098ab9fde475f11eaee8d40c790
2023-10-03 12:26:08 -07:00
Zhi Dou
77cb4d4606 Merge "aconfig: change Map.of to Map.ofEntries in FakeFeatureFlagsImp" into main am: d61f2efdbb
Original change: https://android-review.googlesource.com/c/platform/build/+/2768479

Change-Id: I82bc0386acaf7effd4a2890deb7148570d739d91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 18:33:05 +00:00
Zhi Dou
d61f2efdbb Merge "aconfig: change Map.of to Map.ofEntries in FakeFeatureFlagsImp" into main 2023-10-03 17:58:22 +00:00
Dennis Song
de693db329 Merge "Minor refactor tools/releasetools/common.py" into main am: 50e5fbd688
Original change: https://android-review.googlesource.com/c/platform/build/+/2769023

Change-Id: Ia0fdef30d550535aec9bd368535596198e2c6a9d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-03 06:58:00 +00:00
Dennis Song
6e5e44df72 Minor refactor tools/releasetools/common.py
- Sort the import modules in alphabetical order.
- Define module variables for avbtool arguments name.

Test: atest releasetools_test
Bug: 300604688
Change-Id: I7990b94cfc1d7b3e977ceb0a3dc2317689891229
2023-10-03 02:46:51 +00:00
Zhi Dou
b095acbc57 aconfig: change Map.of to Map.ofEntries in FakeFeatureFlagsImp
Map.of can only take 10 entries. Map.ofEntries uses variable arguments.

Bug: 303045451
Test: atest AconfigJavaHostTest
Change-Id: I26a3fa0b8a731f9203934d4a800a5c695cfc730f
2023-10-02 23:57:10 +00:00
Treehugger Robot
fc35a79c49 Merge "Prevent VABC from being disabled on release-key builds" into main am: ad7f4666a6
Original change: https://android-review.googlesource.com/c/platform/build/+/2764967

Change-Id: Ia3364f47e6b16ada034af53dc102e8fa3b11c949
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 19:43:49 +00:00
Treehugger Robot
ad7f4666a6 Merge "Prevent VABC from being disabled on release-key builds" into main 2023-09-27 18:33:10 +00:00
Treehugger Robot
2edf1903d8 Merge "Fix custom image OTA generation with extracted target files" into main am: aad75f8f1b
Original change: https://android-review.googlesource.com/c/platform/build/+/2762658

Change-Id: I4db20eca539ab5e79c787444a9bf8d42bc61ac81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 17:50:25 +00:00
Treehugger Robot
aad75f8f1b Merge "Fix custom image OTA generation with extracted target files" into main 2023-09-27 16:56:17 +00:00
Kelvin Zhang
2f9a9ae64b Prevent VABC from being disabled on release-key builds
VABC is mandated now, and plain VAB will be unsupported later.

Test: th
Change-Id: Iad19433c06b25246d4f7bffe5599035836e36076
2023-09-27 09:35:21 -07:00
Mårten Kongstad
286ea9f8a8 Merge changes from topic "printflags-include-device-config" into main am: dd1ebe9300
Original change: https://android-review.googlesource.com/c/platform/build/+/2763270

Change-Id: I477c1da7dd79b0156819b748d1b2ac3a39dfe84b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 14:22:07 +00:00
Mårten Kongstad
3bb7988492 printflags: include device_config values
Amend the default flag values read from
/<partition>/etc/aconfig_flags.pb with the currently used values as
stored in device_config.

Bug: 301547297
Test: atest printflags.test
Test: adb shell printflags
Change-Id: Ic11702a0ae093d2e9dc3ff543b5ca0684b67e0dc
2023-09-27 10:42:04 +02:00
Kelvin Zhang
0fda62973b Fix custom image OTA generation with extracted target files
Bug: 301909132
Test: ota_from_target_files --custom_image vendor=vendor.img
target_files.zip ota.zip

Change-Id: I9db6e21d47174670e23f461b6107068cbfa35d0f
2023-09-26 16:08:17 -07:00
Treehugger Robot
6ec1c0e15d Merge "Use symlinks instead of hard links" into main am: 3d0567ca4c
Original change: https://android-review.googlesource.com/c/platform/build/+/2760171

Change-Id: I5c4a45a77cda0b96b10b64f0d53446e83f7d7eae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 00:31:32 +00:00
Kelvin Zhang
e14f2a59a3 Use symlinks instead of hard links
Test: th
Bug: 283172692
Change-Id: Idb91448677d94370e052755842a396cc0e1eb588
2023-09-25 15:24:20 -07:00
Mårten Kongstad
7b6140d97d Merge "printflags: introduce device tool to print feature flags" into main am: 28a79fe319
Original change: https://android-review.googlesource.com/c/platform/build/+/2759750

Change-Id: I7f6a2569465e4f2b2f672b88c320a60b74734650
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-25 07:17:31 +00:00
Mårten Kongstad
28a79fe319 Merge "printflags: introduce device tool to print feature flags" into main 2023-09-25 06:51:18 +00:00
Treehugger Robot
fb80ce539e Merge "aconfig: separate package name and flag name using dot" into main am: 2ee29fdf7f
Original change: https://android-review.googlesource.com/c/platform/build/+/2760466

Change-Id: If2bba1ed1cb056ec4f60067a6ba48a1688db3f46
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-22 15:26:01 +00:00
Mårten Kongstad
7fa3cb176c aconfig: separate package name and flag name using dot
Change the package name and flag name separator in the text dump output
from a slash to a dot. This makes the output consistent with how the
flags are encoded in the API tracking files.

Bug: 283910447
Test: atest aconfig.test
Change-Id: Ie3e109073e7f04cf01568e16c29bf2872d07ebad
2023-09-22 13:52:40 +02:00
Mårten Kongstad
433fab94c8 printflags: introduce device tool to print feature flags
Metadata about all feature flags used on device are located in
/<partition>/etc/aconfig_flags.pb. Add a new tool, printflags, to read
and pretty-print these files.

printflags is only intended for debugging purposes.

Bug: 301547297
Test: adb shell printflags
Change-Id: I0a3277fecfc8a60eea0aa6bf362a25a311360b71
2023-09-22 13:47:49 +02:00
Treehugger Robot
8370a90e0f Merge "Move auto_gen_test_config.py to argparse." into main am: badadf9c4b
Original change: https://android-review.googlesource.com/c/platform/build/+/2756029

Change-Id: Ifd79709be40665ddd7fdc9c62bfc74d917bf3b92
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 10:30:50 +00:00
Jingwen Chen
4bccadd460 Move auto_gen_test_config.py to argparse.
Follow up to aosp/2752414

Test: atest-dev auto_gen_test_config_test
Change-Id: I401c6213f0ed5e97eb97b1c603a8b6c5286f0d88
2023-09-19 06:36:19 +00:00
Jingwen Chen
20ebf61214 Merge "Make auto_gen_test_config available to Bazel." into main am: 84b5bb9139
Original change: https://android-review.googlesource.com/c/platform/build/+/2752414

Change-Id: I733ef23456e96bb888b94bd440dab7706eb380d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 00:04:46 +00:00
Jingwen Chen
f3406e64f7 Make auto_gen_test_config available to Bazel.
In the Bazel rule, the actual AndroidManifest.xml file isn't available
in the providers of the android_binary dependency. And for good reason,
we should also rely on aapt2 to dump the manifest contents from the
final packaged APK anyway, but this auto gen script doesn't support
reading the output of aapt2 dump.

This CL adds a simple reader of the output of `aapt2 dump xmltree`, and
enabled if the xmltree content is passed to this tool instead of
AndroidManifest.xml.

Also fixup auto_gen_test_config_test.py. The test was completely failing.

Test: atest auto_gen_test_config_test
Test: presubmits

Change-Id: I7fecd927d0ed7847b6463d964b3698f4164b0177
2023-09-18 12:34:29 +00:00
Treehugger Robot
ca8e0fba2a Merge "Respect framework partition set while merging meta files" into main am: b25e443bc5
Original change: https://android-review.googlesource.com/c/platform/build/+/2749885

Change-Id: Ib22c0f6680d7cc30909dd975faebeae9d066bda2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 19:08:12 +00:00
Treehugger Robot
b25e443bc5 Merge "Respect framework partition set while merging meta files" into main 2023-09-15 17:52:17 +00:00
Dennis Song
36ce326f95 Respect framework partition set while merging meta files
The framework_partition_set would be generated from
framework_item_list and we should respect this partition
set while merging META/ab_partitions.txt.

This is to handle the case when we use a complete merged
target files package as the framework-target-files, where
its ab_partitions.txt may have non-framework partitions.
So we need to filter them out to prevent from the merged
meta file has some partitions that don't exist.

Test: merge_target_files &&
        add_img_to_target_files &&
	img_from_target_files &&
	flash device
Bug: 300193612
Change-Id: I0a76d706a20dcaffa2533278db7383563f03ec02
2023-09-15 06:20:19 +00:00
Zhi Dou
093793c8d7 Merge "aconfig: throw exception if reading from DeviceConfig fails" into main am: c20d115562
Original change: https://android-review.googlesource.com/c/platform/build/+/2751666

Change-Id: I2cd0def3e284c39230780e9c8a8bb60debce3bb9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 19:52:38 +00:00
Treehugger Robot
fe1cb899b2 Merge "aconfig: Fix missing header in the generated c/cpp code" into main am: 2cb7622dca
Original change: https://android-review.googlesource.com/c/platform/build/+/2752628

Change-Id: If1cd7c0f6f62b1ee0ab41f673d648ed6cd6f0566
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 19:52:21 +00:00
Zhi Dou
c20d115562 Merge "aconfig: throw exception if reading from DeviceConfig fails" into main 2023-09-14 19:28:16 +00:00
Dennis Shen
a1de8fd435 aconfig: Fix missing header in the generated c/cpp code
Test: atest aconfig.test
Change-Id: I0c23299ad366cb5c61b84b738dd9e6bf3428435c
2023-09-14 17:40:13 +00:00
Zhi Dou
73a34ce10a aconfig: throw exception if reading from DeviceConfig fails
Reading value from DeviceConfig may fail if the provider is not ready.
Since DeciceConfig, and Settings class are static wrapper on top of
the provider, it won't cause the instance  initialization issue.
Thus when the issue happens it means the provider is not initialized.

Test: atest aconfig.test.java and manually make a change in the
framework and check the exception message
Bug: 299471646

Change-Id: Ic08d7a9cd32a8810a7274b6d93c249abccb50b9e
2023-09-14 13:00:45 +00:00
Cole Faust
a1e610a819 Merge "Change default logging level to WARNING" into main am: 386470f7d7
Original change: https://android-review.googlesource.com/c/platform/build/+/2748498

Change-Id: Ie6a43959c180245efbeb513fad67da919b2447fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 21:17:35 +00:00
Cole Faust
386470f7d7 Merge "Change default logging level to WARNING" into main 2023-09-13 20:22:22 +00:00