Commit graph

2916 commits

Author SHA1 Message Date
Petri Gynther
6a6d6217d7 Cleanup: internal vendor ramdisk targets
Test: make
Change-Id: I356e82ab9b32164ff734567f489faf31021dfc4b
2021-03-07 00:51:40 -08:00
Petri Gynther
828828ba07 Add support for building vendor_ramdisk.img
Allow BoardConfig.mk to set:
BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true

to build:
out/target/product/<name>/vendor_ramdisk.img

This is done to support GKI device kernel development.

Kernel developers build vmlinux + DTB + GKI kernel modules locally
and then use kernel build tools to output:

* vmlinux + ramdisk.img => boot.img
* GKI kernel modules + DTB + vendor_ramdisk.img => vendor_boot.img

In other words, kernel developers use ramdisk.img and vendor_ramdisk.img
as prebuilts for building flashable boot.img and vendor_boot.img
directly from the kernel development environment.

Test: make vendorramdisk with BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true
Test: make vendorramdisk with BOARD_BUILD_VENDOR_RAMDISK_IMAGE omitted
Change-Id: Id67839887b6bf608f4a5f13384c551c12ee9fdbd
2021-03-05 17:45:03 -08:00
Treehugger Robot
5d8217afb7 Merge "Fix m bootimage_test_harness failure" 2021-03-05 15:03:39 +00:00
Bowgo Tsai
f85e68f554 Fix m bootimage_test_harness failure
Commit I66b57de91042bfd56ba54a3659843d8cf7873955 added the support
for different boot partition sizes but didn't consider the case of
building boot-test-harness.img. This CL fixes this by allowing
'boot-test-harness.img' as a boot image variant.

Bug: 181618515
Test: `m bootimage_test_harness` pass
Change-Id: I190d3bf26725ac54999758efbca66a94c5cd5c86
2021-03-04 14:41:16 +08:00
Petri Gynther
dc24d88aa9 Rename vendor-ramdisk to vendor_ramdisk
Rename to get consistent ramdisk directory naming in
out/target/product/<name>:
  debug_ramdisk
  ramdisk
  vendor_debug_ramdisk
  vendor_ramdisk

Test: build and inspect out/target/product/<name>
Change-Id: I81d8f2cafe5e1b9024196cd74772b78d4a4aec58
2021-03-03 13:56:48 -08:00
Treehugger Robot
0e0307b0a2 Merge "Add dependency from target-files.zip to rsync'd recovery ramdisk files" 2021-02-25 06:03:01 +00:00
Colin Cross
e643120c75 Add dependency from target-files.zip to rsync'd recovery ramdisk files
target-files.zip may indirectly depend on the rsync'd recovery ramdisk
files when BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is true.

Bug: 181095653
Test: manual
Change-Id: I673bb48b1fbb7a54455cda411f9444f05ddaa24f
2021-02-24 11:44:55 -08:00
Devin Moore
fd4f3c4c63 Merge "Support vendor bootconfig creation" 2021-02-24 15:56:48 +00:00
Daniel Norman
48603ff158 Creates a combined split-sepolicy file in merge_target_files.py.
This follows the same steps as OpenSplitPolicy() in
system/core/init/selinux.cpp on the device.

Bug: 178864050
Test: merge_target_files for R+S and S+S devices
Test: test_merge_target_files
Change-Id: Ia41a436bfda8e2cb65706122f0ff3805b99d16e1
2021-02-23 11:41:29 -08:00
Devin Moore
50509015bf Support vendor bootconfig creation
Gather all BOARD_BOOTCONFIG parameters.
Create vendor-bootconfig.img with parameters seperated by newlines. Pass
that file to mkbootimg as --vendor_bootconfig to add it to the
vendor_boot.img.

Test: Add BOARD_BOOTCONFIG parameters in cuttlefish .mk file
      Check vendor-bootconfig.img for expected output
      Verify expected vendor_boot.img format with:
      unpack_bootimg --boot_image vendor_boot.img
Test: Update Cuttlefish bootloader to handle the new vendor_boot.img and
      check /proc/bootconfig for the expexted parameters.
