Commit graph

7129 commits

Author SHA1 Message Date
Treehugger Robot
6c9e319da7 Merge "extract_kernel: make it py2/py3 compatible" 2021-02-08 23:49:15 +00:00
cfig
791378cda1
extract_kernel: make it py2/py3 compatible
use py3 for AOSP build, while the script itself can be
executed under py2/py3 environment directly.

TEST: extract info from Pixel 4 kernel

Change-Id: I00db6dabb1ff93f0758017a666c476816caefae7
2021-02-07 17:05:53 +08:00
Julien Desprez
0c09471cc3 Clean TEST_MAPPING config based on go/a-unit-tests
unit_tests:true do not need TEST_MAPPING files

Test: presubmit
Bug: 178646865
Change-Id: Id36e98ce661dc2052e333b2644202361127939a5
2021-02-04 09:12:05 -08:00
Kelvin Zhang
00db3859e7 Merge "Fix test failures due to binaries not found in PATH" 2021-02-02 22:21:15 +00:00
Kelvin Zhang
e9d4ddb1e0 Merge "Add releasetools_test to TEST_MAPPING" 2021-02-02 19:25:21 +00:00
Kelvin Zhang
05a3f680f7 Fix test failures due to binaries not found in PATH
Test: rm `where deapexer` && mm otapackage

Change-Id: I0b742f26ae984729b97bf796aa3ed9335b316369
2021-02-02 14:24:54 -05:00
Kelvin Zhang
553efcaae2 Add releasetools_test to TEST_MAPPING
Test: treehugger
Change-Id: I3a0f9e9e5dd8d49c22f466aa0605768fee3f4821
2021-02-02 14:24:54 -05:00
Mohammad Samiul Islam
f4909b4d71 Add deapexer to releasetools_common
Bug: 178726093
Test: m updatepackage
Change-Id: I74650f339ab5399c2474d7cde1d290b55dab721c
2021-02-01 21:03:58 +00:00
Treehugger Robot
472a860bee Merge "Only add apex_info for compressed apexes" 2021-01-29 10:34:21 +00:00
Nikita Ioffe
8e0c592f89 Merge "Add support for signing a compressed apex" 2021-01-27 19:45:33 +00:00
Kelvin Zhang
c72718c7c5 Only add apex_info for compressed apexes
Test: mm -j dist, then make sure apex_info.pb doesn't contain
non-compressed apex

Change-Id: I6262eb97ec53de28953257d8b3b77e32ac0259be
2021-01-27 14:17:14 -05: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
Kelvin Zhang
7bd09911a2 Add apex_info.pb to generated OTA
Test: generate an OTA, make sure apex_info.pb is in

Bug: 172911822

Change-Id: I13a6ef4bc1f6ed2d146922f3031ea24700ba06f4
2021-01-26 12:42:52 -05:00
Kelvin Zhang
22c687c5c3 Fix pylint warnings on ota_from_target_files.py
Test: treehugger
Change-Id: I0a2b9ebe001152f5de7dce6198139719322fd241
2021-01-26 12:42:52 -05:00
Kelvin Zhang
1cd839623e Merge "Emit apex_info to target_files META/apex_info.pb" 2021-01-26 17:38:07 +00:00
Kelvin Zhang
62eea43d9b Merge "Create a function that can generate ApexInfo using target-files" 2021-01-25 17:55:53 +00:00
Kelvin Zhang
5f0fcee4dd Emit apex_info to target_files META/apex_info.pb
Test: mm -j
Bug: 172911822

Change-Id: I5a70b75dbe1cd546c66beaa8e4e3a63c3987461e
2021-01-25 09:15:30 -05:00
Mohammad Samiul Islam
9fd5886e23 Create a function that can generate ApexInfo using target-files
If an OTA contains compressed APEX inside it, then the device will need
to allocate space on /data partition for their decompression. In order
to calculate how much space the OTA process needs to allocate, the
process needs more information about the APEX contained inside the OTA.

In this CL, we are adding functionality to the OTA generation script
that allows us to gather information about the APEX stored inside the
target-file zip. However, we did not integrate the new functionality
with the ota_from_target_files.py scrip yet. That will be done on follow
up CL.

Bug: 172911822
Test: atest releasetools_py3_test
Change-Id: I2ac42018f628c2c21527b3e086be1f4e7e7247ad
2021-01-22 20:13:32 -05:00
Joe Onorato
841c3e3ea6 Add skeleton for product-config tool.
There's also a bunch of boilerplate error handling and option parsing
stuff that I wish someone would put into a library that's available to
the android tree.

