Commit graph

1957 commits

Author SHA1 Message Date
Bowgo Tsai
d6ff89705c Allow GSI targets to build otatools.zip
otatools.zip is required to sign GSI.

Bug: 112293933
Test: lunch aosp_arm64-userdebug && make otatools-package
Test: lunch aosp_arm64-userdebug && make otapackage will fail
Change-Id: Iae9f9af5cc8b98c05a66219779ce35592d3321bd
2018-10-12 14:41:46 +08:00
Yifan Hong
3f0d1ad451 Merge "Support "updatable groups"." 2018-10-04 22:21:57 +00:00
Yifan Hong
b43012f0ad Support "updatable groups".
* BOARD_SUPER_PARTITION_GROUPS defines a list of "updatable groups". Each
updatable group is a group of partitions that share the same pool of free
spaces.

* For each group in BOARD_SUPER_PARTITION_GROUPS, a BOARD_{GROUP}_SIZE and
BOARD_{GROUP}_PARTITION_PARTITION_LIST may be defined.
    - BOARD_{GROUP}_SIZE: The maximum sum of sizes of all
      partitions in the group.
      If empty, no limit is enforced on the sum of sizes for this group.
    - BOARD_{GROUP}_PARTITION_PARTITION_LIST: the list of partitions that
      belongs to this group.
      If empty, no partitions belong to this group, and the sum of sizes is
      effectively 0.

* BOARD_SUPER_PARTITION_PARTITION_LIST should not be defined
by the device. It is now computed from all
BOARD_{GROUP}_PARTITION_PARTITION_LIST.

* Each 'updatable group' has its own pool of space for its
partitions to grow into. Enforce the following:
    * sum(all partitions) <= super partition (/ 2 for A/B)
    * For each group, sum(partitions in group) <= group size
    * sum(all group sizes) <= super partition (/ 2 for A/B)

Test: builds
Bug: 111610495
Change-Id: I072b011714ec31a1d8813cc75edd27da3c6ff39a
Merged-In: I072b011714ec31a1d8813cc75edd27da3c6ff39a
2018-10-04 13:08:56 -07:00
David Anderson
b954afec0b Remove uuidgen.py and update lpmake parameters.
Bug: 117229984
Test: device builds with PRODUCT_USE_LOGICAL_PARTITIONS=true
Change-Id: Ib39d19726861dd79d90923163f9e594ed91da4ca
2018-10-03 14:24:34 -07:00
Colin Cross
7363cde33e Use soong_zip for platform.zip
soong_zip produces more reproducible zip files that are not
affected by umask values or timestamps.

This partially reapplies I2eca2f7618e06c0b5893ff54c79261921fe051d6
with fixes for 64-bit only builds and directories that are changing
during zipping.

Bug: 69500920
Test: m checkbuild
Test: m checkbuild platform
Test: lunch hikey64_only && m platform
Test: contents of zips is unchanged
Change-Id: Iac5c43276f7ae700d4d13d0ef27003d09c1c87e0
2018-10-01 13:41:27 -07:00
Colin Cross
21122f901c Use soong_zip for otatools.zip and otacerts.zip
soong_zip produces more reproducible zip files that are not
affected by umask values or timestamps.

This partially reapplies I2eca2f7618e06c0b5893ff54c79261921fe051d6.

Bug: 69500920
Test: m checkbuild
Test: contents of zips is unchanged
Change-Id: Idf6fbc94e257dc34af4f5b115d740b7cb9bac015
2018-10-01 13:41:27 -07:00
Colin Cross
53c8f9789a Fix PDK builds
$OUT/obj/APPS/SystemUI_intermediates/package.dex.apk was not being
written after being converted to Soong.  Add a copy rule for it
to soong_app_prebuilt.mk, add it as an implicit output to the Make
rules that create it, and add it as a real dependency to the
platform.zip rules.

Test: m platform
Change-Id: I96f58d3d80b764a51a6acb87e92498589cfe5c18
2018-09-29 22:33:41 -07:00
Tom Cherry
b6eeba5bab Merge "Allow BOARD_USES_RECOVERY_AS_BOOT without BOARD_BUILD_SYSTEM_ROOT_IMAGE" 2018-09-26 22:24:54 +00:00
Tom Cherry
2929cadb3b Allow BOARD_USES_RECOVERY_AS_BOOT without BOARD_BUILD_SYSTEM_ROOT_IMAGE
The recovery image already contains a copy of first stage init, so we
can boot unconditionally to the recovery image and instruct first
stage init whether or not to boot to Android or to recovery.  In this
case, we need neither the kernel to mount /system as / nor a separate
partition for recovery, so this change modifies the build scripts to
allow this combination.