Bug: 173815685
Change-Id: Iaa9b71b4bc64375777a5353396e83bb2beb25c47
2021-02-23 07:42:05 -08:00
Yo Chiang
b84604198c Merge "Kernel modules: add modules.blocklist build support" 2021-02-15 06:45:57 +00:00
Treehugger Robot
bff5273dd0 Merge "Adding repack_bootimg into otatools.zip" 2021-02-06 08:00:55 +00:00
Colin Cross
effaa0414b Merge "Use RSP file for soong_zip in target_files.zip" 2021-02-05 21:33:37 +00:00
Bowgo Tsai
6c37c172c6 Adding repack_bootimg into otatools.zip
repack_bootimg is useful to add files into a ramdisk, then repack
a boot.img. Note that mkbootimg, unpack_bootimg, lz4, minigzip, etc.,
that repack_bootimg depends are already in otatools.zip.

Bug: 174443192
Test: `m otatools-package`, unzip $OUT/otatools.zip, export $PATH
      with ./otatools/bin and checks unpack_bootimg can run
Change-Id: Id4fbf2076b50522b95ab46dfeb1e2b7115d6606d
2021-02-05 18:14:34 +08:00
Yi-Yo Chiang
c12dd84d01 Kernel modules: add modules.blocklist build support
BOARD_<partition>_KERNEL_MODULES_BLOCKLIST_FILE<kernel_version> checks
the syntax of and installs a prebuilt modules.blocklist file.

Example usage:
```
BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := \
  $(wildcard <path to prebuilt modules.blocklist>)
```

Then the modules blocklist would be install to
(vendor|vendor_dlkm)/lib/modules/modules.blocklist.

Bug: 175165656
Test: Create a blocklist with incorrect syntax, verify build fails
Test: Verify the new macro indeed installs the blocklist file
Change-Id: Icb75aae1bdb45546792f28f4c4e8d06d9439391a
2021-02-05 16:28:34 +08:00
Colin Cross
17e98b7ca2 Use RSP file for soong_zip in target_files.zip
target_files.zip passes a list of files to soong_zip in a file list
file, which soong_zip interprets as a glob.  Adding a file called "["
causes soong_zip to error with "syntax error in pattern".  Use an RSP
file instead, which after I1de7829c668538204fc4a2ac793a4f88dbc886c9
does not interpret entries as globs.

Bug: 179297188
Test: m target-files-package
soong_zip: don't glob RSP file entries

File arguments are considered globs, but RSP file entries should be
considered filenames without globbing.  Escape RSP file entries so
they don't get treated as globs later.

Bug: 179297188
Test: zip_test.go
Change-Id: I0736f2d1802114217cba03ee32b67479c9d98da8
2021-02-03 16:03:55 -08:00
Nikita Ioffe
3608148612 Add support for signing a compressed apex
Test: atest releasetools_test
Bug: 172912232
Change-Id: I4630578694afbab675db770b46898cc32f1861f3
2021-01-27 01:27:11 +00:00
Treehugger Robot
c12f1084c0 Merge "Moving $OUT/vendor-ramdisk-debug.cpio.lz4 to intermediate dir" 2021-01-24 14:53:43 +00:00
Jiyong Park
3c87560119 Add a missing guard around JACOCO_REPORT_CLASSES_ALL
Fixing a mistake that was made by
https://android-review.googlesource.com/c/platform/build/+/1549484/

Bug: N/A
Test: m nothing
Change-Id: I5d4c14934e9fa3fc493dcddb2916d39054da7422
2021-01-21 12:48:11 +09:00
Treehugger Robot
75c4e3483f Merge "Concat INTERNAL_*IMAGE_FILES into INTERNAL_ALLIMAGES_FILES" 2021-01-21 00:28:02 +00:00
Treehugger Robot
6e455b8ca3 Merge "Emit virtual_ab_compression prop to dynamic_parttiion_info.txt" 2021-01-20 19:04:11 +00:00
Bowgo Tsai
7ac96037c3 Moving $OUT/vendor-ramdisk-debug.cpio.lz4 to intermediate dir
vendor-ramdisk-debug.cpio.lz4 will be packed into a
vendor_boot-debug.img and usually won't be flashed directly.

Moving it to the intermediate build directory.

