Commit graph

2588 commits

Author SHA1 Message Date
Treehugger Robot
80d2c8f7a7 Merge "Add build flags for legacy EROFS support." 2022-04-16 05:10:04 +00:00
Treehugger Robot
477b8e0561 Merge "Revert "Rename init_boot properties to ro.init_boot.*"" 2022-03-23 23:27:02 +00:00
Kelvin Zhang
8250d2cd9e Revert "Rename init_boot properties to ro.init_boot.*"
This reverts commit 411fac84d6.

Reason for revert: b/226318737

Change-Id: Ie1cf0e79b3ac11b91e031a479898a54856020500
2022-03-23 19:46:09 +00:00
Melisa Carranza Zúñiga
fb042449e0 Merge "Adding sepolicy sign params to sign_target_files_apks." 2022-03-22 18:00:43 +00:00
Iavor-Valentin Iftime
246a5c069a Rebuild and copy recovery patch files when using vendor_otatools
Rebuild recovery and copy recovery patch/install files when building vendor images using vendor otatools. Fixes ota_from_target_files failure.

Bug: 220126689
Bug: 186097910

Test: sign_target_files_apks \
        --vendor_otatools=otatools_vendor_dir \
	--vendor_partitions=vendor,odm \
	merged-target_files.zip \
	signed-target_files.zip

Change-Id: I4a415417e0d7b1bcd548292ec8f3a12570ec65f0
2022-03-22 13:51:10 +00:00
Lucas Wei
8842016b30 Merge "Make build support vendor_kernel_boot image" 2022-03-22 13:48:34 +00:00
Yi-yo Chiang
e5ed34824f Merge "Rename init_boot properties to ro.init_boot.*" 2022-03-22 09:13:32 +00:00
Melisa Carranza Zuniga
e6d4fb5ae6 Adding sepolicy sign params to sign_target_files_apks.
Bug: b/217570541
Test: sign_target_files_apks --sepolicy_key=build/make/tools/releasetools/testdata/testkey_RSA4096.key
--sepolicy_cert=build/make/tools/releasetools/testdata/testkey.x509.pem target_files.zip target_out.zip
Change-Id: I4ae9f2a3297d10de68c6444dea1cd9996ad9dd11

Change-Id: I4a1ac7009ae0d6bb53c74bd34f8c74f12ea0a3b8
2022-03-21 22:56:33 +00:00
Iavor-Valentin Iftime
880e4432b9 Copy vendor & odm .map files when using vendor_otatools
Copy IMAGES/vendor.map and IMAGES/odm.map files when building vendor images
using vendor otatools. Fixes validate_target_files failure.

Bug: 220126689
Bug: 186097910

Test: sign_target_files_apks \
        --vendor_otatools=otatools_vendor_dir \
	--vendor_partitions=vendor,odm \
	merged-target_files.zip \
	signed-target_files.zip

Change-Id: Iaf904c90761b3830cf81af2561695c81bfc6c70d
2022-03-17 14:02:30 +00:00
Lucas Wei
f57333f7fc Make build support vendor_kernel_boot image
Add vendor_kernel_boot image for vendors whose bootloader support
extra first stage booting kernel modules ramdisks. This benefit
kernel repo to build kernel-artifacts only image without Andorid
artifacts dependency.

Bug: 214409109
Signed-off-by: Lucas Wei <lucaswei@google.com>
Change-Id: If07218b86a7751b3d452a172610af960f5f9ec74
2022-03-16 23:13:19 +08:00
Rob Seymour
c4e2754380 Update extract items call in merge_dexopt.
Test: merge builds with VSDK image
Change-Id: I7788164ecbd69408d2293f49b98ab88db67e9cd9
2022-03-15 17:43:51 +00:00
Yi-Yo Chiang
411fac84d6 Rename init_boot properties to ro.init_boot.*
Right now they're named ro.bootimage.* which is really confusing.
Change it so that if generic ramdisk is in boot.img, then name the
properties as ro.bootimage.*, otherwise if generic ramdisk is in
init_boot.img, then name the prop as ro.init_boot.*.