Bug: 114062208
Test: Boot pixel from recovery to Android with BOARD_USES_RECOVERY_AS_BOOT
      But without BOARD_BUILD_SYSTEM_ROOT_IMAGE
Change-Id: Icd047afb7f22d2724b3bcaca1aa0c837426dcce7
2018-09-26 20:30:36 +00:00
Matt Wachowski
7e67802381 Merge "Added rules to include verified boot config in zip" 2018-09-26 17:15:11 +00:00
Yifan Hong
10f7310829 max size of dynamic partitions for AB devices are halved.
For example, if BOARD_SUPER_PARTITION_SIZE is
10GiB, then the sum of sizes of all dynamic partitions must
be within 5GiB.
Fixes: 115920069
Test: make

Change-Id: I800faff28e8483c92a1c0cf5e0b3bae4d638f86d
2018-09-19 14:33:14 -07:00
Treehugger Robot
f63b7f9c6f Merge "Don't pass --setup_as_rootfs_from_kernel when using a super partition." 2018-09-19 00:34:20 +00:00
David Anderson
8916a2a13c Don't pass --setup_as_rootfs_from_kernel when using a super partition.
When the system partition is a dynamic partition, the device will be
using an initial ramdisk and should not have a root device specified on
the kernel command-line.

Bug: 115939310
Test: device boots when BOARD_SUPER_PARTITION_PARTITION_LIST contains
      super and AVB is enabled.

Change-Id: I5c4b2304bf1ab6a59443c43c354845bf8a3949f0
2018-09-18 15:53:40 -07:00
Tao Bao
1edaca1af7 Add a missing closing quote in INSTALLED_RECOVERY_BUILD_PROP_TARGET.
Missing that doesn't seem to affect correctness, but it upsets the
syntax parsing in my editor.

Test: `m -j out/target/product/marlin/recovery/root/prop.default` with
      aosp_marlin-userdebug.
Change-Id: I272f6a6e4fe67b3ef316aa38896a0df0b42228d0
2018-09-18 10:26:49 -07:00
Colin Cross
0cbf03b8f9 Revert "Use soong_zip for otatools.zip, platform.zip, and otacerts.zip"
This reverts commit d55211f915.

Reason for revert: broke 64-bit only builds
Bug: 69500920

Change-Id: I5c3dfceb6f5b89eacd1b2279c87a1030a37f44db
2018-09-18 02:35:05 +00:00
Colin Cross
d55211f915 Use soong_zip for otatools.zip, platform.zip, and otacerts.zip
soong_zip produces more reproducible zip files that are not
affected by umask values or timestamps.

Bug: 69500920
Test: m checkbuild
Test: contents of zips is unchanged
Change-Id: I2eca2f7618e06c0b5893ff54c79261921fe051d6
2018-09-17 12:04:27 -07:00
Matt Wachowski
9e4d5153b7 Added rules to include verified boot config in zip
Bug: b/78113934
Test: Local

Change-Id: I011a84e3804c6f2d217c723b9e05fd0f9a814e04
2018-09-14 09:53:14 -07:00
Tao Bao
aff024ab6e Merge "Expose libminui related variables as vendor default properties." 2018-09-11 21:33:01 +00:00
Tao Bao
92cc5d2ebe Merge "Support building chained VBMeta images." 2018-09-11 18:27:37 +00:00
Treehugger Robot
d9a58852bd Merge "Enable AVB signing on GSI" 2018-09-11 06:21:21 +00:00
Treehugger Robot
860f9d11a8 Merge "Use the new executable for mkuserimg_mke2fs" 2018-09-08 03:50:32 +00:00
Tao Bao
744c4c7604 Support building chained VBMeta images.
Bug: 112007947
Test: `m dist` with aosp_taimen-userdebug.
Test: Set up a target that uses chained VBMeta images of
      `vbmeta_mainline` and `vbmeta_vendor`. `m dist` and check the
      build log, as well as outputs from
      `avbtool info_image --image vbmeta.img`,
      `avbtool info_image --image vbmeta_mainline.img`,
      `avbtool info_image --image vbmeta_vendor.img`.
