Commit graph

3102 commits

Author SHA1 Message Date
Yifan Hong
ec91a39248 Only build OTA package for non-A/B with recovery
Change I4e5adc3f42a5 alone would break hikey build, which
is a non-A/B device with a boot image, but without recovery.

Do not build OTA in this case.

Test: lunch hikey && m dist
Fixes: 194018054
Bug: 193588301
Change-Id: I8d09ad5c62d44699eb910ff62d32044bd97e8e44
Merged-In: I8d09ad5c62d44699eb910ff62d32044bd97e8e44
2021-07-19 10:46:19 -07:00
TreeHugger Robot
9bbb60e141 Merge changes from topic "ota_for_generic_boot_image" into sc-dev
* changes:
  Also extract kernel configs from boot image.
  Build OTA when boot image exists even without kernel or recovery fstab
2021-07-16 20:23:47 +00:00
Yifan Hong
cb21f9edc8 Also extract kernel configs from boot image.
On devices with prebuilt generic boot image:
  TARGET_NO_KERNEL := true
  BOARD_PREBUILT_BOOTIMAGE is set
In this case, the process for extracting the kernel
config and version must also try extracting from the
prebuilt boot image.

Test: build on device with prebuilt boot image
Fixes: 193588301
Change-Id: I43dd8e206bcd1c9f3f5f51869f126791c50af01a
Merged-In: I43dd8e206bcd1c9f3f5f51869f126791c50af01a
2021-07-16 09:52:42 -07:00
Yifan Hong
73f01711f2 Build OTA when boot image exists even without kernel or recovery fstab
On devices with a prebuilt boot image, TARGET_NO_KERNEL
may be set to enable signing, etc. In this case we still
want to build the OTA package.

Test: m otapackage on a device with generic boot image
      (where TARGET_NO_KERNEL is set)
Bug: 193588301
Change-Id: I4e5adc3f42a516ac0e2f66c313dbe34a469ebe05
Merged-In: I4e5adc3f42a516ac0e2f66c313dbe34a469ebe05
2021-07-16 09:52:42 -07:00
Inseob Kim
ef49dc6daa Revert "Directly create ramdisk dirs in ramdisk image rule"
Revert "Add install_in_root to cc_binary"

Revert "Add ramdisk_available to init_first_stage's deps"

Revert submission 15071196-init_first_stage_soong

Reason for revert: fixes b/192248690
Reverted Changes:
I23cf4f975:Add ramdisk_available to init_first_stage's deps
Icd98c7e24:Add ramdisk_available to init_first_stage's deps
If9da9ba16:Add ramdisk_available to init_first_stage's deps
Ibc8668029:Add ramdisk_available to init_first_stage's deps
I3b4b8c475:Add ramdisk_available to init_first_stage's deps
I59cd149e0:Completely migrate init first stage to Soong
I36d789578:Add ramdisk_available to init_first_stage's deps
I2a0daa612:Add BUILD_USES_RECOVERY_AS_BOOT to soong config
Ic76c325ce:Directly create ramdisk dirs in ramdisk image rule...
I4c5374deb:Add BOARD_BUILD_SYSTEM_ROOT_IMAGE to config vars
I8aab5faf3:Add ramdisk_available to init_first_stage's deps
I9d5a10661:Add ramdisk_available to init_first_stage's deps
Iaa2edeb4a:Add ramdisk_available to init_first_stage's deps
I7cb582ca0:Update init_first_stage
I06091d15e:Add ramdisk_available to init_first_stage's deps
I8bdb8dda3:Add ramdisk_available to init_first_stage's deps
I7436b8dd1:Add ramdisk_available to init_first_stage's deps
I39693fd86:Add ramdisk_available to init_first_stage's deps
I0a9ba90f0:Add ramdisk_available to init_first_stage's deps
Ib66b4c4ea:Add ramdisk_available to init_first_stage's deps
I31ce63d23:Add ramdisk_available to init_first_stage's deps
Icb580f97c:Add ramdisk_available to init_first_stage's deps
I044a075b7:Add ramdisk_available to init_first_stage's deps
I33164a7e7:Fix ndk and aml arch order
Ib8d92904a:Add ramdisk_available to sysprop_library
Ibc3516453:Add install_in_root to cc_binary