Bug: 211823573
Test: m dist
Change-Id: Icff3c7be04b9a3c6490fbf49ba4f05565b029890
2022-03-15 18:08:10 +08:00
Daniel Norman
5f47677f00 Infer merge configs if not provided.
Bug: 221858722
Test: Create a merged package using inferred configs.
Test: atest --host releasetools_test
Change-Id: I93d67ca0f00be3f0e0424ed0a1e44c39ca2f3094
2022-03-10 23:56:12 +00:00
Daniel Norman
2465fc8594 Split the huge merge_target_files script into multiple files.
Bug: 221858722
Test: m otatools; Use to create merged builds
Test: atest --host releasetools_test
Change-Id: I5f932f160d3f6405b41a7721b1c75cc96749e77b
2022-03-10 23:56:00 +00:00
Treehugger Robot
51005914bd Merge "Moves merge scripts into a new merge folder." 2022-03-10 23:39:28 +00:00
Treehugger Robot
e910accc38 Merge "validate_target_files: support gki_arm64" 2022-03-10 00:57:10 +00:00
Bowgo Tsai
341fe02903 validate_target_files: support gki_arm64
gki_arm64 is a special target to build multiple GKI boot-*.img
files. It has neither system.img nor vbmeta.img. Skips checking
system.img and vbmeta.img in this case.

Bug: 223078405
Test: validate_target_files signed-gki_arm64-target_files-8277156.zip
Change-Id: I9d3c102c11787cf70c1e1fc8e6a552f8fd19ff72
2022-03-09 16:35:19 +08:00
David Anderson
060505fb4a Merge "build_image: Remove mkerofsimage.sh." 2022-03-09 04:04:05 +00:00
Treehugger Robot
0cc4ae84ea Merge "Fix small typo in ota script options" 2022-03-09 03:06:26 +00:00
Daniel Norman
2b0b9ca1b7 Moves merge scripts into a new merge folder.
This will be used in the following change to split
merge_target_files into a collection of smaller
more-focused scripts.

Bug: 221858722
Test: m otatools; Use to create merged builds
Change-Id: Ie01dac81c5f9f28f1e0fe037259eabd2478e60b6
2022-03-08 16:37:14 -08:00
Kelvin Zhang
ff35cbd110 Merge "Simplify codes when _LoadOemDicts" 2022-03-08 23:16:32 +00:00
Kelvin Zhang
318a464a71 Fix small typo in ota script options
"enable_zucchin" was used instead of "enable_zucchini"

Test: th
Change-Id: Iaccb07bc6913a28c021fe84d3faeb59504ea1fbb
2022-03-08 15:13:01 -08:00
Daniel Norman
986582f262 Merge "Fix META/care_map.pb generation." 2022-03-08 22:42:54 +00:00
Daniel Norman
799a18c82e Fix META/care_map.pb generation.
In https://r.android.com/1991151 we removed an extra call to
AddCareMapForAbOta() from generate_care_map(), since
AddCareMapForAbOta() is already called by add_img_to_target_files.

However, when add_img_to_target_files generated care_map.pb it
didn't have the proper partition *_image_size values set for
images copied directly from the input target files packages.
This was because the generate_care_map() function, which sets
those *_image_size values, was executed after add_img_to_target_files.

At best this meant that care_map.pb was missing some information.
At worst, care_map.pb is missing entirely (when all images are
copied instead of regenerated).

This change:
- Renames generate_care_map() to set_copied_image_size_props()
  and simplifies the logic a bit.
- Calls set_copied_image_size_props() before calling
  add_img_to_target_files. Now, add_img_to_target_files will
  have all necessary *_image_size values to perform the
  META/care_map.pb generation step.

Bug: 187432243
Bug: 221858722
Bug: 223198503
Test: Use to create a merged build that does not regenerate any images.
      Observe that META/care_map.pb is now generated as expected.
