Commit graph

3646 commits

Author SHA1 Message Date
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
Kelvin Zhang
6257eb2144 Add a 16K boot partition OTA target
This OTA will be used to switch real devices to 16K kernel

Test: th
Bug: 293313353
Change-Id: I7a5866fd6f7f4ba6646af019386085ea2646c93f
2023-08-24 13:44:59 -07:00
Kelvin Zhang
cde8734295 Build a boot image for 16K kernel
This image can be used to switch the device to 16K kernel.

Test: th
Bug: 293313353
Change-Id: Iea3ad29e0b3789f0c499004f3f346ab3c460f39e
2023-08-21 21:05:43 -07:00
Treehugger Robot
de9df1dcf6 Merge changes I2920d8b0,I55cd3340 into main
* changes:
  Add 16K ramdisk to vendor_boot
  Move 16K kernel modules to /lib/modules/`uname -r`_16k
2023-08-21 21:32:02 +00:00
Kelvin Zhang
b71bc1bcde Add 16K ramdisk to vendor_boot
Store both 4K and 16K kernel modules in vendor_boot, this allows the
device to switch between two kernels easily.

Test: th
Bug: 293313353
Change-Id: I2920d8b0fe762defe273912efa89bc1b5642fdb2
2023-08-18 11:09:06 -07:00
Kelvin Zhang
0a1dd239cc Move 16K kernel modules to /lib/modules/uname -r_16k
Store 16K kernel modules in separate directory. This allows us to store
both 4k and 16k kernel modules in vendor_boot and have init load from
the right path.

Test: th
Bug: 293313353
Change-Id: I55cd33404defc71dfbd350517d2aa51bebdb3d06
2023-08-18 11:02:19 -07:00
Ming-Chen Chung
c2038e8e3d Merge "Add update_device to be built and be packaged into otatools.zip." into main 2023-08-15 01:55:05 +00:00
Treehugger Robot
66f7958fbf Merge "Makefile: Avoid packaging pvmfw.bin in /system" into main 2023-08-14 16:04:20 +00:00
Yu Liu
50b31493f7 Merge "Add device-tests as a dep of JACOCO_REPORT_CLASSES_ALL." into main 2023-08-11 21:40:01 +00:00
Yu Liu
affd00883f Add device-tests as a dep of JACOCO_REPORT_CLASSES_ALL.
Bug: 289380707
Test: CI
Change-Id: Id201bda1bd4acfc6cadada982e20dee19d8c703a
2023-08-11 12:59:45 -07:00
Ming-Chen Chung
ee3a191656 Add update_device to be built and be packaged into otatools.zip.
Change-Id: Ifd204a0d67815e4a443eb6c34c4545b2484bdf57
2023-08-10 19:57:58 +00:00
David Iserovich
babdafe97e [config] Dist supports custom super image script
Some boards need to supply a custom super image script, and this
is supported via the BOARD_CUSTOM_BUILD_SUPER_IMAGE variable.

However, this variable is not used by img_from_target_files.py.

Change img_from_target_files.py to call the supplied script.

Bug: None
Change-Id: I6bca937534f58459d3419139ee7a37a10138ab8f
2023-08-10 18:12:44 +00:00
Pierre-Clément Tosi
4e1f71ff7e Makefile: Avoid packaging pvmfw.bin in /system
Test: TH # In particular, make sure that b/261393794 isn't back.
Bug: 294177504
Change-Id: I1111ffb4a9e130568375329500c97eb850c0bfa1
2023-08-02 11:40:29 +01:00
Treehugger Robot
8cad379e98 Merge "Revert "Revert "Add system staging dir stamp file for bazel sand..."" into main 2023-08-02 04:11:10 +00:00
Treehugger Robot
d5474ac3da Merge "Add the option for custom_image to be AVB or NONAVB" into main 2023-08-01 19:08:06 +00:00
Cole Faust
4ad906d6a4 Revert "Revert "Add system staging dir stamp file for bazel sand..."
Revert submission 2685589-revert-2651299-bazel_sandwich-TVXWOASJNU

Reason for revert: It was not the cause of b/293883239