Change-Id: Ic72702cf9d48367b3de30cf29f68a7e8fb0040ce
2021-07-01 06:50:40 +00:00
Inseob Kim
f3897b668d Directly create ramdisk dirs in ramdisk image rule
These directories have been created with post install cmds of
init_first_stage. To migrate init_first_stage to Soong, the directory
rules are now written directly in ramdisk image rule.

Bug: 187196593
Test: "m installclean; m" and see ramdisk output
Change-Id: Ic76c325ce102347f20b282572e3edbb5b4359aaf
Merged-In: Ic76c325ce102347f20b282572e3edbb5b4359aaf
2021-06-23 04:38:55 +00:00
Devin Moore
36b659550e Revert "Throw an error if androidboot.hardware is used for bootconfig"
This reverts commit 2e43e34d53.

The kernel bootconfig feature has been updated to handle mixed subkeys
and values, so androidboot.hardware is ok to use now.

Test: build and boot cuttlefish with 'hardware=cutf_vm'
Test: build and boot cuttlefish with 'androidboot.hardware=cutf_vm'
Bug: 191502832
Merged-In: I7c3f330a73abe6cf1fb7d14aaaa6cbc3e874a4aa
Change-Id: I7c3f330a73abe6cf1fb7d14aaaa6cbc3e874a4aa
2021-06-21 12:48:24 -07:00
Bill Peckham
184524a915 Fix typo in droidcore-unbundled.
Test: manual inspection.
Bug: 191304308
Change-Id: Ie63d08acff0b9accfafd906a43bd18cbef5471a3
2021-06-17 03:33:09 +00:00
Bill Peckham
315b98a73a Introduce droidcore-unbundled target
The droidcore-unbundled target replaces the droidcore
target when TARGET_BUILD_UNBUNDLED_IMAGE=true. This
target is similar to droidcore in terms of dependencies,
but it has a smaller set of dist files. The intention is
to use TARGET_BUILD_UNBUNDLED_IMAGE=true with a
VSDK-using vendor build to supply Java dependencies from
prebuilts to avoid building (or needing) Java framework
sources.

Test: build with and without TARGET_BUILD_UNBUNDLED_IMAGE=true
Test: m nothing dist (before patch)
Test: m nothing dist (after patch)
Test: m nothing dist TARGET_BUILD_UNBUNDLED_IMAGE=true (after patch)
Test: examine ninja build graph for previous 3 tests
Bug: 188176942
Bug: 187064252
Change-Id: Ia7f8200c1bb1aaaa57c177d1698a114efe26bec7
(cherry picked from commit 0a30cc41bc)
2021-06-16 19:54:07 +00:00
Jaegeuk Kim
01da65f93a Missing required packages for f2fs when building ota package
Bug: 171942852
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ib2ecc0cf88d71f358bd04e6c4ac129607fe4054c
Merged-In: Ib2ecc0cf88d71f358bd04e6c4ac129607fe4054c
2021-06-09 02:11:23 +00:00
Tianjie Xu
b195f48ce9 Merge "Check super size for factory OTA at build time" into sc-dev 2021-06-02 21:53:36 +00:00
Jaegeuk Kim
bce364b9ce Merge changes from topic "f2fs-system" into sc-dev
* changes:
  Enable f2fs compression for other partitions
  Enable --readonly for system compression
2021-06-01 18:09:07 +00:00
Tianjie
16bcac122f Check super size for factory OTA at build time
For VAB launched device, factory OTA will write system_other
partition to the super image. So we want to check that
sum(dynamic partitions) + system_other + overhead <= super at
build time.