Change-Id: Ib1d4e97f583b65245703eae15d211adcd9e83741
2018-09-06 16:55:51 -07:00
Tao Bao
5f99923ef1 Expose libminui related variables as vendor default properties.
TARGET_RECOVERY_DEFAULT_ROTATION, TARGET_RECOVERY_OVERSCAN_PERCENT and
TARGET_RECOVERY_PIXEL_FORMAT are vendor-specific properties used by
libminui. So they are needed by both of recovery and charger modes.

We used to pass them to libminui as build-time flags (pre-Q), and
switched them to runtime properties recently (available to recovery
only). Since /sbin/charger lives on system image, the values should be
still passed as runtime properties, but need to be additionally
available under charger mode, and overridable by vendor-init.

This CL writes these variables as vendor default properties (i.e.
/vendor/default.prop if property_overrides_split_enabled is true,
otherwise into /default.prop). Note that writing them as vendor build
properties doesn't work, as init doesn't load /vendor/build.prop under
charger mode.

Bug: 113567255
Test: Build along with other CLs in the topic (for sepolicy and
      libminui changes). Boot into charger mode.
Test: Boot into recovery. Run graphics test.
Change-Id: Iccc4de0fbff508d489fc93b45c2ecfd0fb96053c
2018-09-06 09:25:22 -07:00
Treehugger Robot
71034e3764 Merge "Adding better AVB error message" 2018-09-06 07:45:34 +00:00
Treehugger Robot
076662d015 Merge "Add care_map_generator as a dependency of BUILT_TARGET_FILES_PACKAGE" 2018-09-06 06:45:28 +00:00
Tao Bao
f2dd520c1c Merge "Map numeric dpi value to density bucket for recovery resources." 2018-09-06 04:05:27 +00: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
Bowgo Tsai
99ed1b4fbd Adding better AVB error message
Also removing the requirement of BOARD_BOOTIMAGE_PARTITION_SIZE when
BOARD_AVB_ENABLE is set. Some targets (e.g., emulator) doesn't build
boot.img when AVB is enabled.

Bug: 112293933
Test: build a failure case and checks the error output is expected
Change-Id: I290c707719193ddaedcd9fd0b31de566ad17078c
2018-09-06 09:38:45 +08:00
Tianjie Xu
573322279a Use the new executable for mkuserimg_mke2fs
This is in line with the change of mkuserimg_mke2fs.sh to python binary.

Bug: 112555072
Bug: 63866463
Test: unittests pass
Change-Id: I82c0be1e5bbc685edc15120da73aa43fdc9f2f05
2018-09-05 20:52:47 +00:00
Tianjie Xu
19174ba4dc Add care_map_generator as a dependency of BUILT_TARGET_FILES_PACKAGE
This solves the missing host executable when calling
add_img_to_target_files.py.

Bug: 113877667
Test: make target-files-package for aosp_sailfish
Change-Id: I133064ef86a1f9c5b4ec6d27345fb49c61a729e5
2018-09-04 15:33:58 -07:00
David Anderson
1ef03e2b79 Add super_empty.img to target-files and the update package.
super_empty.img is needed for "fastboot update" to work, as such, it
must be included in the update package. This change adds lpmake
parameters to misc_info.txt for add_img_to_target_files.py, and ensures
that lpmake is packaged with otatools.zip.

The build-superimage-target macro is now split into two functions - one
to generate the device-specific arguments, and another to build the full
command-line for convenience. The former is used to pass arguments
directly to add_img_to_target_files.

Bug: 113524256
Test: make updatepackage builds and includes super_empty.img
      make otatools includes lpmake

Change-Id: I25091c964b036beeea2a8b8f738e2c18937c1eb4
2018-08-30 16:02:23 -07:00
Tao Bao
e1e829efe1 Map numeric dpi value to density bucket for recovery resources.
When choosing the density for recovery resources, the code used to
handle primary density values only, i.e. mdpi, hdpi, xhdpi, 400dpi,
xxhdpi, 560dpi and xxxhdpi. Unlisted values, such as 500dpi, will be
categorized as xhdpi, but with tiny font size selected for recovery.

This CL improves the handling of numeric dpi values. It allows targets
using numeric values in PRODUCT_AAPT_PREF_CONFIG, and maps that to a
proper density bucket. Targets can still specify the density bucket
directly, which will take priority.

Bug: 111559919
Test: `m -j bootimage` with marlin/sailfish/walleye/taimen respectively.
      Check the chosen density bucket for recovery resources
      (xxxhdpi/xxhdpi/xxhdpi/xxxhdpi).
Test: Set PRODUCT_AAPT_PREF_CONFIG to 279/280/281/500/559/560/640. Check
      the computed bucket and the selected recovery font file.
