Commit graph

3670 commits

Author SHA1 Message Date
Kelvin Zhang
57f23bf317 De-duplicate kernel module names
If BOARD_KERNEL_MODULES_16K contains duplicate kernel modules under
different directories, build will fail with 'multiple overriding
commands error' . To fix it, de-dup BOARD_KERNEL_MODULES_16K base on the
basename of kernel modules files.

Test: th
Change-Id: I45d850d5b3804c54b9ec0133d3a657c2db5adb17
2023-10-26 10:29:55 -07:00
Kelvin Zhang
160762a276 Use deterministic salt for AVB footer of prebuilt boot img
When target specified a prebuilt boot.img, current build system will add
avb hash footer to it with a random salt. Use a deterministic salt
instead for more reproducible builds. To stay consistent with
non-prebuilt boot.img code path, we extract the kernel image from
prebuilt boot.img and uses sha256sum of kernel image as the salt.

Test: th
Bug: 293313353
Change-Id: I988999ddc4f18e0b8677b05a3165c847b6a11b52
2023-10-25 13:28:11 -07:00
Jerome Gaillard
ea9dab478c Add key character maps to layoutlib dist files
This makes key character map files from the framework part of the
layoutlib artifacts so that they can be used in Android Studio to
handle platform key events.

Bug: 255328531
Test: N/A
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1894ff5c78ca33be85d983d28be42870bac0bed0)
Merged-In: I147159912f85daafc97364468d6a6c2cfa3916b8
Change-Id: I147159912f85daafc97364468d6a6c2cfa3916b8

NOTE FOR REVIEWERS - errors occurred while applying the patch.
PLEASE REVIEW CAREFULLY.
Errors:
Error applying patch in core/Makefile, hunk HunkHeader[7006,8->7006,8]: Hunk cannot be applied

Original patch:
 From 1894ff5c78ca33be85d983d28be42870bac0bed0 Mon Sep 17 00:00:00 2001
From: Jerome Gaillard <jgaillard@google.com>
Date: Mon, 24 Oct 2022 16:30:25 +0100
Subject: [PATCH] Add key character maps to layoutlib dist files

This makes key character map files from the framework part of the
layoutlib artifacts so that they can be used in Android Studio to
handle platform key events.

Bug: 255328531
Test: N/A
Change-Id: I147159912f85daafc97364468d6a6c2cfa3916b8
---
2023-10-25 01:15:53 +00:00
Sandeep Dhavale
d7cc7e8f9a Add support for specifying erofs blocksize
This change allows us to specify erofs filesystem block size
which will be used to create erofs image.

Either it can be specified at board level using
BOARD_EROFS_BLOCKSIZE. Or per read only partition image
using BOARD_<PARTITION>IMAGE_EROFS_BLOCKSIZE.

Examples:
BOARD_EROFS_BLOCKSIZE := 16384 OR
BOARD_PRODUCTIMAGE_EROFS_BLOCKSIZE := 16384