Reverted changes: /q/submissionid:2685589-revert-2651299-bazel_sandwich-TVXWOASJNU

Change-Id: I98ca2be7490a4e38d35e4e640a0d027711b67030
2023-08-01 16:38:58 +00:00
Jooyung Han
f6a2234a54 Revert "Add system staging dir stamp file for bazel sandwich"
Revert submission 2651299-bazel_sandwich

Reason for revert: b/293883239, checking if this breaks the build.

Reverted changes: /q/submissionid:2651299-bazel_sandwich

Change-Id: I40661772148434adf5fbec9568b4c303ff7eaf1c
2023-08-01 05:15:28 +00:00
Cole Faust
82222146ee Add system staging dir stamp file for bazel sandwich
This stamp file is an alias to request that the system staging directory
be built. The bazel sandwich cannot know the full list of files in the
staging directory at analysis time, so it will just depend on this
instead, and then find all the files in the staging dir at execution
time.

Bug: 265127181
Test: m bazel_sandwich
Change-Id: Iee3dff4f77c9e7054b4e8297e5d96b4ef8bf1cbb
2023-07-27 10:14:36 -07:00
Ray-cy.lee
e97e0cb16b Add the option for custom_image to be AVB or NONAVB
Check BOARD_AVB_$(call to-upper,$(partition))_KEY_PATH to decide whether custom_image should sign AVB or not. If key path isn't set, the custom image will be excluded from AVB and copied to /IMAGES in target-files directly. This allows vendor to use custom_images flow packing unsigned image.
And to every non-avb custom partition, one image whose name is partition name must be added in its BOARD_<CUSTOM_PARTITION>_IMAGE_LIST.

BOARD_CUSTOMIMAGES_PARTITION_LIST := tvconfig
BOARD_TVCONFIG_IMAGE_LIST := \
    device/xxxx/yyyy/tvconfig.img \
    device/xxxx/yyyy/tvconfig_custom1.img

Test:
1) Build image, target-files, OTA package by m and m dist
2) Sign images by sign_target_files_apk.py

Fix: 285227850
Change-Id: I7477dafe023e4b168f0f08fb7aedd9e511a60e1b
2023-07-26 20:21:29 +08:00
Jooyung Han
8d72515292 Support .(dot) files in root
When .(dot) file/dir is added to the rootdir, it works with normal `m
systemimage` build, but fails when building the images with target
files because the copy command misses .(dot) files.

When packaging, need to copy the whole content from the src directory.
This also matches the condition `ls -A` (which means, we care about dot
files as well).

Bug: 292438323
Test: m dist (aosp_cf_x86_64_phone-userdebug)
Change-Id: Ib3f555305c915d499448c2064e5639a641b2ddb7
2023-07-25 13:58:19 +09:00
Treehugger Robot
21e6105b79 Merge "Combine aconfig cache files into per-partition dumps." into main 2023-07-21 14:34:44 +00:00
David Fu
4c1bc5b9b7 Merge "Added haiku-presubmit phony rule to makefile" into main 2023-07-20 17:00:05 +00:00
Daniel Zheng
0ee11559f9 Merge "Moving vendor_boot out of BOARD_AVB_ENABLE block" into main 2023-07-19 15:57:45 +00:00
Justin Yun
22ce9479be Disable copying images for target_files.zip
For the OTA build, target_files.zip requires setting fixed timestamp
for images. However, it caused regression on 'adb sync'.
Restoring image build process for target_files.zip instead of copying
them from the PRODUCT_OUT, only the images in target_files.zip set the
fixed timestamp.
By setting COPY_IMAGES_FOR_TARGET_FILES_ZIP flag, we still may copy
the images for target_files.zip for future use.

Bug: 287534409
Test: m; flashall; adb sync
Test: m dist; flash images from target_files.zip and check the timestamp
Change-Id: I4135eb721c33581f191621847e6595833263d707
2023-07-17 07:46:48 +09:00
Cole Faust
f5350e965b Merge "Remove BOARD_BPT* variables and the bpt parition table image" into main 2023-07-12 01:26:51 +00:00