Change-Id: Ia40fcdec5a2752c08172716bcc622a36a2a83cea
2018-08-29 22:08:37 -07:00
Tom Cherry
04552fed3b Merge "Support a first stage ramdisk via TARGET_RAMDISK_OUT" 2018-08-29 17:05:40 +00:00
Dario Freni
d909caf397 Merge "Include /product_services software in NOTICE." 2018-08-29 09:11:44 +00:00
Tom Cherry
d14b895665 Support a first stage ramdisk via TARGET_RAMDISK_OUT
Support a first stage ramdisk which will include the targets placed
into TARGET_RAMDISK_OUT.  This replaces the existing ramdisk on
existing devices.

All system images are now built to be mounted as the root dir.
Devices with a first stage ramdisk will switch root to the system
partition.

BOARD_BUILD_SYSTEM_ROOT_IMAGE remains and is used to specify if the
system partition is going to be directly used as rootfs without the
ramdisk.

Bug: 79173823
Bug: 79758715
Test: hikey boots, sailfish boots
Test: OTA walleye from P to master
Change-Id: Idbb2dccc6340b0235a4bef03e11e420a9ed154b6
2018-08-28 12:42:41 -07:00
Tao Bao
7c417b7fd4 Merge "Clean up the rules for making vbmeta.img." 2018-08-28 17:21:36 +00:00
Dario Freni
cbca1139e8 Include /product_services software in NOTICE.
Bug: 111179267
Test: flashed a module with NOTICE file on a devices and checked the
Legal information webview.

Change-Id: I6e52dee0ea23f05ea73d7cc747c2db1c1525f4b2
2018-08-28 18:06:39 +01:00
Anton Hansson
d7eaae0f09 Merge "Standardize parition build props." 2018-08-28 07:23:05 +00:00
Anton Hansson
1f8729e635 Standardize parition build props.
This adds a set of standard build properties that are shared
between the system, vendor, odm, product, product_services and
bootimage partitions. The following properties are added:
    ro.X.build.date
    ro.X.build.date.utc
    ro.X.build.fingerprint
    ro.X.build.id
    ro.X.build.tags
    ro.X.build.type
    ro.X.build.version.incremental
    ro.X.build.version.release
    ro.X.build.version.sdk
    ro.product.X.brand
    ro.product.X.device
    ro.product.X.manufacturer
    ro.product.X.model
    ro.product.X.name

vendor and odm already had all of these, but bootimage, product
and product_services only had a subset and system didn't have
any.

Bug: 78359442
Bug: 111491184
Test: m out/target/product/hikey64/system/build.prop and inspect
Change-Id: Ia346d61aec331ed1b9fea12e6a50f1b79147473d
2018-08-27 22:37:15 +01:00
Yifan Hong
c247436e2f Merge changes from topic "resizable_ota"
* changes:
  Add _b to super.
  Create build-superimage-target.
2018-08-24 23:03:22 +00:00
Tao Bao
0da4347827 Clean up the rules for making vbmeta.img.
This CL intends to be a no-op change to functionality. It prepares for
the upcoming changes that support creating chained VBMeta images.

Bug: 112007947
Test: `m dist` with aosp_taimen-userdebug
Change-Id: Iaac45bde7971b056e17a6e7b0c89336ed206916e
2018-08-23 22:21:13 -07:00
Tao Bao
cee6d0456d Add the missing rule for including product_services.img into vbmeta.img.
Bug: 80741439
Test: `m -j vbmetaimage` for a target that uses product_services image
      (i.e. `BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE := ext4`).
      Verify that the generated `vbmeta.img` includes the descriptor for
      `product_services.img`.
Change-Id: Ia2d64523319c3313803acbc63dd56154a0426334
2018-08-23 22:14:28 -07:00
Yifan Hong
ebba784d0a Add _b to super.
During OTA, update_engine expects both slots in super,
so that it doesn't have to create the missing slot. Thus,
UUIDs of all logical partitions are consistent. Values
are the result of `uuidgen.py {name}_{slot}` for A/B and
`uuidgen.py {name}` for non-A/B).

Test: adb shell lpdump /dev/block/by-name/super
Bug: 110717529
Change-Id: Ibb90d4dbe1a56bf314d4a02d7aa2f2be18d04855
2018-08-23 09:38:00 -07:00
Tao Bao
da9f2d8fd4 Merge changes Icf44032f,Iec8524d3
* changes:
  Add the missing dependency on BOARD_PREBUILT_DTBOIMAGE.
  use BOARD_PREBUILT_DTBOIMAGE in target-files-package