Change-Id: I1b3c8636be8cbe203222e60b1272a5e11f68589b
2022-03-08 19:02:51 +00:00
jiajia tang
c7c8697a62 Simplify codes when _LoadOemDicts
Use function LoadDictionaryFromFile(), instead of
LoadDictionaryFromLines(). Makes codes conciser.

Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: I15d6d4281a03be8a2f6f855054b1e4c1c3010fcd
2022-03-08 18:27:24 +08:00
Treehugger Robot
966482dc56 Merge "Add an option to set VABC compression algo" 2022-03-04 23:56:27 +00:00
David Anderson
f54665f42a Add build flags for legacy EROFS support.
EROFS images by default will only work on newer kernels. Old versions of
5.4 and 4.19 need an extra flag to mkfs.erofs.

Add BUILD_EROFS_USE_LEGACY_COMPRESSION to force this flag.

Bug: 222373106
Test: build with BUILD_EROFS_USE_LEGACY_COMPRESSION enabled
Change-Id: I3818e14356beaa11073c6b9fea6a6ad999bba4aa
2022-03-04 14:47:17 -08:00
Kelvin Zhang
84b3a28603 Add an option to set VABC compression algo
When testing on cuttlefish, space consumption isn't a concern, so
compression can be disabled to save time. We also want to test the
non-compressed code path, as we expect some OEMs to use userspace COW
w/o compression.

If no --vabc_compression_param option specified to
ota_from_target_files, we will use the compression algo specified in
target_files's dynamic_partition_info.txt.

Bug: 219966986
Test: th
Change-Id: Ie18064b15938550ad6fb4efc86fc100c12321dc0
2022-03-04 12:29:30 -08:00
David Anderson
94ad5bb5ef build_image: Remove mkerofsimage.sh.
These wrapper scripts are difficult to maintain and there's not really
any value add. The argument strings don't match and every new build flag
has to be connected in an extra place.

Bug: 222715577
Test: make with EROFS enabled
Change-Id: Ie0e51cc30aa08b004d5d8345a2a2d885e193ffa9
2022-03-04 11:07:43 -08:00
Iavor-Valentin Iftime
63cde0fd92 Allow vendor_otatools arg to be file or folder
Required by signer script when using "--vendor_otatools" argument.

Bug: 220126689
Bug: 186097910

Test: sign_target_files_apks \
        --vendor_otatools=otatools_vendor_dir \
	--vendor_partitions=vendor,odm \
	merged-target_files.zip \
	signed-target_files.zip

Change-Id: Iaa596f95f9db1e1e423b8306e9590fe27acb76e7
2022-03-04 16:02:46 +00:00
Daniel Norman
c44f964a5a Allow missing key for misc_info lookups.
This broke the TV-VF build in ab/8246202.

Change-Id: Ifbf76a3c43c46fcd4280180e45ad23fcbed9346d
2022-03-03 19:42:32 +00:00
Treehugger Robot
0b6921be2b Merge "Add SPL downgrade option help text" 2022-03-03 17:56:41 +00:00
Treehugger Robot
5b48aeccb2 Merge "Clean up merge_target_files" 2022-03-02 23:51:31 +00:00
Kelvin Zhang
e174c323e1 Add SPL downgrade option help text
Test: th
Change-Id: I71f916642f6327acad1d0c163a204718002f876d
2022-03-01 15:59:08 -08:00
Daniel Norman
5177fcb28d Fix releasetools OWNERS for merge.
My extra _ meant that OWNERS was removed for merge_target_files.

Change-Id: I15f89b9edf31d126df19b66998520e8545cdfbd0
2022-03-01 17:58:34 +00:00
Yi-yo Chiang
9d164b6300 Merge changes from topic "gki-avb-vts"
* changes:
  releasetools: Update T GKI certification scheme
  Update T GKI certification scheme
2022-03-01 04:47:47 +00:00
Daniel Norman
0374741b7b Clean up merge_target_files
Summary of changes:
- Rename extract_items args to be more generic.
- For many other functions, replace large argument lists with
  the OPTIONS shared object.
- Rename process_* functions to merge_* to be more clear about
  the purpose of the function.
- Remove verbose code in merge_ab_partitions_txt().
- Extract certain logic from merge_misc_info_txt() and place it
  into other existing functions: dynamic partition and selinux
  keys are now processed in their own functions.