Since we don't know the overhead at build time, we might instead
check sum(all partitions) < super.

Bug: 185809374
Test: m check-all-partition-sizes, unittests
Change-Id: Ia7ba5999d23924a1927e9a9463856a4d0ea90c20
Merged-In: Ia7ba5999d23924a1927e9a9463856a4d0ea90c20
(cherry-picked from commit 294ec7d9e5)

Change-Id: I479d1b399a1639b595ae5d7f1481c771a3439e51
2021-05-26 14:43:35 -07:00
Jaegeuk Kim
91869cafe6 Enable f2fs compression for other partitions
Bug: 171942852
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I231f7a2b808cc792fd582cd444825e4a47722984
2021-05-26 13:11:28 -07:00
Bowgo Tsai
b23656df31 Support AVB signing for BOARD_PREBUILT_BOOTIMAGE
Devices using GKI architecture will use a prebuilt boot.img.
However, we should still sign this prebuilt boot.img with
device-specific AVB keys.

Steps to test the CL.
1. In a device BoardConfig.mk:

   # Uses a prebuilt boot.img
   TARGET_NO_KERNEL := true
   BOARD_PREBUILT_BOOTIMAGE := device/google/redbull/boot.img

   # Enable chained vbmeta for the boot image.
   # The following can be absent, where the hash descriptor of the
   # 'boot' partition will be stored then signed in vbmeta.img instead.
   BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
   BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA4096
   BOARD_AVB_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
   BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 2

2. `make bootimage`, then `avbtool info_image --image $OUT/boot.img`,
    checks the image is re-signed with a device-specific key

3. `make dist` to generate out/dist/TF.zip

4. `unzip out/dist/TF.zip IMAGES/boot.img`

5. `avbtool info_image --image out/dist/IMAGES/boot.img`,
    checks the image is re-signed with a device-specific key

6. `sign_target_files_apks \
      --avb_boot_key=external/avb/test/data/testkey_rsa8192.pem \
      --avb_boot_algorithm=SHA256_RSA8192 \
      --avb_boot_extra_args="--prop test:sign" \
      ./out/dist/*-target_files-eng.*.zip signed.zip`, resign the TF.zip

7. `unzip signed.zip IMAGES/boot.img`, then use `avbtool info_image` to
   check the boot.img is re-signed with the --avb_boot_key in step 6.

Bug: 188485657
Test: above steps
Change-Id: I7ee8b3ffe6a86aaca34bbb7a8898a97b3f8bd801
Merged-In: I7ee8b3ffe6a86aaca34bbb7a8898a97b3f8bd801
(cherry picked from commit cf9ead8972)
2021-05-26 09:11:00 +08:00
Bowgo Tsai
b9af035ee7 BOARD_PREBUILT_BOOTIMAGE: removes the restriction of non system-as-root
Starting from Android 10, the system.img layout consists of
$TARGET_SYSTEM_OUT and $TARGET_ROOT_OUT, and is mounted by the
init as root. That is, system.img is always created as if
BOARD_BUILD_SYSTEM_ROOT_IMAGE was set.

  https://source.android.com/devices/bootloader/partitions/system-as-root

The previous concern is that there might be compatibility issues between
the ramdisk contained in boot.img with a newer system.img. But this is
no longer an issue after we always mount the system.img as root.

Bug: 187157581
Test: Tree Hugger
Change-Id: I4537e6ce6fb39b4b86caac82a13716abf515ffd6
Merged-In: I4537e6ce6fb39b4b86caac82a13716abf515ffd6
(cherry picked from commit 640544bd96)
2021-05-17 14:51:16 +08:00
Treehugger Robot
c79de76e3e Merge "Don't make dexpreopt_tools.zip when dex2oat isn't avilable" am: bf5d6238fe am: e9b9f7f0f7 am: 9fda600aa3
Original change: https://android-review.googlesource.com/c/platform/build/+/1705507

