Commit graph

45 commits

Author SHA1 Message Date
Yo Chiang
90339f9563 Disable sparse image for GSI products
There are a couple of use cases where we don't want sparse image:
1. `DynamicSystemInstallationService` in Q framework doesn't support
   sparse images.
2. Super image manipulation tools (like `lpadd`) doesn't play nice with
   sparse images.

Force non-sparse GSI so we don't break backwards compatibility (1) and
we don't need to write `simg2img` everywhere (2).

Bug: 167695592
Test: Prepare a device flashed with Q framework
Test: Build system.img and create system.img.zip; the image is non-sparsed
Test: m tradefed-all && \
  tradefed.sh run commandAndExit template/atest_local_min \
  --template:map preparers=template/preparers/dsu-preparer \
  --extra-file system-img.zip=out/.../system.img.zip \
  --dynamic-system-update:disable-tear-down
Change-Id: Ib7667165ce53e87eb86bc7d3f56c80a418123a62
2020-09-08 16:55:43 +08:00
Hung-ying Tyan
81f3929867 Remove vbmeta_system from GSI targets
This partially reverts commit 1785816ca1
so that the hash tree at the end of GSI is properly signed by AVB.

Bug: 161503491
Test: 'm dist' and check that vbmeta_system.im is gone
Test: boot GSI on android10 CF
Test: 'avbtool info_image --image system.img' and check AVB signing
Change-Id: I9f488380c0c410fdbd02c3c0803b6dc06cf7faab
2020-07-31 18:59:40 +08:00
Hung-ying Tyan
1785816ca1 Enable vbmeta_system for GSI targets
in order to mix GSI onto android10 Cuttlefish.

Bug: 158302764
Test: mixing GSI onto android10 Cuttlefish
Change-Id: I77385495583034324f5e29bed27c588dc98215e2
2020-07-14 16:04:20 +00:00
Jiyong Park
eb49b34b1e Organize product vars for adding properties
Properties for <partition>/build.prop are now added via
PRODUCT_<PARTITION>_PROPERTIES.

PRODUCT_SYSTEM_PROPERTIES is added. PRODUCT_SYSTEM_DEFAULT_PROPERTIES
will be deprecated.

PRODUCT_VENDOR_PROPERTIES is added. PRODUCT_PROPERTY_OVERRIDES and
PRODUCT_DEFAULT_PROPERTY_OVERRIDES will be deprecated in favor of the new
variable.

For other partitions (odm, system_ext, product), there is no change.

Exempt-From-Owner-Approval: cherry-pick from internal master

Bug: 117892318
Test: m
Merged-In: I98f3b5d0da661b3ad75260a23754e655103b7a44
(cherry picked from commit ad810b6dae)
Change-Id: I98f3b5d0da661b3ad75260a23754e655103b7a44
2020-06-11 15:35:23 +09:00
Bowgo Tsai
0f95ac7e8c Enables signing for generic boot images
Enables signing for them so we can verify that the boot partition
contains a valid generic boot image during the compliance test.

This change also adds the chained partition descriptor of
boot partition into vbmeta.img, which contains the corresponding
public key used to verify the boot partition.

Bug: 151094943
Test: lunch aosp_arm64-user, `make` and use `avbtool info_image`
      to check that GKI images are properly signed.
Test: `make dist` and checks that GKI images in the image zip file
      are properly signed.
Change-Id: I2fd69964f9dc62526a813875fa9193913aa4935b
2020-05-08 08:16:25 +00:00
SzuWei Lin
1256ca9eba Fix signing on some GSI targets
GSI targets require enabling chain partition signing, which put the
GSI signing in system.ing directly instead of in vbmeta.img.

Some GSI targets inherit from BoardConfigGsiCommon.mk only, ex.
gsi_arm64-user, do not enable chain partition signing. The patch
add these settings back.

On the other hand, the emulator makefiles still requires the
settings at this time. Hence, we keep these settings in
BoardConfigEmuCommon.mk.

Bug: 150179516
Test: make gsi_arm64-user
Test: make aosp_arm64-user
Change-Id: Id188e4c6a31ce0cf9b134ebae36cbd5bfae19942
Merged-In: Id188e4c6a31ce0cf9b134ebae36cbd5bfae19942
(cherry picked from commit f77e364de0)
2020-03-04 12:28:20 +08:00
Treehugger Robot
7be2b01f3c Merge "Revise aosp_x86_arm to inherit from mainline_system directly" 2019-09-18 04:41:30 +00:00
SzuWei Lin
18ef515e58 Revise aosp_x86_arm to inherit from mainline_system directly
After applying the patch, the contents in system/product align
to the mainline_system/aosp_product.