Bug: None
Test: make vendorbootimage_debug
Change-Id: I86ea72c7a3484a90286139624408d07ce4bf994c
2021-01-20 22:33:13 +08:00
Yo Chiang
865fd0c010 Merge "Specify --ramdisk_name for vendor ramdisks for vendor_boot v4" 2021-01-20 08:50:30 +00:00
Kelvin Zhang
239a79ae19 Emit virtual_ab_compression prop to dynamic_parttiion_info.txt
Test: mm -j && mm -j dist, make sure virtual_ab_compression is set to
true in dynamic_partition_info.txt of target_File.zip

Change-Id: Id0d46bd8ed738b2b69a0c01481b7db0c7127f773
2021-01-19 16:11:32 -05:00
Yo Chiang
68ab626aac Specify --ramdisk_name for vendor ramdisks for vendor_boot v4
When building vendor_boot v4 with multiple vendor ramdisks, pass the
name of each ramdisk to mkbootimg.

Bug: 177882072
Test: Modify a device BoardConfig and verify the built vendor_boot.img
  with unpack_bootimg
Change-Id: I679d277aa88f1e10678d2f74b579e4140536e267
2021-01-19 18:58:43 +08:00
Bowgo Tsai
ceaa411fcb Includes recovery resources into vendor_boot-debug.img
Commit I56dda56bab7def1540f4fb506323e3e605620cd4 adds
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT and includes
$(TARGET_RECOVERY_ROOT_OUT) directory when building vendor
ramdisk if BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is set.

We should do the same thing when building the vendor debug
ramdisk as well. Otherwise, lacking some recovery files
makes the device unable to boot into fastbootd/recovery mode.

Bug: 177712689
Test: `make vendorbootimage_debug`, then unpack
      ./obj/PACKAGING/vendor-boot-debug_intermediates/vendor-ramdisk-debug.cpio.lz4
      to check it includes recovery resources via:
      `lz4 -d -c ../vendor-ramdisk-debug.cpio.lz4 | cpio -idm`
Test: device can boot into fastbootd after flashing vendor_boot-debug.img

Change-Id: I4744c6600866436ed7d5a321e67e20b8f3da8a81
2021-01-19 17:07:45 +08:00
Jiyong Park
f66f0ececc Concat INTERNAL_*IMAGE_FILES into INTERNAL_ALLIMAGES_FILES
As we add more partitions, INTERNAL_*IMAGE_FILES variables has grown
and the places where the variables are referenced had to be touched
everytime. This change introduces a new variable
INTERNAL_ALLIMAGES_FILES which concatnates INTERNAL_*IMAGE_FILES, and
replaces the uses of the variables with the new one.

Bug: N/A
Test: m
Change-Id: I62a0f725a0f6999421d04a6261370be9124e62d7
2021-01-14 11:23:12 +09:00
Yo Chiang
d21e7dc833 Add support for packing multiple vendor ramdisks in vendor_boot
Add support for partitioning the vendor_boot kernel modules into
multiple vendor ramdisk fragments. The partition granularity is kernel
module directory. This mechanism builds upon the existing
BOARD_KERNEL_MODULE_DIRS mechanism. For example, say we have three
kernel module directories:

BOARD_KERNEL_MODULE_DIRS := foo bar baz

We can then define a vendor ramdisk fragment:

BOARD_MKBOOTIMG_ARGS += --header_version 4
BOARD_VENDOR_RAMDISK_FRAGMENTS := dlkm_foobar

And let said ramdisk to contain the DLKM directories "foo" and "bar":

BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm_foobar.KERNEL_MODULE_DIRS := foo bar
BOARD_VENDOR_RAMDISK_FRAGMENT.dlkm_foobar.MKBOOTIMG_ARGS := <mkbootimg args>

The built vendor_boot image would contain two ramdisks.
The first one being the "default" ramdisk, which contains DLKM directory
"baz" and the rest of the files that get's installed to
$(TARGET_VENDOR_RAMDISK_OUT).
The second one is the "dlkm_foobar" ramdisk, which contains the two DLKM
directories.

Design doc: go/vendor-boot-v4