Change-Id: If5d80fcf192bace7c400bec76e77d55e2ea92af9
2021-05-14 03:02:57 +00:00
Jeongik Cha
62519def7b Don't make dexpreopt_tools.zip when dex2oat isn't avilable
Test: m
Bug: 158843648
Change-Id: Iae90ea60fc73f1a6202499528277fce7c950d9d3
2021-05-13 13:29:39 +09:00
Treehugger Robot
fdca5d9faa Merge "Target for tools to dexpreopt" am: 26bad544c5 am: ee88da65f5 am: 4beb444294
Original change: https://android-review.googlesource.com/c/platform/build/+/1688306

Change-Id: I91c8fd16af6707d159b448668082fed25d215531
2021-05-13 01:27:10 +00:00
Jeongik Cha
2522c36b4c Target for tools to dexpreopt
Bug: 158843648
Test: m droidcore
Change-Id: I580e2b3285cc524234859998a0e4e072ecaef072
2021-05-12 23:28:49 +09:00
Hamzeh Zawawy
8963e14abe Merge "Add new target for building rust fuzzers for haiku" am: 26e4d3ed11 am: 75a2f742a6 am: eaf6a6ce8d
Original change: https://android-review.googlesource.com/c/platform/build/+/1691405

Change-Id: Ib8b75ee242b94f03e2b54425a5a8ed6953ed86f2
2021-05-03 17:41:51 +00:00
hamzeh
5dfe7a214b Add new target for building rust fuzzers for haiku
Test: make haiku-rust
Change-Id: I0badb5c0ae4138abdbd3f9a404e8883f70ceb503
2021-04-29 13:28:04 -07:00
Treehugger Robot
8aa7710d01 Merge "Moving debug ramdisk resources under / of the ramdisk" am: 2c806a7c94 am: fe4b552210 am: c3e5165e82
Original change: https://android-review.googlesource.com/c/platform/build/+/1685172

Change-Id: If85fa35ccc2208a206e883f7b9f3b5f62a0df4fd
2021-04-28 18:59:06 +00:00
Treehugger Robot
2c806a7c94 Merge "Moving debug ramdisk resources under / of the ramdisk" 2021-04-28 16:27:34 +00:00
Treehugger Robot
610726689c Merge "Copy dexpreopt.config only if it exists" am: 5e5b52033c am: 66a74eb2cb am: e2421c5067
Original change: https://android-review.googlesource.com/c/platform/build/+/1685486

Change-Id: I1620ffd25e8ff59bc83858df10e4d10c6cba2411
2021-04-26 17:58:00 +00:00
Bowgo Tsai
610286a88f Moving debug ramdisk resources under / of the ramdisk
Currently the debug ramdisk resources might be under / or
/first_stage_ramdisk of the ramdisk, and is determined by
some BOARD variables, e.g., BOARD_USES_RECOVERY_AS_BOOT,
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT, etc.

To make a generic boot-debug.img that can work on both devices,
let's move the debug resources always under / of the ramdisk.

Bug: 186082603
Test: boot a device with boot-debug.img
Test: boot a device with vendor_boot-debug.img
Change-Id: I55dc8ff322f6b97e2d6dc1a4ee5935e863f2f835
2021-04-24 08:55:02 +08:00
Jeongik Cha
35bf6b0219 Copy dexpreopt.config only if it exists
Bug: 158843648
Test: m dist when global dexpreopt.config doesn't exist
Change-Id: Iaa8ec04624e16cecceed3f2065945a180a867b1c
2021-04-23 20:15:26 +09:00
Treehugger Robot
c572c6dc7a Merge "Store dexpreopt.config files to dexpreopt_config.zip" am: 6edaa353b1 am: 543f6750c9 am: 0a1e0a5914
Original change: https://android-review.googlesource.com/c/platform/build/+/1666808