aosp_x86_arm is not releaseded for GSI. The patch also inherits
from BoardConfigMainlineCommon.mk instead of
BoardConfigGsiCommon.mk. But keeps output system_ext and product
files to /system/system_ext/ and /system/product/.

Bug: 136616665
Test: Compare the product out folder with/without the patch
Change-Id: I2aefbd2d3e71e26219508e53161fa8a3cc2fd652
2019-09-18 02:11:39 +00:00
Bowgo Tsai
06533fef4a Moving GSI-specific properties to /system_ext
We're now adding a core CSI system.img that is common across different
targets. So GSI-specific things should be moved to /system_ext.

Also renaming various generic*/system.prop to generic*/system_ext.prop.
This is to put the customization into /system_ext/build.prop instead of
/system/build.prop.

Bug: 137711197
Test: boot a GSI on crosshatch, and checks the value of those properties
Change-Id: Id344124280d5f4a6c10d390a9e8a4a50cc7f28fb
2019-09-10 21:55:32 +08:00
Justin Yun
8f11ad5d40 Merge "Rename product_services to system_ext"
am: b7a50ece30

Change-Id: I7a56d76d3543b2bc4b1d0b24e54e8dd82ab7f15a
2019-07-09 02:14:55 -07:00
Justin Yun
6151e3f1ea Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: I67f2e95dd29eac6a28e07e24ea973d3a134c3bfc
2019-07-09 08:57:19 +00:00
Jiyong Park
09dcc68663 updatable_apex.mk is not inherited from mainline_system.mk
mainline_system.mk is inherited by not only Pixels but also products
like GSI and sdk_gphone where kernel isn't capable of supporting
updatable APEX.

Stop inheriting updatable_apex.mk from mainline_system.mk and let each
product to decide whether or not to inherit updatable_apex.mk.

Also, TARGET_FLATTEN_APEX is not set to true for GSI as it is the
default setting.

Bug: 132664085
Test: choosecombo 1 aosp_arm64 userdebug; get_build_var
TARGET_FLATTEN_APEX shows true
choosecombo 1 sdk_gphone userdebug; get_build_var TARGET_FLATTEN_APEX
shows true

Change-Id: I3c4e1e4b2bbebd675904d148dd18acb57ecbdfe9
Merged-In: I3c4e1e4b2bbebd675904d148dd18acb57ecbdfe9
(cherry picked from commit 5fd45bbeb0)
2019-07-02 13:38:23 +00:00
SzuWei Lin
79e0d25c33 Enforce property split in GSI
Pure GSI build targets has no vendor partition, such as
aosp_$arch_ab and gsi_$arch. The system properties defined by
PRODUCT_PROPERTY_OVERRIDES will be in /system/build.prop.

The patch defined a fake BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE to
let these system properties flow to vendor and won't pollute the
system.img.

The bug also move some properties to /product/build.prop.

Bug: 135508595
Bug: 131162245
Bug: 134781120
Test: check the /system/build.prop do not have "ro.carrier=unknown"
Test: adb remount on GSI Q on P
Change-Id: Ib200d66cf98fea572c26338e058bce29eb5e0cd7
2019-06-18 18:23:18 +08:00
Bowgo Tsai
2e2a7682ba Removing --flag 2 when building GSI vbmeta.img
With the support of enabling AVB on standalone partitions in libfs_avb,
devices can boot GSI with dm-verity. No need to disable AVB anymore.

Devices still can use the following command to disable AVB on
device-specific vbmeta.img if needed:

    `fastboot flash --disable-verification vbmeta vbmeta.img`

Bug: 130595457
Test: Tree Hugger
Change-Id: I067dcda15f14f04428e0b60ce1f49227d61e4349
2019-04-23 18:10:01 +08:00
Isaac Chen
d18be7f8db Merge "Change emulator system image to unsparse format" 2019-04-15 11:57:49 +00:00
Isaac Chen
90bfda1cc4 Change emulator system image to unsparse format
Currently, emulator system image is the non-legasy GSI, which is in sparse
format. Several internal clients don't support sparse format, and other
internal/external clients usually support both. The reason to choose sparse
format for GSI may not be valid any more. See bug for detail.

Bug: 130341962
Test: Checked the header of system.img to see if it's unsparse.
      Boot emulator aosp_x86 successfully.
      Boot mixed GSI and CF x86 successfully.