2018-08-22 23:56:55 +00:00
Yifan Hong
251a02f2f0 Create build-superimage-target.
Combine INSTALLED_SUPERIMAGE_TARGET with INSTALLED_SUPERIMAGE_EMPTY_TARGET.

Also fixes inconsistent UUIDs for super_empty.img
because PRIVATE_SUPER_PARTITION_SUFFIX is not defined.

Test: flash and inspect device mapper
Change-Id: I7f00c4e21ebdd21e94fa387c6e2fbea06a6e75b7
2018-08-22 16:43:57 -07:00
Tao Bao
f4866c72ca Add the missing dependency on BOARD_PREBUILT_DTBOIMAGE.
Test: Use a target that defines `BOARD_INCLUDE_RECOVERY_DTBO := true`
      and BOARD_PREBUILT_DTBOIMAGE. Touching a prebuilt dtbo file
      triggers rebuilding of recovery image.
Change-Id: Icf44032fb29542c6836a401c79fb85345ad6cc3c
2018-08-22 14:40:45 -07:00
cfig
286874053c use BOARD_PREBUILT_DTBOIMAGE in target-files-package
it's better to use the original $(BOARD_PREBUILT_DTBOIMAGE) instead
of AVB-padded $(INSTALLED_DTBOIMAGE_TARGET), the latter will be padded
to the size of /dtbo partition

Test: `make target-files-package` target file RECOVERY/recovery_dtbo is
    the original BOARD_PREBUILT_DTBOIMAGE
Test: `make otapackage` build pass and OTA file works fine

Change-Id: Iec8524d3a0544ddca89481dc613f076b36aeed25
2018-08-22 14:34:55 -07:00
David Anderson
433f822d76 Build image for clean super partition.
This adds a new super_empty.img output to the build when
PRODUCT_USE_LOGICAL_PARTITIONS is true and a super partition size is
set. This will be used by fastboot flashall in fastbootd, since it needs
a record of the partition layout in case the super partition is corrupt
or not yet flashed.

Unlike the full super.img, super_empty.img is not a sparse image. It
contains the minimal data sequence needed to format the super partition.
It also does not contain partition sizes, since flashing is responsible
for choosing the correct partition size.

The full super.img (which contains embedded partition data) is still
available via "make dist".

Bug: 78793464
Test: super_empty.img generated when PRODUCT_USE_LOGICAL_PARTITIONS is
      true.
      mmm system/extras/partition_tools && lpdump super_empty.img works

Change-Id: I34e915a1fead806287dde554d190474785e52500
2018-08-22 11:40:22 -07:00
Tao Bao
e9d61b02e8 Rename INSTALLED_SYSTEMIMAGE to INSTALLED_SYSTEMIMAGE_TARGET.
This gives a consistent mapping between partition names and the image
targets (i.e. partition => INSTALLED_PARTITIONIMAGE_TARGET). This CL
also creates an alias for the old name so that device-specific Makefiles
that refer to INSTALLED_SYSTEMIMAGE would keep working.

This CL renames image-for-partitions to images-for-partitions, and
returns INSTALLED_SYSTEMIMAGE_TARGET for system. It doesn't change the
actual functionality, but allows substantially simplifying the rule.

Test: `m dist` with aosp_taimen-userdebug
Test: `m dist` with a target that uses super partition
Change-Id: I2954ee5d855c1652a33c640ee615649588d5bc04
2018-08-21 21:57:21 -07:00
Tao Bao
696bb33676 Install recovery etc files to recovery/root/system/etc.
They used to be installed under recovery/root/etc. This CL moves the
files to the new location and creates a symlink from /etc to /system/etc
(done by the rule in system/core/rootdir). This gives similar layout
between normal boot and recovery, and allows installing prebuilt_etc
files with Soong (`recovery_available: true`).

As part of the change, we no longer need the whitelisting rule for
mke2fs.conf.

Bug: 112780007
Test: Build with other changes in the topic (aosp_taimen-userdebug).
      Check the generated files under recovery (/etc being a symlink to
      /system/etc).
Test: Boot into recovery. Verify basic functionalities (`adb shell` and
      `adb sideload`, factory reset).
Test: `build/soong/build_test.bash --dist`
Change-Id: Ibb6dea6f179a339f0c2d0fd8ba05ec0085b79a12
2018-08-21 10:30:49 -07:00