Change-Id: Ic836d95701bab97c0f9b579e03724b4a10a80545
2021-04-23 08:10:51 +00:00
Treehugger Robot
6edaa353b1 Merge "Store dexpreopt.config files to dexpreopt_config.zip" 2021-04-23 06:47:57 +00:00
Jeongik Cha
a8056d6cb9 Store dexpreopt.config files to dexpreopt_config.zip
To dexpreopt in post processing, store config files for dexpreopt

Bug: 158843648
Test: m dist and check dexpreopt_config.zip
Change-Id: I5c63a5ffc10023994b14e3a63f50defb9194739f
2021-04-23 01:01:31 +00:00
Yo Chiang
45b7da678b Merge "Support building recovery as standalone ramdisk in vendor_boot v4" am: 1d1571e543 am: d1060db729 am: eed6d46645
Original change: https://android-review.googlesource.com/c/platform/build/+/1664082

Change-Id: I32c59174d7a4e395362c874ec41d8b5179cfc307
2021-04-15 05:51:22 +00:00
Yo Chiang
1d1571e543 Merge "Support building recovery as standalone ramdisk in vendor_boot v4" 2021-04-15 04:02:15 +00:00
Yo Chiang
717c238d65 Merge "Support installing modules.options file" am: 7a8965c1fb am: a074c7db37 am: d1131447db
Original change: https://android-review.googlesource.com/c/platform/build/+/1664083

Change-Id: I6ca52534fef5d251e971b488d22fabc953a2176e
2021-04-13 14:20:00 +00:00
Yo Chiang
7a8965c1fb Merge "Support installing modules.options file" 2021-04-13 09:20:24 +00:00
Yo Chiang
6aa3381900 Merge "Strip whitespace from INTERNAL_VENDOR_RAMDISK_FRAGMENTS" am: 71c7048593 am: 88b910385f am: fbfd3e96ef
Original change: https://android-review.googlesource.com/c/platform/build/+/1671806

Change-Id: Ibb619873cf0d9efa517d484d1a3fedc3d6284fd4
2021-04-12 05:57:26 +00:00
Yo Chiang
71c7048593 Merge "Strip whitespace from INTERNAL_VENDOR_RAMDISK_FRAGMENTS" 2021-04-12 03:33:37 +00:00
Yi-Yo Chiang
378b77929f Strip whitespace from INTERNAL_VENDOR_RAMDISK_FRAGMENTS
aosp/1664081 introduces a bug where if BOARD_VENDOR_RAMDISK_FRAGMENTS is
empty, then INTERNAL_VENDOR_RAMDISK_FRAGMENTS would become " " (single
whitespace).
Just unconditionally $(strip ...) the variable to remove any extra
whitespace.

Bug: 183395459
Test: m dist and check *-target_files-*.zip
Change-Id: Ic842756f3a64c073593592d22c980820664e11c1
2021-04-09 12:32:41 +00:00
Yi-Yo Chiang
12f92447a5 Support building recovery as standalone ramdisk in vendor_boot v4
If BOARD_BOOT_HEADER_VERSION >= 4,
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is true and
BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT is true, then build
recovery as a standalone ramdisk fragment in vendor_boot image.

The recovery ramdisk would be a vendor ramdisk fragment packaged in
vendor_boot, whose ramdisk_name is "recovery" and ramdisk_type is
"VENDOR_RAMDISK_TYPE_RECOVERY".

Bootloader can omit loading the recovery ramdisk during normal boot to
optimize the size of the initramfs.

Bug: 183395459
Test: Presubmit
Test: Modify BoardConfig of CF and m dist. Verify the vendor_boot.img
  with unpack_bootimg.
Test: Strip the vendor_boot of the recovery ramdisk, and verify that CF
  can boot to normal boot without the recovery ramdisk.
Change-Id: I6e9a2781ec87aece10d4844fa18bbe9a7b4674e6
2021-04-09 12:47:00 +08:00
Colin Cross
b7d61d8776 Merge "Package jacoco and proguard files out of a PACKAGING directory" am: df682c6fe1 am: 20f7c8aa14 am: c501f5e0ae
Original change: https://android-review.googlesource.com/c/platform/build/+/1666060