Bug: 303316443
Test: m and file ${ANDROID_PRODUCT_OUT}/*.img

Change-Id: I9bf3d299ae02165d0bffc62f474a302408d8b9b9
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
2023-10-18 08:23:36 -07:00
Treehugger Robot
0968914e2c Merge "Revert "Add a check that the staging directories don't..."" into main 2023-10-13 05:32:56 +00:00
Cole Faust
be5e391055 Revert "Add a check that the staging directories don't..."
Revert submission 2773149-partition_file_list_check

Reason for revert: b/305103467, b/305103783, b/305103468
Reverted changes: /q/submissionid:2773149-partition_file_list_check

Change-Id: I2fab3b4d7d24af4488e777ad84e12e280c42dcc0
2023-10-13 02:51:10 +00:00
Kelvin Zhang
ad3c30528d Skip stripping 16K GKI kernel modules
GKI kernel modules are required to be signed, but curretnly we strip all
16K kernel modules. Use SYSTEM_DLKM_MODULE_PATTERNS to determine which
modules are GKI, and skip stripping for these kernel modules.

Test: boot using 16K boot image
Bug: 303725887

Change-Id: I4cd71b39ceb75650d03744220ec4ddf4aeeda871
2023-10-12 10:31:44 -07:00
Cole Faust
fe455d1c0c Merge "Add a check that the staging directories don't..." into main 2023-10-12 16:33:12 +00:00
Jooyung Han
737f6e5c18 APEX extraction rule mentions APEXes
so that it's triggered even when APEX list shrinks.
(-d explain will print "command line changed for ...")

To repro:
- Pick one VAPEX with vintf fragment.
- Copy the fragment to /vendor/etc/vintf/manifest (DEVICE_MANIFEST_FILE)
- `m check-vintf-all` should fail
- Remove the APEX from PRODUCT_PACKAGES
- `m check-vintf-all` should pass

Bug: 304769672
Test: m check-vintf-all
   (see above)
Change-Id: Iae9da91105faebfb8a5127fbb02a414b9ffdca10
2023-10-12 10:39:58 +09:00
Cole Faust
80fad16d14 Add a check that the staging directories don't...
...contain extra files after an installclean.

Bug: 205632228
Test: m installclean && m
Change-Id: Ib021465d1089a21bc4f43306b1441348baf71f9c
2023-10-11 17:42:34 -07:00
Tapas Pradhan
d2d30f6baf makefile:strip generic ramdisk kernel modules in android build system.
Buganizer: 298884633
Test: manual test
Change-Id: I72b21d806ab18e8274dff04445415fe8d2613729
2023-10-06 13:30:41 +05:30
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
Cole Faust
985332eaca Merge "Revert^3 "Make the target_files zip reflect the recent partition change"" into main 2023-09-29 18:09:39 +00:00
Cole Faust
83fe17e0a4 Revert^3 "Make the target_files zip reflect the recent partition change"
This reverts commit cb63de55b7.

Reason for revert: Still more broken devices

Change-Id: Ic55ba78dd9c2e34dc96549ac8aba65fdbefd379b
2023-09-29 00:22:27 +00:00
Cole Faust
13d374ab41 Remove other partition's AVB properties
This is to ensure a partition doesn't need to be aware of the other
partitions in order to be built.

Also sort the image info file so it's easier to compare with bazel.

Bug: 297269187
Test: m && emulator on sdk_phone_x86_64-userdebug
Change-Id: I8e4b2049f602c8db109bf53e1359751a9ed9dd7a
2023-09-28 12:04:56 -07:00
Cole Faust
00bf14b0f3 Merge "Revert^2 "Make the target_files zip reflect the recent partition change"" into main 2023-09-25 21:07:57 +00:00
Cole Faust
cb63de55b7 Revert^2 "Make the target_files zip reflect the recent partition change"
This reverts commit 612b362ca3.

Reason for revert: Excluding the failing product in ag/24856527

Change-Id: I28664302a7fd98ce9bd88e6ce9679b53846b1859
2023-09-25 19:41:25 +00:00
Bart Sears
f576d31d62 Merge "Revert "Make the target_files zip reflect the recent partition change"" into main 2023-09-23 20:18:40 +00:00
Ed Tam
612b362ca3 Revert "Make the target_files zip reflect the recent partition change"
This reverts commit 60061340a5.

Reason for revert: Breaking wifi/sim network connectivity
Bug: 301547660

Change-Id: I1ebf27613a3db8f88a060af2ccfe2a07b64bd7eb
2023-09-23 05:24:41 +00:00
Treehugger Robot
ad30396b0e Merge "Make the target_files zip reflect the recent partition change" into main 2023-09-20 19:40:01 +00:00
Cole Faust
60061340a5 Make the target_files zip reflect the recent partition change
The target_files zip includes a copy of all the installed files.
It wasn't updated to match aosp/2746998, causing a discrepency between
the target files zip and what was actually on the device.

Bug: 205632228
Bug: 300267995
Test: m dist, then compared the list of files in out/dist/sdk_phone_x86_64-target_files-colefaust.zip before/after this cl
Change-Id: I825fe110285f4e9550b264dea162a4bd7c3daef6
2023-09-20 18:33:02 +00:00
Kelvin Zhang
4a4bbda6e7 Add an execution check for BOARD_KERNEL_VERSION
Make sure the specified BOARD_KERNEL_VERSION matches what we extract
from the kernel binary. As other parts of the build system might rely on
the kernel version.

Test: set BOARD_KERNERL_VERSION to foo, make sure build fails
Bug: 293313353
Change-Id: I9005d338fcc3dbb692a6ea7a518a5e63219b2c99
2023-09-19 14:36:56 -07:00
Daniel Zheng
2860f5f574 Merge "remove --apply-vbmeta from vbmeta_vendor" into main 2023-09-13 07:26:43 +00:00
Daniel Zheng
ba67aa4aee remove --apply-vbmeta from vbmeta_vendor
Removing this flag as --apply-vbmeta should only be used for root vbmeta
partitions.

Test: m fastboot_info, fastboot flashall
Bug: 299440104
Change-Id: I4910008635b16c4f4194ebd45da26bd1a8875fc1
2023-09-12 09:43:09 -07:00
Jooyung Han
f3c3f40c3b Merge "Run apex_sepolicy_tests for all installed APEXes" into main 2023-09-11 22:30:20 +00:00
Jooyung Han
e78ad74b2b Run apex_sepolicy_tests for all installed APEXes
This is to check if unknown file context labels are used in APEX. The
reason why this is done in Makefile is to cover vendor-specific SE
policy and prebuilt APEXes. Note that there's already a validation check
when building APEXes (in Soong), which only checks the generic rules,
not vendor-specific.

Bug: 299391194
Test: atest apex_sepolicy_tests_test
Test: m
Change-Id: I4378b7530e8433d2bf188db95cb5bf791e3bf778
2023-09-11 13:40:52 +09:00
Cole Faust
152cdfab7c Clean staging dirs in build_image.py
build_image.py now accepts a --input-directory-filter-file argument
that contains a list of files to consider from the input directory.
A new, temporary input directory will be created, and only the
considered files will be copied to it.

This removes most of the need for `m installclean`, as old files or
files built manually will no longer end up on the partition.

Bug: 205632228
Test: Presubmits
Change-Id: I07e0bf8e840abf0b51a2fdf67b758905fb3c5b5b
2023-09-08 16:24:26 -07:00
Firman Prayoga
44d86b138b Merge "Revert "Clean staging dirs in build_image.py"" into main 2023-09-08 04:06:57 +00:00
Firman Prayoga
df21706765 Revert "Clean staging dirs in build_image.py"
Revert submission 2736954-proper_installclean

Reason for revert: Potential culprit for build breakage b/299545346

Reverted changes: /q/submissionid:2736954-proper_installclean

Change-Id: I2b0671bd40b7a74ef02923a777ec899401691454
2023-09-08 01:24:45 +00:00
Cole Faust
c383825953 Merge "Clean staging dirs in build_image.py" into main 2023-09-07 16:41:45 +00:00
Cole Faust
48b81e7386 Clean staging dirs in build_image.py
build_image.py now accepts a --input-directory-filter-file argument
that contains a list of files to consider from the input directory.
A new, temporary input directory will be created, and only the
considered files will be copied to it.

This removes most of the need for `m installclean`, as old files or
files built manually will no longer end up on the partition.

Bug: 205632228
Test: Presubmits
Change-Id: I4c82ac7f1ed49a37271755749c8f72afeeb7f295
2023-09-06 11:51:13 -07:00
Cole Faust
56e8f7009c Merge "Install LOCAL_SOONG_INSTALL_SYMLINKS even if LOCAL_SOONG_INSTALLED_MODULE isn't set" into main 2023-09-06 00:15:09 +00:00
Cole Faust
c67e769b8c Install LOCAL_SOONG_INSTALL_SYMLINKS even if LOCAL_SOONG_INSTALLED_MODULE isn't set
LOCAL_SOONG_INSTALL_SYMLINKS can now be set by the install_symlink
module type. The install_symlink module type doesn't set
LOCAL_SOONG_INSTALLED_MODULE because make tries to copy that file
around, which doesn't work with a symlink.

Bug: 205632228
Test: built and ran the emulator observed the /system/bin/hwservicemanager symlink is still there
Change-Id: I1ec355b5ae057d0b7fe167674d70da6a4d03f6b5
2023-09-05 14:16:38 -07:00
Treehugger Robot
4d779cf4cd Merge "Reland: Add 16k/4k boot OTAs to /system partition" into main 2023-09-05 16:55:20 +00:00
Kelvin Zhang
1738012f6d Reland: Add 16k/4k boot OTAs to /system partition
This allows switching kernels without downloading anything from
internet.

Test: th
Bug: 293313353

This reverts commit 2610f34671.

Change-Id: Iec6c9f9404ac1bb3286613c33d79b00b20c4c8bb
2023-09-01 17:04:43 +00:00
Kelvin Zhang
542a27eecf Add missing depdency for 16k boot image
Bug: 298295675
Bug: 293313353
Test: th
Change-Id: I9679c151e77398e161c04487699bc3a0d776ab13
2023-08-31 16:25:12 -07:00
Treehugger Robot
bf5f9bf015 Merge "Build the proguard dict zip without PACKAGING intermediates" into main 2023-08-31 19:37:27 +00:00
Kelvin Zhang
a87ce9086f Merge "Resize boot_16k.img properly" into main 2023-08-31 19:17:34 +00:00
Kelvin Zhang
bf2d400799 Resize boot_16k.img properly
Bootloaders often assume boot partition to be 64MB in size. Correctly
size boot_16k.img so that bootloader can verify the AVB footers.

Test: th
Bug: 293313353
Change-Id: I322277b10e99a41c9a262ff76e2f29c3ed16fec0
2023-08-31 12:17:14 -07:00
Devin Moore
01e56d0ae0 Merge changes from topic "no_hidl_support" into main
* changes:
  Add symlink to hwservicemanager
  Remove hwservicemanager and hidl allocator.
2023-08-31 15:51:14 +00:00
Ken Chen
2610f34671 Revert "Add 16k/4k boot OTAs to /system partition"
This reverts commit a2674525ae.

Reason for revert: Investigate b/298295675

Change-Id: Ia44137695d6e9a1b99f4cc6e4dcc88bd3b4156db
2023-08-31 02:38:02 +00:00
Cole Faust
b35231ece0 Build the proguard dict zip without PACKAGING intermediates
Before, as each module was built, it would dump its proguard-related
files into the PACKAGING folder. Then the rule for the final distable
zip would zip up this whole folder. This means that if you built a
module that was not part of the system, and then rebuilt the final
zip, it would erronously include more proguard files than necessary.
This problem was worked around by relying on CI to run `m installclean`
every time.

Now, the zip proguard files always include the same information.

This also makes it so that when you build a module, its proguard files
are not copied to the PACKAGING folder, making builds that don't
build the final proguard zips slightly faster.

Bug: 205632228
Test: diff'd proguard-dict.zip, proguard-dict-mapping.textproto, and proguard-usage.zip before/after this cl on sdk_phone_x86_64. They have diffs, but only in the order of files / lines.

Change-Id: I98c02e1eb117c337ba9b98f04ad486597eb9bb86
2023-08-30 17:17:19 -07:00
Kelvin Zhang
a2674525ae Add 16k/4k boot OTAs to /system partition
This allows switching kernels without downloading anything from
internet.

Test: th
Bug: 293313353
Change-Id: I29e48dc191091930a7d0a690924b37c572fa9356
2023-08-30 13:06:17 -07:00
Kelvin Zhang
506a30851e Add timestamp to 16K boot OTA
Test: th
Bug: 297536338
Change-Id: Id4919d2437079e36899cd4c56da011a29aa0b470
2023-08-29 19:38:19 -07:00
Kelvin Zhang
ed60c9da27 Sign the 16K boot image OTA
Sign the 16K OTA package so that it can be installed by device.

Test: th
Bug: 293313353
Change-Id: I2f1f6f5430fc920d5edeeab3f3335cbdf76fdefd
2023-08-29 19:18:49 -07:00
Jooyung Han
5d7f9cb2a1 Merge "Remove TARGET_FLATTEN_APEX" into main 2023-08-28 00:32:35 +00:00
Kelvin Zhang
e9f4ce4368 Fix 16k ota package build failures on pixel
boot_ota_16k.zip relies on build_boot_from_kernel_avb_enabled. But that
makefile function is guarded by $(BOARD_PREBUILT_BOOTIMAGE). Pixel
defined BOARD_PREBUILT_BOOTIMAGE, which causes
build_boot_from_kernel_avb_enabled to be undefined, resulting in build
failure.

Test: th
Bug: 293313353
Change-Id: I5b01e9bf7fedd9c508f476bc243d860dc48c5ebb
2023-08-25 10:41:48 -07:00
Jooyung Han
0d500c58aa Remove TARGET_FLATTEN_APEX
And inherit updatable_apex.mk by default.

Bug: 278826656
Test: presubmit
Change-Id: I3f93608a8750dcd72edc3f9517c70f3490f1a7cd
2023-08-25 15:06:20 +09:00
Kelvin Zhang
19c36a5ee7 Use platform built lz4 tool rather than system copy
Test: th
Bug: 293313353
Change-Id: I22d5b6906dfd30f947eaa06d6196cdf560c50722
2023-08-24 18:10:24 -07:00
Kelvin Zhang
9113badc39 Fix 16K page size kernel config check
Non 16K kernels might have "CONFIG_ARM64_16K_PAGES is not set" string in
kernel config, properly handle this case.

Test: th
Bug: 293313353
Change-Id: I1a9582503c5fd20b8dcf95406166df7e11940424
2023-08-24 14:26:23 -07:00