Test: atest product-config-test
Change-Id: Ieebcc7bd47a8644d1374fb02c146e9038859f4a2
2021-01-21 12:38:04 -08:00
Treehugger Robot
d041e4babf Merge "Make ro.product.cpu.abilist.* to be fetched dynamically" 2021-01-14 18:34:22 +00:00
Yifan Hong
7a27574e5f Merge "GetBootImageBuildProp returns None if file does not exist" 2021-01-13 19:40:13 +00:00
Nikita Ioffe
015b689271 Merge "Refactor apex signing logic in preparation for compressed apexes" 2021-01-13 14:54:49 +00:00
Tianjie Xu
2de3459680 Merge "Fix errors from validate_target_files" 2021-01-13 00:02:36 +00:00
Nikita Ioffe
6068e8dd52 Refactor apex signing logic in preparation for compressed apexes
Logic for signing compressed apex will be added in the follow-up cl.

Test: python -m unittest test_sign_apex
Bug: 172912232
Change-Id: I8dc1d334c17e11f9eed8fe0a575b6dfcf337ab5d
2021-01-12 22:29:58 +00:00
Tianjie
2e0b835d28 Fix errors from validate_target_files
We should skip lines that don't contain '=', e.g. empty lines.
Also, pop a warning instead of an error if a prop is defined
multiple times with the same value

Bug: 177240467
Test: unittest, run validate_target_files
Change-Id: Ifc9eadb91e5dda7170a19d875016e5a47e8fc592
2021-01-12 14:04:58 -08:00
Yifan Hong
14a8712c4d Add missing dependencies to releasetools_common and binary defaults.
When GetBootImageBuildProp is moved to common, its dependencies
(toybox, lz4 and unpack_bootimg) aren't moved accordingly.
Copy the dependencies over.

Test: pass
Change-Id: Iaa8f41ae0109e8eb1c058ecd7dd854bb7de9391a
2021-01-12 14:04:19 -08:00
Yifan Hong
7dc5117ffd GetBootImageBuildProp returns None if file does not exist
If system/etc/ramdisk/build.prop does not exist in the ramdisk,
GetBootImageBuildProp should return None instead of a path
to a non-existant file.

Test: pass
Bug: 177171706
Change-Id: I34e447bc315d203e136e8c0d59d00961f81301e3
2021-01-12 11:27:55 -08:00
Nikita Ioffe
c3fdfed11b Fix test_sign_apex
Test: python -m unittest test_sign_apex
Change-Id: I2a27a394b3de32fa29e487bea0b7721502a8bd98
2021-01-11 23:50:31 +00:00
Yifan Hong
cb09afc04a Merge changes from topic "common.GetBootImageTimestamp"
* changes:
  Load boot build props to info_dict properly.
  Add GetBootImageBuildProp.
  Split PARTITIONS_WITH_BUILD_PROP from *_WITH_CARE_MAP
  Move GetBootImageTimestamp to common.
2021-01-08 22:18:51 +00:00
Colin Cross
383e482c22 zipalign: log more I/O errors
b/177069043 is a flake that happens in zipalign during I/O, but
the error doesn't contain enough information to determine what the
problem is.  Add more logging on I/O errors.

Test: atest --host zipalign_tests
Bug: 177069043
Change-Id: I89573e5b3867abe05d855c837bb2aa5b5c630aa7
2021-01-08 11:11:40 -08:00
Yifan Hong
10482a2a56 Load boot build props to info_dict properly.
Add boot to PARTITION_WITH_BUILD_PROP. Let PartitionBuildProps handle
boot partitions by extracting build.prop file.

Test: generate OTA and call
      `payload_info.py payload.bin`, check that boot image timestamp is
      set
Bug: 162623577

Change-Id: I71955e4ee494ffbb5d111c3d02a129c0f879b6d1
2021-01-07 17:20:22 -08:00
Yifan Hong
85ac5012aa Add GetBootImageBuildProp.
Add a function that extracts build.prop from boot image.

Test: TH
Bug: 162623577
Change-Id: I673ccd8e7c4846ca4c41a86349a388b2e800724e
2021-01-07 17:20:22 -08:00
Yifan Hong
5057b95572 Split PARTITIONS_WITH_BUILD_PROP from *_WITH_CARE_MAP
Right now they are the same content. In the future, boot will be added
to PARTITIONS_WITH_BUILD_PROP, but it is not added to
PARTITIONS_WITH_CARE_MAP. Boot partition has a cpio filesystem in the
ramdisk, so it contains a build.prop file, but it doesn't make sense to
create care map from it.