- Remove verbose code in merge_package_keys_txt().
- Remove verbose code in create_file_contexts_copies().
- Handle extracting from META directly in merge_meta_files(),
  rather than doing this extraction in create_merged_package()
- Storing the set of framework and vendor partitions in OPTIONS
  so it can be reused by multiple functions without needing to
  be parsed again.

Bug: 221858722
Test: atest test_merge_target_files
Test: Use merge_target_files to merge some builds
Change-Id: I8aa429c8fbb05223127b116aab84b2678ac264a8
2022-02-28 16:48:27 -08:00
Daniel Norman
4cf1e03c1c Add to OWNERS for merge tooling.
Includes more folks to increase "bus factor" for these files,
as well as including the merge test.

Change-Id: I8a5e8d1600fd4e03f75338193609f496a964f790
2022-02-28 22:30:49 +00:00
Baligh Uddin
be2d7d0ce1 Ignore cleanup errors.
Certain binaries may have restrictive permissions.

BUG: 221492085
Test: TH
Change-Id: I56f3c172d9e2c3947e513bdf0b2072457061c547
2022-02-26 02:35:25 +00:00
Tianjie Xu
45714a047e Update owner
Change-Id: I11931bcc51408db3ea8d75db67691ee3eb6e0194
Test: N/A
2022-02-25 19:21:48 +00:00
Jooyung Han
4d0af554ce Merge "Replace pvmfw embedded public key" 2022-02-25 06:39:20 +00:00
Treehugger Robot
bc5a49b504 Merge "Fix ota_from_target_files error in non-AB VF" 2022-02-25 03:03:17 +00:00
Treehugger Robot
14ec6f4157 Merge "Remove catch + sys.exit idiom" 2022-02-25 00:35:45 +00:00
Yi-Yo Chiang
24da1a43bb releasetools: Update T GKI certification scheme
Companion change of I143680b1cab50a6915df56c8273f8741beaf1180.
Basically does the same thing as the other change.

Bug: 211741246
Test: m dist
Test: ./boot_signature_info.sh boot-5.10.img
Change-Id: I40c4d5866c74a9a2d525f9455969b8a71f22bdbb
2022-02-24 21:50:18 +08:00
Melisa Carranza Zúñiga
77c1dfa6d9 Merge "Adding flags and logic to sign updateable SEPolicy in APEX" 2022-02-23 16:36:16 +00:00
Andrew Scull
bbc930b008 Replace pvmfw embedded public key
The virt APEX payload public key needs to be embedded in pvmfw so that
is verifies the right set of images. As things are being resigned,
update that embedded key so that it matches the APEX.

Bug: 220018566
Test: sign_target_files_apks
Change-Id: I09be91275ec1d1aa6f921c54a96c5159571ddead
2022-02-23 16:27:57 +00:00
Po Hu
760de672c7 Fix ota_from_target_files error in non-AB VF
Add recovery-from-boot.p for device with
BOARD_USES_FULL_RECOVERY_IMAGE disabled

Bug: 219871887
Change-Id: Id4bafaa44afe28f57e0a35846012073307965940
Test: Used to merge non-AB VF device
2022-02-23 07:29:24 +00:00
David Anderson
c25bd3c8a0 Merge "Revise partition size for system_other.img" 2022-02-19 01:28:24 +00:00
Treehugger Robot
68f7e84519 Merge "Fix ota_from_target_files error in non-AB VF" 2022-02-19 01:19:24 +00:00
Melisa Carranza Zuniga
46930d7a85 Adding flags and logic to sign updateable SEPolicy in APEX
Verify with command:
sign_apex --container_key=testdata/testkey
--payload_key=testdata/testkey_RSA4096.key
--sepolicy_key=testdata/testkey_RSA4096.key
--sepolicy_cert=testdata/testkey.x509.pem
$OUT/system/apex/com.android.sepolicy.apex
$OUT/test/sepolicy.apex

Test: mma and run sign_apex
Change-Id: I8cc5bbc09058b57e463b1d40d4953d62e0438389
2022-02-19 00:01:09 +01:00