Change-Id: I839f49809429227607b2e876a4a3628df43a97b4
2019-04-12 13:16:34 +08:00
Anton Hansson
91aa9414c0 Move device-specific vars from mainline common
Move a couple of variables out of BoardConfigMainlineCommon
because they vary either by device or by how they build in
AOSP vs internal.

Bug: 80410283
Test: presubmit
Change-Id: Ia42df91ad8c8d8fc4618be375a17ea23896f4352
2019-04-04 17:33:51 +01:00
Anton Hansson
018bd137b7 Make mainline device enable property split
This setting moves the PRODUCT_PROPERTY_OVERRIDES to
the vendor partition.

Bug: 80410283
Test: tail system/build.prop | grep ro.carrier=
      (empty)

Change-Id: I30d564fbd2dd3b56763ccff77979b223857f1c2f
2019-03-25 10:53:07 +00:00
Anton Hansson
1683198010 Set file system types for mainline_arm64 partitions
This config was in a weird state where it sets the OUT
directory for these partitions but not the file system
type. Within the build system, both of these variables
are used interchangeably to check whether these partitions
are expected to be present.

A typical mainline device is expected to /vendor and
/product, so just add these.

Bug: 120974093
Test: make
Change-Id: I803d7afdcadc37e4384ae80f08bc1c8db535d2f4
2019-03-22 17:25:43 +00:00
Bowgo Tsai
c1a8f1a5d7 GSI vbmeta.img: set rollback_index to zero
The major purpose of vbmeta.img built on GSI targets (e.g., aosp_arm,
aosp_arm64, etc) is to disable AVB. We should also set the rollback
index to zero, to prevent the device bootloader from updating the
last seen rollback index in the tamper-evident storage.

Bug: 122583908
Test: build aosp_arm64, then `avbtool info_image --image $OUT/vbmeta.img`
Change-Id: I48a49957f8dd3169003b9507fe80e519f301d5b5
2019-02-19 10:38:40 +08:00
Treehugger Robot
6867fd7dda Merge "Fix flags argument passed to avbtool for GSI images" 2019-02-18 05:27:52 +00:00
Treehugger Robot
b41ab14b1e Merge "Fix booting problem on GSI with user build" 2019-02-15 10:37:44 +00:00
SzuWei Lin
fd6d294c2b Fix booting problem on GSI with user build
GSI doesn't include gsi_system.prop on user build, and cause some
devices cannot boot GSI with user build. Some properies in
gsi_system.prop do not suitable for user build, the patch create
a new gsi_system_user.prop for GSI user build.

Bug: 124479721
Test: boot aosp_arm64-user on a blueline device.
Change-Id: Ide2bdc8e8733817afb832b50b28807768e22f011
2019-02-15 14:34:53 +08:00
Jiyong Park
c35a33e59c TARGET_FLATTEN_APEX for GSI
Regular (non-flattened) APEX may require changes to the kernel, which is
against the Treble promise. For maximum compatibility, APEXes are
flattened for GSI so that APEXes can be activated by legacy kernels.

Bug: 124159875
Test: N/A
Change-Id: Iea5701d3b917ebf8657d3ce38131c1838b51677e
2019-02-11 21:50:02 +09:00
Luca Stefani
7c7b4b6beb Fix flags argument passed to avbtool for GSI images
* avbtool expect extra flags to be passed with the --flags argument
  but currently we're missing an 's'.
  Luckily this isn't an issue as python argparse matches
  --flag as an alias to --flags ( python... )

Test: m vbmetaimage; check vbmeta header
Change-Id: I42d833c61c9b313dc067b1e519bae36395d09824
2019-02-10 19:59:27 +01:00
Anton Hansson
767569b489 Merge "Enable 64-bit mediadrmserver for mainline" 2019-01-23 09:56:46 +00:00
Anton Hansson
9791518d58 Set TARGET_COPY_OUT_ for product/vendor in mainline
This product variable is used to generate the loader config (to use
either /system/product or /product), and the vendor one is likely
used in similar ways. Having these partitions is required for mainline
devices, so set it in the shared BoardConfig.

Bug: 80410283
Test: make
Change-Id: I6f2d94ff43572a28df54ea8c60f2d838a3b9216c
2019-01-16 13:32:51 +00:00
SzuWei Lin
a2d5ed1bed Fix Legacy GSI settings for BoardConfigGsiCommon.mk
Legacy GSI had been changed to include BoardConfigGsiCommon.mk
instead of treble_common*.mk. However, some default settings are
different than the original. This patch fixes
BOARD_BUILD_SYSTEM_ROOT_IMAGE in Legacy GSI makefiles.

The patch also removes redundant settings and fix some comments.