Test: TH
Bug: 162623577

Change-Id: I9b5a20fe2d774b52cf7d5eae9deecbc75122a3dd
2021-01-07 17:20:22 -08:00
Yifan Hong
c65a0545dd Move GetBootImageTimestamp to common.
Test: TH
Bug: 162623577

Change-Id: Icbd8b07dce91006a1abca1f0dc40726de8a10219
2021-01-07 17:20:22 -08:00
Bob Badour
7a95820907 Revert^2 "Rough-in license metadata support to make."
Changed shell script to /bin/sh syntax for portability to mac_os etc.

54066744f0

Change-Id: Ibd472fc1bedfdc228a704108f0280b13ab1c9333
2021-01-06 20:52:43 -08:00
Jerome Gaillard
54066744f0 Revert "Rough-in license metadata support to make."
Revert "Export soong license data to make."

Revert "Add ability to declare licenses in soong."

Revert submission 1377717-metalics

Reason for revert: This has broken renderscript_mac target for aosp-master, see b/176909442

Reverted Changes:
I26ac54ca9:Define the standard license_kind rules.
I656486070:Export soong license data to make.
If9d661dfc:Export soong license data to make.
I97943de53:Add ability to declare licenses in soong.
Icaff40171:Rough-in license metadata support to make.
Ib8e538bd0:Add variables for notice deps, license kinds etc.

Change-Id: Iaf2243cba16f6191b022371a14f81ef8194a47d1
2021-01-06 19:00:05 +00:00
Bob Badour
20fc1b3719 Rough-in license metadata support to make.
Change-Id: Icaff40171b94538219a8caa697b182dbdcc8229a
2021-01-05 08:42:48 -08:00
SzuWei Lin
baf5c8114b Make ro.product.cpu.abilist.* to be fetched dynamically
The patch rename the original ro.product.cpu.abilist* to
ro.system.product.cpu.abilist*. The property service will
define ro.product.cpu.abilist* by the intersect ABIs of
ro.{partition}.product.cpu.abilist*.

Bug: 176520383
Test: build aosp_arm64-userdebug and check the system/build.prop
Change-Id: I26e404632b28e9f6abd462920e0084ad2022a763
2020-12-31 16:59:27 +08:00
Treehugger Robot
fdb2f2c5db Merge "Swich TEST_MAPPING config to unit_tests:true" 2020-12-22 21:32:31 +00:00
Julien Desprez
dc0663f66f Merge "Remove the zipalign_test mapping file" 2020-12-22 00:25:05 +00:00
Julien Desprez
6d9e78fd5d Swich TEST_MAPPING config to unit_tests:true
All unit_tests:true are run in presubmit which avoids
the explicit definition of TEST_MAPPING.

Test: presubmit runs all those tests
Bug: 175408655
Change-Id: Ibfad3fe2dd8d2fa1ebc6f6bcbd8ab34c2a0069dc
2020-12-21 13:56:05 -08:00
Julien Desprez
2bbc159e97 Remove the zipalign_test mapping file
Not needed as the host-unit-tests suite runs in
presbumit now and cover this

Test: None
Bug: 175408655
Change-Id: Iea3e3cd7f696f43b6c686ef9cbee1194f514e589
2020-12-21 09:58:17 -08: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
Julien Desprez
31839fe1cd Merge "mark zipalign_test as unit tests" 2020-12-14 16:11:41 +00:00
Elliott Hughes
27de935d83 Update OWNERS.
Test: treehugger
Change-Id: I5f9ddd03d5cd34fb398b842c933dc6a365be4b39
2020-12-11 12:56:27 -08:00
Julien Desprez
74b8e09094 mark zipalign_test as unit tests
Test: make
Bug: 175408655
Change-Id: I03a7a0bb19ea408830acbf1ebe12ffb25012af91
2020-12-11 11:52:45 -08:00
Jaegeuk Kim
74e57f6482 Merge "Enable system partition compression" 2020-12-10 00:41:04 +00:00
Treehugger Robot
70c61bc6e9 Merge changes I1deda85d,I43d7b2c6
* changes:
  calculation partition size use compressed image size
  add erofs to non partition spanning fs
2020-12-09 06:50:56 +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
Rupert Shuttleworth
729427460b Ensure file permissions are writable before attempting to sign.
Test: Manually using USE_BAZEL=1 use_rbe m dist (fixes a build error).
Change-Id: I1aac185f12ac430514c975103547ce211ea6c99e
2020-12-08 10:03:34 +00:00