Bug: 162864255
Test: Modify BoardConfig.mk to have a product build v4 vendor_boot
Test: Use unpack_bootimg to verify the vendor_boot image
Test: Teach a bootloader how to handle v4 boot image, flash boot &
  vendor_boot and boot device
Change-Id: Ibb1bbd7ebe36430c55ec6c4818c1d3888a319089
2020-12-17 11:07:04 +08:00
Jaegeuk Kim
863a120b51 Merge "Enable system partition compression" am: 74e57f6482
Original change: https://android-review.googlesource.com/c/platform/build/+/1520098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7b50510b61129704f71ab4d9c474d74f4739aef0
2020-12-10 00:58:46 +00:00
Jaegeuk Kim
74e57f6482 Merge "Enable system partition compression" 2020-12-10 00:41:04 +00:00
Anton Hansson
314a943bd3 Merge "Move rule for certificate_violation_modules.txt" am: 63722db3db
Original change: https://android-review.googlesource.com/c/platform/build/+/1517923

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If863889189d69fd26c327480c7d8943ec77afebb
2020-12-09 12:34:08 +00:00
Robin Hsu
3e51f4234c Enable system partition compression
* Prerequisites: external/f2fs-tools: sload compression support
* Must work with corresponding changes in system/extras repository
* If Board config does not change, it falls back to old behavior,
  i.e. no compression for the system partition
* Kernel f2fs compression support is a prerequisite if the Board config
  enables the compression (see below)
* Necessary board config change
 (e.g. device/<vendor>/<product>/BoardConfig-common.mk)

BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := f2fs
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 200000000
BOARD_SYSTEMIMAGE_FILE_SYSTEM_COMPRESS := true
BOARD_SYSTEMIMAGE_F2FS_SLOAD_COMPRESS_FLAGS := <sload compress sub-options>

Setting BOARD_SYSTEMIMAGE_FILE_SYSTEM_COMPRESS to true enables both the
compression support when the initial empty file system be made (mkfs.f2fs)
and the compression flag (-c) when the system image files be side-loaded
by sload.

Sload compress sub-options (i.e. options other than -c) will be provided
by BOARD_SYSTEMIMAGE_F2FS_SLOAD_COMPRESS_FLAGS.   If it is not given, or
is empty, the default sub-options will be used

Please refer to the sload.f2fs manual page.

Setting BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE to f2fs is trivially necessary.

* File system table (fstab), notably the file 'fstab.hardware', should
  also changed:
  - The file type must be changed to f2fs
  - Perhaps also other f2fs-specific options

Bug: 170918499
Test: Pixel4a userdebug build (from build id 6918751)
Signed-off-by: Robin Hsu <robinhsu@google.com>
Change-Id: Id9d67b5cb35dc806e06ff1320e89114abc996a28
2020-12-09 07:24:55 +08:00
Anton Hansson
cd8fa36cbb Move rule for certificate_violation_modules.txt
It was in the middle of some other logic in main.mk

Put it in Makefile instead next to the other "information" dist txt
files.

Test: make and diff certificate_violation_modules.txt
Change-Id: I5b73a0f89ccf3de69e7608a0568d2b4b6f37e98c
2020-12-08 21:12:36 +00:00
Treehugger Robot
e1365ce0b1 Merge "Add option include a pvmfw partition" am: d7bf548967
Original change: https://android-review.googlesource.com/c/platform/build/+/1513771

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibd4f75d386f47e5a88d56d7b8039d5eb8c2018d3
2020-12-07 22:48:16 +00:00
Andrew Scull
9b103e49e9 Add option include a pvmfw partition
Protected KVM relies on protected VM firmware (pvmfw) to bootstrap the
trust in protected VMs. This firmware is AVB protected and stored in the
pvmfw partition.

Test: build a target with BOARD_PREBUILT_PVMFWIMAGE set, saw the image
      included in the product files and used avbtool to check the footer
      and vbmeta.img details.
Bug: 171280178
Change-Id: I4d6a1819f307c77ca60c0dd3dff39ee28cece4f6
2020-12-07 12:31:23 +00:00
Yo Chiang
b179ae612d Merge "Add phony target to check all PCF ELF prebuilts" am: ad4dae71cf
Original change: https://android-review.googlesource.com/c/platform/build/+/1311493