Bug: 122282239
Test: make
Change-Id: Ie4eb8cf410bfd2edc74648c0e5ee81028242a1b7
2019-01-10 10:26:03 +08:00
Anton Hansson
ac952ee4d7 Enable 64-bit mediadrmserver for mainline
This flag turns on 64-bit mediadrmserver for mainline. Keep the default
value for GSI for now.

Bug: 80410283
Test: make
Change-Id: Ie09b258f140b56121e4b531775b2a052b4dc6c15
2019-01-09 16:12:38 +00:00
SzuWei Lin
1457b3fcbf Refactor GSI BoardConfig.mk
The patch modifies the Legacy GSI to use BoardConfigGsiCommon.mk
instead of board config treble-common*.mk, and delete these
treble-common*.mk files.

After the patch, the GSI common board configs are in single file
BoardConfigGsiCommon.mk

The patch also includes:

- Moving `TARGET_COPY_OUT_VENDOR := vendor` to
  BoardConfigGsiCommon.mk, because GSI always contains no vendor
  contents.
- Configure the binder interface bitness explicitly.
- Unify the structure of each BoardConfig.mk.

Bug: 122282239
Test: compare the out folder between with and without the patch
Test: output files are all the same
Change-Id: Ie5901446920dda317dea848e6d5a7bbcf10a32cf
2019-01-08 17:35:05 +08:00
Anton Hansson
de6f4cfdc8 Reenable avb for mainline
Partial rollback of Id5d114bde8b93800fe52c791ccc47cdffd86f382.

It is likely mainline also wants some of the BOARD_AVB_SYSTEM.. flags,
but I'm not entirely sure which ones.

Test: run build_mixed with this patch
Change-Id: I6ef3c01f6c74e6d93cf798b26b8c7a4785bbefb4
2018-12-04 16:56:33 +00:00
Anton Hansson
40c4773288 Split GSI and mainline board configs
Make the mainline board config only import a subset of the GSI
options. The current set of attributes is the minimal set to
keep mainline_system_arm64 building, as well as not producing
any diffs in the current set of files in /system. It's possible
we'll need to move a few more over, but we'll do that on a
case-by-case basis.

Make the GSI config inherit the mainline one. The only diff for GSI
should be the addition of BOARD_USES_SYSTEM_OTHER_ODEX.

Bug: 119911662
Test: build mainline_system_arm64
Change-Id: Id5d114bde8b93800fe52c791ccc47cdffd86f382
2018-11-29 20:56:39 +00:00
Anton Hansson
284b81c1ae Add a mainline arm64 device
The existing 'generic' targets are emulator devices, and targeting
it has the side-effect of including emulator-specific artifacts.

Create a mainline device instead, which is really generic. This also
allows specifying tweaks unsuitable for the emulator.

Include BoardConfigGsiCommon for now, even though it includes a few
things we likely won't want in the future.

Bug: 80410283
Bug: 111538404
Test: lunch mainline_arm64; m
Change-Id: I15e7cb41fcbd3c0592a091ba7a8575ddf10bda71
2018-10-29 16:15:04 +00:00
Bowgo Tsai
3ac95b53f4 Revert "Fix build error for sdk_gphone_x86_64-userdebug"
This reverts commit 6924b25729.

Reason for revert: with the following fix, this workaround is no longer needed.
  https://android-review.googlesource.com/c/platform/build/+/762663

Bug: 112322265
Change-Id: I07363f6a5aa1697b6f7702343f3120e1049f07d8
Test: build sdk_gphone_x86_64-userdebug
2018-10-04 04:35:55 +00:00
Bowgo Tsai
6924b25729 Fix build error for sdk_gphone_x86_64-userdebug
Increases BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE to 128MB to fix
the build break. This is because we enabled AVB signing in the following
CL. And verified boot metadata will consume the reserved size in current
build system.

  https://android-review.googlesource.com/c/platform/build/+/745691

Bug: None
Test: build sdk_gphone_x86_64-userdebug
Change-Id: If1f44dccbc3a69b1b38a23e979f50c2c52401a25
2018-09-11 19:23:14 +08:00
Bowgo Tsai
9d28638cfc Enable AVB signing on GSI
In current GSI builds, AVB signing is not allowed.
We should allow signing GSI image, while building a vbmeta.img with
AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED (flag 2).

When need to disable AVB, use the vbmeta.img above together with the
GSI. When need enable AVB on GSI, include the GSI public key into the
device-specific vbmeta.img. Note that GSI is a chain partition so the
keys used to sign GSI and vbmeta.img are different.