Change-Id: Icb09a21be58fc92f90ab48649049759948a1d914
2021-04-08 19:25:19 +00:00
Colin Cross
df682c6fe1 Merge "Package jacoco and proguard files out of a PACKAGING directory" 2021-04-08 17:17:53 +00:00
Colin Cross
330b1fef31 Package jacoco and proguard files out of a PACKAGING directory
Package jacoco-report-classes.jar, proguard_usage.zip and
proguard_dictionary out of directories in $OUT/obj/PACKAGING
so that they get cleared by m installclean.  This will make
incremental builds that package these files accurate as long
as installclean was run, which is much faster than a full clean
build.

Bug: 184583915
Test: m TARGET_BUILD_APPS=DeskClock EMMA_INSTRUMENT=true dist
Change-Id: I60c6a0fec1fbce26eab8d5adab25a2231b48e251
2021-04-07 18:52:02 -07:00
Rupert Shuttleworth
39dabbfd2f Merge "Mark prop file as writable before writing to it." am: 90eeff54ea am: 185080ab39 am: 6f3d332a52
Original change: https://android-review.googlesource.com/c/platform/build/+/1666239

Change-Id: I1b63d12bc9467f58b23a6b3e0aef221807d8f539
2021-04-07 14:53:49 +00:00
Rupert Shuttleworth
90eeff54ea Merge "Mark prop file as writable before writing to it." 2021-04-07 12:40:34 +00:00
Treehugger Robot
a31becc1ed Merge "Builds boot-test-harness.img, if INSTALLED_BOOTIMAGE_TARGET." am: d641585484 am: 450d1d1349 am: 67b869e3d4
Original change: https://android-review.googlesource.com/c/platform/build/+/1664602

Change-Id: I612be38afd832d1f83d03aea74c560cc0e779aa0
2021-04-07 04:21:16 +00:00
Treehugger Robot
d641585484 Merge "Builds boot-test-harness.img, if INSTALLED_BOOTIMAGE_TARGET." 2021-04-07 02:05:36 +00:00
Rupert Shuttleworth
3993af706c Mark prop file as writable before writing to it.
Test: Fixes USE_BAZEL=1 m builds.
Change-Id: I1e0fb448049ff21cd32541af56e856442bc25fa7
2021-04-07 01:22:00 +00:00
Yo Chiang
0e38bfa5bb Merge "Refactor vendor_boot v4 build logic and add more checks" am: bebc8a35ef am: f19a789d5b am: ba7020ec3d
Original change: https://android-review.googlesource.com/c/platform/build/+/1664081

Change-Id: I10838451c8e3d55c2f4ba7e2dd6db272c9666cb3
2021-04-06 11:06:50 +00:00
Yo Chiang
1ef1bc87a7 Merge "Fix Makefile formatting" am: b5bff9a4d3 am: a7a67e0358 am: fb51a1d107
Original change: https://android-review.googlesource.com/c/platform/build/+/1664080

Change-Id: Ied00b66168177c9c6f5f9d76c7de763f9a936556
2021-04-06 09:22:29 +00:00
Yo Chiang
bebc8a35ef Merge "Refactor vendor_boot v4 build logic and add more checks" 2021-04-06 09:02:14 +00:00
Bowgo Tsai
1ed0fd54dc Builds boot-test-harness.img, if INSTALLED_BOOTIMAGE_TARGET.
Similar to commit Ic887ea93d4c5181eca0f82c3cdf3ce3b72f4c185
for boot-debug.img, we should also only build boot-test-harness.img
if boot.img exists.

Bug: 184365242
Test: tree hugger

Change-Id: Ie0d9e460905d488e418cf4ee1bd44e6e7c58470d
2021-04-06 08:20:15 +00:00