Change-Id: I9b97245b1b1a894cd87b396bd0ef4bd1aab46290
2020-12-04 04:11:48 +00:00
Yo Chiang
ad4dae71cf Merge "Add phony target to check all PCF ELF prebuilts" 2020-12-04 02:49:33 +00:00
Treehugger Robot
ae2bf41268 Merge "Make installed-files-recovery.txt depend on rsync timestamp" am: ed41c73db5
Original change: https://android-review.googlesource.com/c/platform/build/+/1515806

Change-Id: I9f2a5e377c7a46ad5efeb7acaa42ef21b58b5cbd
2020-12-03 17:06:29 +00:00
Treehugger Robot
ed41c73db5 Merge "Make installed-files-recovery.txt depend on rsync timestamp" 2020-12-03 16:42:25 +00:00
Treehugger Robot
2875f607e3 Merge "Adds host_init_verifier to otatools.zip" am: d955bc1288
Original change: https://android-review.googlesource.com/c/platform/build/+/1515821

Change-Id: Ia662cc0bb2dba840247de7d69229d2fb5ad20345
2020-12-03 08:22:53 +00:00
Treehugger Robot
d955bc1288 Merge "Adds host_init_verifier to otatools.zip" 2020-12-03 07:10:21 +00:00
Daniel Norman
ee33b4ea51 Adds host_init_verifier to otatools.zip
This is needed after
commit 21c34f78e8
which starts calling host_init_verifier in merge_target_files,
a binary in releasetools.

Test: m otatools
Change-Id: Iee762de9fd6f890b5cc26ee5507da2f3f284fc14
2020-12-02 16:18:25 -08:00
Colin Cross
359f421d3b Make installed-files-recovery.txt depend on rsync timestamp
Files are copied into the recovery installation directory by a rule
that runs rsync.  The previous logic tried to avoid racing with the
rsync rule by depending on the final packaged recovery image, but
if BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is set then
INSTALLED_RECOVERYIMAGE_TARGET is left empty and no dependency was
added.  Depend on the timestamp file used as the output of the rule
that runs rsync instead.

Test: query dependencies of installed-files-recovery.txt
Fixes: 173772240
Change-Id: I5ec77a6933e3a83fe4e4819e0e246017d824d8a5
2020-12-02 23:19:29 +00:00
Xin Li
4bc4ff3c11 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I880b5dfb7bfea4b6abef9fcb603abcb383d84f42
Change-Id: I3c3385a1c58004f1ee6124de0c86dfff614a3bf6
2020-12-02 00:03:31 -08:00
Kiyoung Kim
36481e0b34 Generate system stub library list at build time
List of stub libraries from system (and bionic APEX) is currently
managed in static file. This change generates the list at build time and
adds to the system config so linkerconfig can use it.

Bug: 172889962
Test: Build cuttlefish and confirmed list is generated in
/system/etc/linker.config.pb

Change-Id: Idd5a93442f398dd8e88c767c694ddae64d1bb713
2020-12-01 15:33:09 +09:00
Petri Gynther
6ff5201ce9 Add installed-files-vendor-ramdisk.txt
Add installed-files-vendor-ramdisk.txt build artifact, so that it is
easy to see what files landed on the vendor ramdisk.

Test: clean build, inspect installed-files-vendor-ramdisk.txt
Change-Id: Ie84d06dc968ad972ab2bfa79db4d1839ba09e09f
2020-11-20 16:59:57 -08:00
Treehugger Robot
a39ec91fbe Merge "Revert "Mount generic ramdisk as readwrite."" 2020-11-17 01:11:36 +00:00
Yifan Hong
187e975927 Merge changes from topic "gki_vintf_level"
* changes:
  Pass kernel release file to check_vintf.
  Pass kernel version file to check_vintf.
2020-11-16 23:48:47 +00:00
Treehugger Robot
d320cbc6d0 Merge "Dump BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST into misc_info.txt" 2020-11-16 17:43:57 +00:00
Treehugger Robot
fc65231af1 Merge "Support PRODUCT_BUILD_VBMETA_IMAGE for target files" 2020-11-16 13:59:41 +00:00