Bug: 112293933
Test: build aosp_arm64-userdebug, checks flag 2 is set in vbmeta.img
      and there is AVB HASHTREE in system.img
      `avbtool info_image --image $OUT/system.img`
      `avbtool info_image --image $OUT/vbmeta.img`

Change-Id: If1eff317621882994e7dcbf37cd35f5bfa16b69a
2018-09-06 09:41:42 +08:00
Colin Cross
a110579e31 Remove TARGET_USES_MKE2FS
Nothing reads TARGET_USES_MKE2FS any more, mke2fs is always used.
Remove the requirement that TARGET_USES_MKE2FS is set, and remove
the places it is set.

Bug: 112241651
Test: m checkbuild
Change-Id: Ibdca062bbe7dcd19ba8f7ee7f8291ce746b74e65
2018-08-13 17:40:26 +00:00
Treehugger Robot
959701f1a8 Merge "Enable dyanmic image size for GSI" 2018-08-07 05:22:50 +00:00
Isaac Chen
b9b51b1b73 Revert "Revert "Build GSIs (aosp_$arch products) in sparse format""
This reverts commit 132748cb80.

Reason for revert: The e2fsck issue, b/112062612, that caused the
revert of the original CL has been fixed in aosp/725259.

Change-Id: I5c919aedcc5b1c4823f565ea2bbe0e6ea81bc3b0
2018-08-06 02:48:28 +00:00
SzuWei Lin
79bfba055b Enable dyanmic image size for GSI
The original size number of GSI are fixed size. Change to give
size by the content with appending 64M bytes space.

Bug: 71970853
Test: `make systemimage` and check the out system.img
Change-Id: I345f5e22c2fee7b553fc3337e9bff0ba28f579e1
Merged-In: I345f5e22c2fee7b553fc3337e9bff0ba28f579e1
2018-08-02 18:10:32 +08:00
Colin Cross
132748cb80 Revert "Build GSIs (aosp_$arch products) in sparse format"
This reverts commit bc0248f211.

Reason for revert: Triggered preexisting issue with e2fsck and ASAN

Bug: 112062612
Change-Id: I7b52fe539252ab1bb7229d32accb7abd6417f470
2018-08-01 06:26:03 +00:00
Isaac Chen
bc0248f211 Build GSIs (aosp_$arch products) in sparse format
After aosp/719235 is merged, mk_qemu_image.sh now accepts
images in both raw and sparse formats. So We can build GSIs
(system images of aosp_$arch products) in sparse format, which,
historically, is expected by users of GSIs.

Bug: 111775319
Test: The system images below are all in sparse format:
    $ lunch aosp_x86-userdebug; $m -j; emulator
    $ lunch aosp_x86_64-userdebug; $m -j; emulator
    $ lunch aosp_arm-userdebug; $m -j; emulator
    $ lunch aosp_arm64-userdebug; $m -j; emulator

Change-Id: I4cb8df0908c4618376117249b61c853fac947e47
2018-07-27 10:33:57 +08:00
SzuWei Lin
e592c965ee Move some BoardConfig settings from EmuCommon to GsiCommon
Move the settings which effect the system image to the file
BoardConfigGsiCommon.mk

Bug: 80117040
Test: build aosp_arm64-userdebug and pass
Change-Id: I42b14a124992c21b2da0e9e6197b1c38c6e58ce3
Merged-In: I42b14a124992c21b2da0e9e6197b1c38c6e58ce3
2018-07-18 10:19:46 +00:00
SzuWei Lin
fa420b40c5 Add USE_XML_AUDIO_POLICY_CONF to GSI
USE_XML_AUDIO_POLICY_CONF is must for Treble device, so it is
also must on GSI. The settings is missed when creating GSI
aosp_$arch, add it back by this patch.

Bug: 110988359
Bug: 111053290
Test: build aosp_arm64 and build pass
Change-Id: I95f096e58350233fdcc8de115cc1691360070445
2018-07-06 13:22:35 +08:00
Isaac Chen
55e1d01f92 Refactor BoardConfig.mk for emulator products
The majority of the contents in BoardConfig.mk of emulator products
are the same. The common part is factored out as EmuConfig.mk so it's
easier to maintain these closely related products going forward.

Bug: 80117040
Test: Following products have been built and booted to homescreen:
  $ lunch aosp_x86-userdebug; m -j; emulator
  $ lunch aosp_x86_64-userdebug; m -j; emulator

Change-Id: I5392e0e88865d4908906a67c29939c23af84baf0
Merged-In: I5392e0e88865d4908906a67c29939c23af84baf0
(cherry picked from commit 510b76d8ff)
2018-07-05 18:47:15 +08:00