Commit graph

2928 commits

Author SHA1 Message Date
Treehugger Robot
c2643ead16 Merge "check_all_partition_sizes_log -> .log" 2021-03-12 06:57:08 +00:00
Yifan Hong
d11953c3b7 check_all_partition_sizes_log -> .log
So that it can be viewed directly in the web browser.
Test: pass

Change-Id: Ic90a5d1511153a74726f1bdee5d9a058756f2d19
2021-03-11 14:47:59 -08:00
Petri Gynther
3296b3136e Merge changes I899810c7,If73b15d7
* changes:
  Add vendor_dlkm, odm, odm_dlkm to dynamic partition filter
  Fix typo: DLKIMMAGE
2021-03-11 20:00:25 +00:00
Petri Gynther
345294f459 Merge changes Ibac6424f,Ief572e30
* changes:
  Copy vendor_ramdisk[-debug].img to out/dist
  Add support for building vendor_ramdisk-debug.img
2021-03-11 19:55:02 +00:00
Petri Gynther
09865a4911 Add vendor_dlkm, odm, odm_dlkm to dynamic partition filter
When building images in -without-vendor clients, we need to filter out:
vendor, vendor_dlkm, odm, odm_dlkm

from the dynamic partitions list for the OTA image build to succeed.

Bug: 173653839
Bug: 182319837
Test: add vendor_dlkm, odm, odm_dlkm to dynamic partitions + make dist
Change-Id: I899810c7f46e40730280d89b94047779705b6e2f
2021-03-10 21:34:07 -08:00
Petri Gynther
689e11a7ce Fix typo: DLKIMMAGE
Fix two typos in Makefile.

It turns out that BOARD_ODM_VENDOR_DLKMIMAGE is not correct.
Need to replace it with BOARD_PREBUILT_ODM_DLKMIMAGE.

Test: use grep to check usage
Change-Id: If73b15d7abb7504aa313d616f6cef2d80d76705d
2021-03-10 21:07:41 -08:00
Treehugger Robot
3eca99ee7a Merge "VINTF logs ends in .log suffix." 2021-03-11 02:07:23 +00:00
Petri Gynther
d7946d13f0 Add support for building vendor_ramdisk-debug.img
Existing BoardConfig.mk variable:
BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true

generates:
out/target/product/<name>/vendor_ramdisk.img

Extend the above to additionally generate:
out/target/product/<name>/vendor_ramdisk-debug.img

as the two ramdisks should be built together.

Test: make
Change-Id: Ief572e30c9225d0f5569e9ff89096c69accafc7f
2021-03-10 13:22:29 -08:00
Devin Moore
2e43e34d53 Throw an error if androidboot.hardware is used for bootconfig
Bootconfig does not allow the keys to have values and subkeys at the
same time.
"androidboot.hardware" and "androidboot.hardware.*" subkeys have existed as
kernel cmdline parameters. We want to throw an error at build time when
"androidboot.hardware" is use in bootconfig because it may be a common
occurence while migrating to bootconfig.
"hardware" should be used instead, without the "androidboot" prefix.

Test: build with and without "androidboot.hardware=test" in
BOARD_BOOTCONFIG
Bug: 173815685

Change-Id: Ic62a86cb23c9d79dbdbacd18eed3449210566ce7
2021-03-09 16:59:33 -08:00
Yifan Hong
fd150d3dcc VINTF logs ends in .log suffix.
This is so that it can be viewed in the web
browser directly.

Test: pass
Change-Id: Ib35a93ab6beac550a593ec46814100ff851f32a5
2021-03-09 12:19:33 -08:00
Petri Gynther
728e0bd468 Cleanup: fileslist target commands
Remove unnecessary @ and $(hide) from fileslist target commands.
Keep @echo to print that line with a progress bar [ x% x/y ].

Test: make
Change-Id: I65c0c3c9c045cc7ca2c2801ee6b3b0c996be59a9
2021-03-08 14:12:35 -08:00
Petri Gynther
4c063e33c8 Cleanup: ram disk -> ramdisk
Test: make
Change-Id: I61740a309c6637c10b935806f7b379cfaf3ae855
2021-03-07 00:52:46 -08:00
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