Commit graph

2179 commits

Author SHA1 Message Date
Anton Hansson
c371f19e89 Merge "Rename DEVICE arg in common buildprops script" 2019-03-20 10:25:01 +00:00
Bowgo Tsai
e4544b1c02 Moving system_other key into product.img
Currently system_other AVB public key is placed in system.img.
However, this makes it's harder to have a *generic* system.img
across different product configs. Moving the key to /product
partition to allow more product-specific AVB keys.

Device board config can add /product/etc/fstab.postinstall,
to mount system_other with this key in /product. It can specify
different mount options, file systems, verity settings, etc., in
this product-specific fstab as well.

Bug: 123611926
Test: `make productimage` checks the following is generated.
      $OUT/product/etc/security/avb/system_other.avbpubkey
      Also checks it's included in $OUT/installed-files-product.{json, txt}

Test: run the following command and checks that
      PRODUCT/etc/security/avb/system_other.avbpubkey is updated:
      ./build/tools/releasetools/sign_target_files_apks \
        --avb_system_other_algorithm SHA256_RSA2048 \
        --avb_system_other_key external/avb/test/data/testkey_rsa2048.pem \
        out/dist/*-target_files-*.zip signed-target_files.zip

Change-Id: I6804f29941bec54375d80bd68a5aedb5c23b842e
2019-03-20 16:18:11 +08:00
Yifan Hong
69e0d61cbe Add supernod build target.
superimage-nodeps and supernod depends
on images from $(ANDROID_PRODUCT_OUT) (not from
target files package). It doesn't rebuild source
images if they are present.

A typical workflow is:

    m -j
    # change code in system
    m snod -j
    m supernod -j

Test: For non retrofit, run:
      `m snod -j; m supernod -j`
Fixes: 128321505
Change-Id: Ib8c011cadb9c0cd334234aef39f19be6a48fee62
2019-03-13 11:15:21 -07:00
Anton Hansson
ee4c970eb0 System-specific product sysprops
This change makes it possible for products to specify the values
of the ro.product.system.X sysprops independently from the
corresponding sysprops on the other partitions.

Leave the fingerprint as-is for now. It will be changed to follow
suit in a followup change.

Bug: 110206836
Test: make
Change-Id: Id30012e1948df792778b102203116d4ae3f68e56
2019-03-12 18:03:44 +00:00
Anton Hansson
ef0b949be3 Rename DEVICE arg in common buildprops script
A followup change will make it not always equal TARGET_DEVICE,
so that name is unsuitable. Make its name follow the other product
variables.

Bug: 110206836
Test: presubmit
Change-Id: Icb1422ec5e7af658c5cc3070993c472e99805c6b
2019-03-12 18:03:23 +00:00
Tri Vo
9f18c64d07 Merge "recovery: install product_file_contexts and product_property_contexts" 2019-03-07 18:32:48 +00:00
Anton Hansson
2507ce486d Merge "Modify INTERNAL_KERNEL_CMDLINE instead of BOARD_ variant" 2019-02-28 10:26:18 +00:00
Anton Hansson
72e36f0278 Modify INTERNAL_KERNEL_CMDLINE instead of BOARD_ variant
The current modification of the variable within the build system
prohibits making the variable readonly.

Test: build_test
Test: boot blueline
Change-Id: Iec6058a163b5951db389d4adc0d9d0397431efb1
2019-02-27 14:29:01 +00:00
Treehugger Robot
55ebd61486 Merge "Fix dynamic partition size check for devices with recovery" 2019-02-27 01:58:58 +00:00
Yifan Hong
accf09b2e0 Fix dynamic partition size check for devices with recovery
Devices with TARGET_NO_RECOVERY unset will contain a patch
of the recovery image in the system image. Fix
corresponding size checks.

Fixes: 120043292
Bug: 124489494
Test: build cuttlefish with DAP

Change-Id: I508881f421672180ab852c0f9216184b925d83ad
2019-02-25 16:10:43 -08:00
Anton Hansson
4208c81ab9 Merge "Add support for *_CPU_VARIANT_RUNTIME flags" 2019-02-22 12:34:02 +00:00
Anton Hansson
b5312392a0 Merge "Move ART cpu properties to /vendor" 2019-02-22 12:14:49 +00:00
Logan Chien
7d35910451 Merge "Refine lsdump_paths.txt dependencies" 2019-02-22 09:08:03 +00:00
Logan Chien
5f4e29b090 Refine lsdump_paths.txt dependencies
This commit moves $(LSDUMP_PATHS) from the prerequisite of
lsdump_paths.txt to the prerequisite of findlsdumps. This change makes
it possible to dump the list of lsdump files without actually building
all lsdump files.

Bug: 124829578
Test: make out/target/product/generic/lsdump_paths.txt
      # does not build the actual lsdump files
Test: make findlsdumps  # builds lsdump_paths.txt and all lsdump files
Change-Id: I924f1c0c61391e958521c376a061651f2a301adb
2019-02-22 10:55:44 +08:00
Tianjie Xu
df5978803d Merge "Dump a copy of metadata file for full OTA" 2019-02-21 18:00:55 +00:00
Anton Hansson
71b7f7fbd0 Add support for *_CPU_VARIANT_RUNTIME flags
Specified in the BoardConfig, and default to the value of the non
_RUNTIME variants.

These flags do not modify build-time compilation, but get written to
system properties on /vendor and can be inspected at runtime to
run/compile code for the specified cpu.

Migrate the bionic and ART cpu variant flags to use the new variables,
but leave the ART preopting using the non-_RUNTIME variants.

Bug: 120773446
Test: boot downstream device specifying CPU_VARIANT_RUNTIME flags
Test: grep dalvik.vm vendor/default.prop
Change-Id: Idc81110172582f38f84cca87f2eff140c5b5f9ac
2019-02-21 14:32:13 +00:00
Anton Hansson
30851f2540 Move ART cpu properties to /vendor
System properties relating to the physical hardware belong
on the vendor partition. Move the ART-related cpu variant
sysprops there.

This also brings the ART sysprops in line with the equivalent
bionic sysprops.

Bug: 120773446
Test: make, boot
Test: grep dalvik.vm vendor/default.prop
Change-Id: I3f843a7070dd0d9148737e040fe87d6461977d09
2019-02-21 14:13:44 +00:00
Bill Peckham
f753e15791 Include merge_target_files.py deps in otatools.zip, use common argv processing.
The merge_target_files.py script needs fc_sort and sefcontext_compile, so
include these tools into otatools.zip via core/Makefile.

Modify tools/releasetools/merge_target_files.py to use the otatools common argv
processing to take advantage of the '--path' option so that we add point the
'--path' option to an extracted otatools.zip package to gain access to fc_sort,
sefcontext_compile, and soong_zip (previously included in otatools.zip).

Bug: 123600124
Test: extract otatools.zip, use --path option to point to it, verify result
Change-Id: I7d84525981b8741c6bdbcac9984256920fc7f417
2019-02-21 00:50:54 +00:00
xunchang
3b548b0302 Dump a copy of metadata file for full OTA
When building the full OTA file, write a copy of the metadata to the
dist dir. Then it will show up in the artifact of the build page for
users to parse.

Bug: 124783265
Test: make dist and check the output metadata
Change-Id: I2eb06bbf3cbb9f3653ca3352f3d601b09403d59d
2019-02-20 15:32:28 -08:00
Tri Vo
62d51b65aa recovery: install product_file_contexts and product_property_contexts
Product partition is not mounted in recovery mode. Install
product_file_contexts and product_property_contexts into rootdir for
recovery. This is similar to how we deal with system, vendor, and odm
*_contexts files.

And remove unnecessary ifdefs.

Test: m bootimage for pixel 3, product_file_contexts and
product_property_contexts appear in $OUT/recovery/root/
Change-Id: I416d9e6ea742e67a6fe294f1ad8b78fb9b844260
2019-02-19 18:32:55 -08:00
Jiyong Park
bcc8d8a2d4 Install apexkeys.txt into the target-files package
The file contains information about apex-to-keys mappings.

Bug: 124406181
Test: m dist and check if META/apexkeys.txt file exist in the
target-files package.

Change-Id: If8da917a8b4d4e8326614b34067c14ed0df59cb3
2019-02-19 14:18:46 +09:00
Treehugger Robot
01a05483ed Merge "Support verifying system_other" 2019-02-18 05:21:27 +00:00
Treehugger Robot
06ec0577b6 Merge "Use predefined macros instead of hardcoding the path" 2019-02-16 22:56:47 +00:00
Bill Peckham
f3c50438c3 Merge "Include soong_zip in OTA tools package." 2019-02-16 00:38:07 +00:00
Bill Peckham
eabb713f15 Include soong_zip in OTA tools package.
Including soong_zip in the OTA tools package enables its use in target files
repackaging scripts.

Bug: 124468071
Test: Generate build, verify that soong_zip exists in otatools.zip at bin/soong_zip
Change-Id: Iee0d9dba73a66de4d1aa6970dd8fb8debb723660
2019-02-15 11:25:34 -08:00
Roman Kiryanov
4985cc829d Use predefined macros instead of hardcoding the path
There are predefined macros image targets that are
already checked in dependencies, use them instead
of hardcoding the same path again.

Bug: 79601115
Test: make -j
Change-Id: I12b64a646df038de017ba2ef18f3d0e4274f7caa
Signed-off-by: Roman Kiryanov <rkir@google.com>
2019-02-15 10:38:02 -08:00
Roman Kiryanov
e64998fe3b Check INSTALLED_SYSTEMIMAGE_TARGET to build INSTALLED_QEMU_SYSTEMIMAGE
This change checks if INSTALLED_SYSTEMIMAGE_TARGET
is defined to generate INSTALLED_QEMU_SYSTEMIMAGE
to improve debugging.

Bug: 79601115
Test: make -j
Change-Id: Ia1aad7dbaab1d2de11a1bc3ffe7c7ae714f5f6eb
Signed-off-by: Roman Kiryanov <rkir@google.com>
2019-02-15 10:37:54 -08:00
Bowgo Tsai
45db7cefb3 Support verifying system_other
This commit extracts the AVB key used to sign system_other.img into
system.img, for init to verify system_other's AVB metadata.

The extracted key will locate in:
    /system/etc/security/avb/system_other.avbpubkey

Bug: 123611926
Test: build and checks the following is generated
      $OUT/system/etc/security/avb/system_other.avbpubkey

Change-Id: Icdc703ff5a0d50f8140bb652507b9b4cbc8a2118
2019-02-13 17:00:49 +08:00
Treehugger Robot
cb52058f8f Merge "Adding per-partition SPL into AVB prop descriptors" 2019-02-12 23:30:13 +00:00
Steven Laver
0cf76f544b Merge "Allow properties to be derived from partition-specific properties" 2019-02-12 16:44:57 +00:00
Steven Laver
9e73e82a12 Allow properties to be derived from partition-specific properties
This change allows ro.product.[brand|device|manufacturer|model|name] and
ro.build.fingerprint to be derived at boot time (and in the OTA
generation scripts) from partition-specific properties.

Test: booted system image, verified properties
Test: booted recovery image, verified properties
Test: unpacked OTA package, verified build fingerprint
Bug: 120123525
Change-Id: Iadd230a0577f35c7c37b0f911e91a5c2863ed1fe
2019-02-11 23:03:00 +00:00
Treehugger Robot
143ff1ff9a Merge "Only pick DTBs from BOARD_PREBUILT_DTBIMAGE_DIR" 2019-02-08 22:02:05 +00:00
Hridya Valsaraju
c63a74474b Only pick DTBs from BOARD_PREBUILT_DTBIMAGE_DIR
This change is required to prevent the build system
from picking up DTB files from subdirectories to
BOARD_PREBUILT_DTBIMAGE_DIR.

Test: make bootimage
Bug: 123648105

Change-Id: Ibc2a133f3c9be6362579dc9bf9ca399912b9d8a2
2019-02-08 09:36:44 -08:00
Dan Willemsen
f4249d1052 Make the duplicate header copy warning more explicit
So that it's easier to understand which makefile is actually being used,
and which ones are being ignored.

Test: manually check the warnings on a device that sets BUILD_BROKEN_DUP_COPY_HEADERS
Change-Id: If9e29458eaa655b28e6b770d194d1da867cb8d16
2019-02-07 18:43:53 -08:00
Hridya Valsaraju
a941899906 Allow for a separate recovery DTBO to be used for non-A/B devices.
This CL allows for a separate recovery DTBO to be used by
specifying it with the board config variable
BOARD_PREBUILT_RECOVERY_DTBOIMAGE.

Bug: 123889996
Test: make recoveryimage and make dist on a target that builds
recovery.img and unpack_bootimg.py to test that BOARD_PREBUILT_RECOVERY_DTBOIMAGE
gets used as the recovery DTBO.

Change-Id: I6f83f37c3c894b2acddab1000224cd433649faa1
2019-02-05 18:19:39 +00:00
Treehugger Robot
76f2628654 Merge "dynamic partitions: round partitions to BOARD_SUPER_PARTITION_ALIGNMENT" 2019-02-02 01:39:37 +00:00
Yifan Hong
5cc9230914 Merge "Add kernel info to compatibility.zip" 2019-01-31 19:06:19 +00:00
Yifan Hong
770ab053b0 Add kernel info to compatibility.zip
Add kernel configs / version to verified_assembled_vendor_manifest.xml
so that the kernel of the incoming package can be checked against
the framework. Previously, the running kernel was used instead.

Bug: 111125947
Test: test_extract_kernel
Test: manual OTA on Pixel 3 from build:
      Android P (kernel version 4.9.96)
      to ToT build:
      device kernel version = (manually modified) framework requirement = latest,
      PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS = true

Change-Id: Id524a58e94bdb6bba348ca461c9d33614ce451a9
2019-01-30 13:28:03 -08:00
Bowgo Tsai
cca76ddc1b Adding per-partition SPL into AVB prop descriptors
Bug: 119549677
Test: build and avbtool info_image
Change-Id: I0726d740c532ffd70beb09f98e088abcdfa110ef
2019-01-30 21:54:54 +08:00
Bowgo Tsai
867ab6606e DAP: building system_other.img for retrofit devices
For dynamic partitions in retrofit devices, system partition will be
a logical partition but system_other is not. However, current
build system use the same settings (logical) for both system.img and
system_other.img, leading AVB unable to locate the footer from the end
of system_other partition.

This commit support building system_other.img with correct partition size
while building system.img as a dynamic image.

Bug: 123506156
Test: check there is "system_other_size=2952790016" in file
      $OUT/obj/PACKAGING/system_other_intermediates/system_other_image_info.txt
Test: build system_other.img, then
      `simg2img $OUT/system_other.img system_other.img.raw`, checks the
      raw image size.

Change-Id: I748320a7770c694d06f06f4a35bfceb622849aa8
2019-01-30 09:58:07 +08:00
Mark Salyzyn
1d8d3bef47 dynamic partitions: round partitions to BOARD_SUPER_PARTITION_ALIGNMENT
For the worst minimum_io_size for the BOM for the flash device on
the products, set BOARD_SUPER_PARTITION_ALIGNMENT so that we can
in advance get a summary from the build that the update may fail.

Test: build
Bug: 122328872
Change-Id: I95515e58e5308b7a1e637fc8c8791c0fc61e81f2
2019-01-29 14:50:10 -08:00
Tom Cherry
c683233b64 Merge "Remove ro.expect.recovery_id" 2019-01-29 17:07:51 +00:00
Anton Hansson
02d7d48d4a Merge "Allow merging product_services into /product" 2019-01-29 09:28:40 +00:00
Yifan Hong
ab1ec4dbe3 Enforce no unused HALs when product matrix exists.
Also, remove old TODO message because it cannot be fixed.

Bug: 120600021
Test: builds
Test: remove entry from product matrix, build fails.

Change-Id: I9a6e954a1003aa4ad1bbca184ad7041ffad6b99b
2019-01-28 15:09:54 -08:00
Anton Hansson
d26e4eeec8 Allow merging product_services into /product
Allow devices to specify TARGET_COPY_OUT_PRODUCT_SERVICES := product,
which in effect treats all product_services modules the same as product
modules.

Do not generate license and build props for product_services when
this settings is enabled.

Bug: 113098451
Test: boot downstream product
Change-Id: Id51230b969900bebcf19d0138dfd6187dfce25b1
2019-01-28 21:24:59 +00:00
Tom Cherry
56ff89a90a Remove ro.expect.recovery_id
This is not used by anyone and the other half of the code to compare
against it is already functionally dead, so remove this.

Test: build
Change-Id: I44ed087cb7735bbc23e30b6c310c80eb3b7b6488
2019-01-28 10:56:37 -08:00
Treehugger Robot
8faac3669e Merge "Add security patch level to hashtree footer of system" 2019-01-24 19:28:29 +00:00
Treehugger Robot
d2da2ce398 Merge "Sign system_other.img with AVB" 2019-01-24 05:31:37 +00:00
Treehugger Robot
2463c3ab2a Merge "Support including DTB image" 2019-01-23 20:56:55 +00:00
Hridya Valsaraju
9683b2f136 Support including DTB image
Bug: 111136242
Test: When BOARD_PREBUILT_DTB_DIR is set correctly,
generated $OUT/boot.img contains the DTB image.

Change-Id: I282e31b04cc60383377b9e9b54f8fe64a8140242
2019-01-23 09:14:55 -08:00
Bowgo Tsai
1e04bf7260 Sign system_other.img with AVB
Support signing system_other.img but shouldn't include it into the
top-level vbmeta.img. system_other verifiation will not be included
in /vbmeta chains and will be done separately.

Bug: 112103720
Test: avbtool info_image --image $OUT/system_other.img
Test: avbtool info_image --image $OUT/vbmeta.img, checks 'system_other' is NOT included.
Test: Checks $OUT/obj/PACKAGING/system_other_intermediates/system_other_image_info.txt
      See the following:
        avb_system_other_hashtree_enable=true
        avb_system_other_add_hashtree_footer_args=--rollback_index 1551744000
        avb_system_other_key_path=external/avb/test/data/testkey_rsa4096.pem
        avb_system_other_algorithm=SHA256_RSA4096

Change-Id: Ia152aaab1387dcf556a42222adb39ea76881263a
2019-01-23 15:17:41 +00:00
Hsin-Yi Chen
41319b3abc Add security patch level to hashtree footer of system
Test: avbtool info_image --image system.img
Bug: 122705329
Change-Id: I7b325a9a9aba2d98cb94c5fb8488b92f54e45dab
2019-01-22 17:11:15 +08:00
Evgenii Stepanov
ffaf4815fc Merge "Limit 2 uses of SANITIZE_TARGET to ASan." 2019-01-19 01:32:51 +00:00
Evgenii Stepanov
60beecc90c Limit 2 uses of SANITIZE_TARGET to ASan.
These two places are checking for ifdef(SANITIZE_TARGET) but what
they are really looking for is the second stage of ASan build.

Fix the checks so that they do not apply to HWASan.

I have not seen any change in behavior, but there are some new files
under /system in hwasan build that were not there before, and things
keep working in general, so this feels like the right move.

Bug: 112438058
Test: none; SANITIZE_TARGET=hwaddress keeps working
Change-Id: I4544f408263b908be6ef4a47dd2b5c937e0c1f33
2019-01-18 14:06:11 -08:00
Dan Willemsen
674952098b Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.

There are a few use cases here:

 * For GSI-like cases, we only want to build the system image. This
   didn't really change, but it's somewhat simpler to configure, and
   easier to understand the build logic.

 * On the opposite side, when you're planning on using a GSI, the device
   specific build can only build the vendor images (or some other set).

 * Some cases (Fuchsia, etc) don't want to build any images, as they'll
   be distributing the build artifacts in their own packaging.

I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.

Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-18 13:11:34 -08:00
Dan Willemsen
df0808331d Always package ext filesystem tools
Every target we have needs these now.

Test: treehugger; codesearch
Change-Id: I6ab7e48887b19f956b2a7aeac78169f0e2035c73
2019-01-18 10:44:34 -08:00
Treehugger Robot
b26319ca38 Merge "Fix size check for devices with multiple groups" 2019-01-12 05:59:30 +00:00
Yifan Hong
d58e70bf21 Fix size check for devices with multiple groups
The old code calls check-sum-of-partition-sizes within a foreach
loop, causing syntax error:
... fi partition_size_list=...

Add a semicolon after fi to fix this.
Test: build with multiple groups, each group with a partition in it

Change-Id: Ic4387408f3efc1744871619c300546765c678a61
2019-01-11 13:21:11 -08:00
Treehugger Robot
1b8939b946 Merge "Add BUILD_USERNAME and BUILD_HOSTNAME" 2019-01-10 21:29:47 +00:00
Anton Hansson
fe9f373e10 Merge "Fix qemu image definition conditionals" 2019-01-09 10:33:51 +00:00
Tao Bao
519d18286e Don't build retrofit OTA package if vendor.img is unavailable.
We used to build retrofit full OTA package as long as
PRODUCT_RETROFIT_DYNAMIC_PARTITIONS is true. This doesn't work with AOSP
targets that have the flag set but without any available vendor image.

This CL detects such a condition and uses a separate flag to guard the
retrofit OTA building as well as the split super images generation.

Bug: 120852744
Test: `m -j dist` on blueline (w/ vendor images) and aosp_blueline (w/o
      vendor images).
Change-Id: I65726f24f8fc546be6802941a6a06590a3804c16
2019-01-07 12:22:48 -08:00
Tianjie Xu
daf0839f0b Merge "recovery text images: Use center_alignment for background texts" 2019-01-04 07:26:32 +00:00
Tao Bao
beea6c0828 Pack libsquashfs_utils.so into otatools.zip.
Overlooked the transitive dependency on this lib in my previous CL that
packs libfec.so.

Bug: 122280472
Test: Build `otatools.zip`. Unzip and check that
      `ldd bin/delta_generator` no longer shows any missing lib.
Change-Id: I7b633ea870f05b86ee7760c736dac7c74dee5dc2
2019-01-03 12:34:40 -08:00
Tao Bao
a19f8e993b Pack libfec.so into otatools.zip.
delta_generator now has a dependency on libfec.so [1], for generating
A/B incrementals.

[1] https://android-review.googlesource.com/c/platform/system/update_engine/+/854154

Bug: 122280472
Test: `m -j otatools-package` with aosp_marlin-userdebug. Check that
      `otatools.zip` contains libfec.so.
Change-Id: Ia6642bb2c7ccb0f89ad3079bdf65e4dbffee13f5
2019-01-02 23:24:51 -08:00
Dan Willemsen
63e48db6d1 Add BUILD_USERNAME and BUILD_HOSTNAME
These replace $USER and `hostname`, which will soon become stable values
due to sandboxing the build on Linux.

Bug: 122270019
Test: check build.prop
Change-Id: I7493e45a2a2defbdba5d82596cb91d68480f0187
2019-01-02 14:33:29 -08:00
Dan Willemsen
ad6a15433e Produce ro.build.version.preview_sdk_fingerprint
This is just a hash of the current.txt and system-current.txt right now,
though it may expand to include other API surfaces in the future.

Once prebuilts/sdk/current is populated with api_fingerprint.txt files,
we can use those for unbundled builds, but until then, just use the
PLATFORM_PREVIEW_SDK_VERSION as a placeholder.

MD5 was just the most convenient, since we don't have a sha tool that we
can use on Mac currently. I'm hoping we can get a toybox-based tool in
the future that standardizes that, but we aren't currently using sha*sum
from toybox on Linux, much less on Darwin yet.

Test: m dist out/dist/api_fingerprint.txt
Test: m out/target/product/.../system/build.prop
Change-Id: If69f270560d05135cb81a9bb2d1b208ea78f86df
2018-12-27 12:30:05 -08:00
xunchang
dbe55e147e recovery text images: Use center_alignment for background texts
It's desirable that the background texts display in the center of the
screen. So we will add the flag "--center_alignment" when generating
these images.

Bug: 121280655
Test: check and run the graphic tests
Change-Id: I6ba73ba7ef130288e950f95748e0e3fe28aa0827
2018-12-20 11:18:26 -08:00
Tao Bao
943fa4c523 Don't write vendor to dynamic_partitions_info.txt if it's unavailable.
If an AOSP target is built with dynamic partitions support but without
vendor.img available at build time, don't write 'vendor' to
dynamic_partitions_info.txt that will be used for building OTA packages.

We can't remove the partition from BoardConfig file, because the name
will be still needed in other places, such as generating the partition
metadata (super_empty.img). Otherwise manually flashing vendor.img at a
later point would require additional steps (e.g. `fastboot
create-logical-partition`).

Bug: 120852744
Test: `m -j dist` with and without vendor projects.
Change-Id: Ia1c3ed5bbea0255f1908958140dac97a1597586d
2018-12-19 14:17:55 -08:00
Colin Cross
6db5b0ea9a Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

This relands I59b20c931ee3e5a8d35eb30da4148691c5095502,
I39d580999947ee54cfefe875b57a028be5333bd7,
Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2 and
Ica006a007d112c232311435aaac0c0e476232b67, with a minor
update to match the changes made to dexpreopt_gen arguments
and a fix to correctly keep dexpreopt disabled on mac builds.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: I25163e91886cea6941afa25cdb529ed053278dcb
2018-12-17 13:46:17 -08:00
Colin Cross
b8901d7fb8 Revert "Move dexpreopting to Soong"
This reverts commit e736c58043.

Test: none
Bug: 119412419
2018-12-14 11:49:55 -08:00
Tao Bao
7732b434e9 Merge "Set PATH when calling build_super_image.py." 2018-12-14 04:23:01 +00:00
Tao Bao
403a2f9051 Set PATH when calling build_super_image.py.
build_super_image.py calls `lpmake` and expects that (i.e.
HOST_OUT_EXECUTABLES) in PATH. However, we have to explicitly set up
that inside the build.

Bug: 120553014
Test: Set OUR_DIR and build blueline-userdebug.
Change-Id: I000f9d069902a902c9504a2ba31dba6dbc6917a2
2018-12-13 10:53:12 -08:00
Anton Hansson
32c76fe219 Fix qemu image definition conditionals
BOARD_USES_<X>IMAGE is not equivalent with that image actually
existing. Since these targets depend on the INSTALLED_<X>IMAGE
variables being defined, gate the conditionals on that instead.

This logic is used in other places in Makefile

Bug: 120974093
Test: make
Change-Id: I6766042c801bf7fddc4b84671dbe5d3a157aea6b
2018-12-13 16:46:05 +00:00
Colin Cross
e736c58043 Move dexpreopting to Soong
Move the dexpreopting logic into Soong.  Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module.  Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: I59b20c931ee3e5a8d35eb30da4148691c5095502
2018-12-12 17:21:22 -08:00
Treehugger Robot
53de7a71f6 Merge "Add recovery_acpio option to make recovery image" 2018-12-12 08:13:46 +00:00
Chen, ZhiminX
752439b321 Add recovery_acpio option to make recovery image
Test: can generate recovery image with recovery_acpio
Fixes: 111871613

Change-Id: I9174a4741f571a00bcadc548cd9e1316b4175132
2018-12-11 15:23:28 +08:00
xunchang
cc57d31c91 recovery text image: use zopflipng to compress the generated images
Generate the images for recovery's wipe data menu. And use the lossless
tool zopflipng to compress the generated image. This saves space
in the boot image at the cost of the increase of build time. In practice,
it adds about ~20 seconds to build the bootimage with 32 threads.

zopflipng generally runs slower. Even with a predefined filters
strategy, it runs about 3 times slower than pngcrush, e.g. ~40s vs 15s
to compress a 1.8M png file. However, zopflipng also gives a better
compression: ~1.4M vs 1.6M for the same image. So I guess the time
consumption is a price worth paying.

Bug: 74397117
Test: build the bootimage and check the resource images
Change-Id: I3e71f8bedd3c183a3374b1a9464bf05500e1aa61
2018-12-10 19:53:38 -08:00
Tianjie Xu
81c88ad58b Generate the recovery text images at build time
We used to manually generate the background text images for recovery. That
process requires opening various emulators and takes a long time. Now that
the host Java tool is ready to generate these images, we can embed the
generation step into the build of the recovery image.

Since there's currently no make variable that defines screen width of the
device, we put the commonly used values for pixels here, i.e. 1440 for
xxxhdpi and 1080 for xxhdpi. Devices with other dpi can still use this
feature if they define the screen width in their config files.

Test: build bootimage with screen with set/unset
Change-Id: Ic8389a527e6e7194de58a9c50763e841e886652b
2018-12-06 01:10:38 -08:00
Yifan Hong
5df29604b9 Merge changes from topic "super_target_files"
* changes:
  add_img_to_target_files uses build_super_image
  Build super_empty with build_super_image.py
  Build super.img from images in target_files
2018-12-04 23:20:21 +00:00
Yifan Hong
055e6cf5c8 add_img_to_target_files uses build_super_image
Use the new script to build super_empty and super split images. No more
transformation to lpmake_args.

Test: build target_files_package for retrofit device
Change-Id: Id5f6bd607654ca869bcdf58d86b7ae300e3927eb
2018-12-03 11:33:44 -08:00
Yifan Hong
8b79d168eb Build super_empty with build_super_image.py
Use the script to build it to avoid having duplicate logic in
build-superimage-target-args and build_super_image.py
Test: build it

Change-Id: I82f74d56d744c5f5b8dd38d41fedd264b042bc7a
2018-12-03 11:33:44 -08:00
Yifan Hong
2b891ac024 Build super.img from images in target_files
For non-retrofit (launch) devices, super.img is used for factory, so
source images should be from target_files.

In this change, build-superimage-target procedure is converted to a
more flexible script so that it can be built.

Bug: 119322123
Test: build target files for device launch with dynamic partitions
Change-Id: I6ee0cc3e145357dfc74be248f81f5f8f4e51fc5c
2018-12-03 11:33:44 -08:00
Tom Cherry
3871f0fc61 Remove copying of TARGET_OUT_RAMDISK to recovery image
This was only needed for pushing first stage init to the recovery
image.  This isn't actually needed however, as the recovery image can
be fully shared and can run full init as long as there is a symlink
from /init to /system/bin/init, so that is added instead.

Bug: 80395578
Test: boot to recovery via this symlink
Change-Id: I8910543525a841401b209bfd98af30c5a0dc2688
2018-11-28 08:53:38 -08:00
Anton Hansson
6d81498baf Improve consistency of indentation in Makefile
Only use one consecutive tab in make rules and use spaces
for any additional indentation. This should generally prevent
tabs from appearing on the cmdline.

This cl is the result of 3 regex replaces:
\\\n\t\t([^\t]) -> \\\n\t    \1
\\\n\t\t\t([^\t]) -> \\\n\t        \1
\\\n\t\t\t\t([^\t]) -> \\\n\t            \1

Test: make mainline_system_arm64
Change-Id: Ic3f72deed35e39e4b1a4b492db65aeabc5bef0d5
2018-11-26 18:12:05 +00:00
Anton Hansson
5d218a123f Merge "Add support for TARGET_PRODUCT_PROP" 2018-11-26 17:51:13 +00:00
Anton Hansson
e9ee80e24a Add support for TARGET_PRODUCT_PROP
Like TARGET_SYSTEM_PROP, but is merged into /product/build.prop.

Also change the formatting of the output of both of these macros
slightly, so make the start and end clearer.

Bug: 119911662
Test: migrate downstream products to use this
Change-Id: Iddae7aac3c51b5706f3fb2690c5ca5a98840ad34
2018-11-22 15:27:35 +00:00
Yifan Hong
50611038e9 dynamic_partition_use -> use_dynamic_partitions.
Test: build OTA package
Change-Id: Ia43d23f49fc024ecc767da1c2186c4b446c034de
2018-11-21 13:00:57 -08:00
Yifan Hong
d585de5933 Merge changes from topic "dp_retrofit_gen"
* changes:
  Generate retrofit OTA.
  Add split super images to target_files.
2018-11-20 22:44:06 +00:00
Treehugger Robot
fec2671f00 Merge "Fix size checks for retrofit dynamic partitions." 2018-11-20 22:30:56 +00:00
Yifan Hong
50e7954ac9 Generate retrofit OTA.
Test: m otapackage -j, manual apply on top of P
Bug: 118506262

Change-Id: Iedc389a1058007a604de0482f2348a9ef0d5892a
2018-11-20 11:17:39 -08:00
Yifan Hong
c767f7cbfc Add split super images to target_files.
Test: build target files package
Bug: 118506262
Change-Id: Iee6143987c9bfa6f2d287e20c06ea5ef25e82985
2018-11-20 11:17:39 -08:00
Yifan Hong
f39d8af57e Fix size checks for retrofit dynamic partitions.
Now that we have two supers for retrofit devices, modify
the size checks. Only A/B devices launched with dynamic partitions
will get the / 2.

Test: builds
Bug: 116608795
Change-Id: Icdddcc0b3f3be307b3907e1c789933c2ace61867
2018-11-19 14:37:45 -08:00
Haibo Huang
ee0531da7a Add cpu variant information to vendor/default.prop
Test: build and check vendor/default.prop
Change-Id: I8d86d58c72118c7dda65e75d09680e20c9428c24
2018-11-19 18:57:36 +00:00
Evgenii Stepanov
f05ff886b8 Merge "Build ota packages for SANITIZE_TARGET other than "address"." 2018-11-15 22:26:39 +00:00
Evgenii Stepanov
5d06f240e3 Build ota packages for SANITIZE_TARGET other than "address".
HWASan OTAs should work fine.

Bug: 119436631
Test: make SANITIZE_TARGET=hwaddress dist
Change-Id: I87c8ca58b924a478679879d09a34c44cd5832470
2018-11-15 11:14:09 -08:00
Anton Hansson
8ee39f031c Merge changes Idc621b16,I00fcdce3
* changes:
  Fix dependencies of notice files
  Refactor logic for notice files
2018-11-14 12:48:55 +00:00
Yifan Hong
b7ea9d3870 Merge changes from topic "dp_retrofit"
* changes:
  Add build flags for spanning the super partition across multiple block devices.
  logical partitions -> dynamic partitions
2018-11-13 20:29:18 +00:00
Anton Hansson
6ad6f6c8ab Fix dependencies of notice files
Filter out the relevant deps for /vendor, /product and
/product_services, and make the /system version depend
on the rest.

Also filter out phony packages, which do not produce
license files on their own (though their deps might).

Bug: 118089975
Test: diff blueline notice files before and after
Change-Id: Idc621b16237dfecafd0befa742c8d3b93be1f611
2018-11-13 16:53:46 +00:00
Anton Hansson
bfbaa98bb7 Refactor logic for notice files
Move things around so that we don't need to check whether
we're in the "split license file mode" over and over, and
some other moves to improve readability.

Also rename the html_or_xml variables to the correct name
given the branch of the conditional we're in, to make it
easier to grok.

Bug: 118089975
Test: diff notice files for blueline before and after
Change-Id: I00fcdce31503c543c6c0ab6901531c54c9705617
2018-11-13 16:53:18 +00:00
Anton Hansson
1de3ef4a73 Merge "Fix cmdline args to generate-notice-files.py" 2018-11-13 08:35:01 +00:00
David Anderson
619fe2da5a Add build flags for spanning the super partition across multiple block devices.
This adds BOARD_SUPER_PARTITION_BLOCK_DEVICES, which must contain a list
of the (non-A/B suffixed) partitions that will comprise the super
partition. It is only intended for devices which cannot have a partition
named "super". For each entry, there must be a
BOARD_SUPER_PARTITION_x_DEVICE_SIZE variable defined with the exact size
of that partition (not its image size). The sum of these sizes must be
equal to BOARD_SUPER_PARTITION_SIZE.

Bug: 116802789
Test: device with BOARD_SUPER_PARTITION_BLOCK_DEVICES builds
Change-Id: I1a79c2e08ca99ce7e42207893ef3285caffecf44
2018-11-12 16:12:51 -08:00
Anton Hansson
d0ca2e6221 Fix cmdline args to generate-notice-files.py
-e should be provided multiple times to pass a list. This fixes
stripping of the NOTICE file on /system to not have /product,
/vendor and /product_services entries in it.

Previously it was trying to stirp entries from the
vendor,product,product_services subdir.

Bug: 118089975
Test: m sync, inspect NOTICES file
Change-Id: I7c336b1c593565a98aa4976305f8b69bbd0c09b5
2018-11-12 23:24:22 +00:00
Anton Hansson
30e061b6a5 Provide a syncsys target to build /system files
Builds just the files on /system, but not system.img. Like sync,
but just for /system.

Test: m syncsys
Change-Id: Ic5fc60d79d20315a5aca031dff5e2394e58d6b1c
2018-11-12 13:46:05 +00:00
Yifan Hong
c5c0124e7d logical partitions -> dynamic partitions
Reflect a name change.

* PRODUCT_USE_LOGICAL_PARTITIONS is deprecated and
will be removed in the future.

* ro.boot.dynamic_partitions is created. ro.boot.logical_partitions
will be removed once all the usage is removed.

Bug: 119286600
Test: builds

Change-Id: I5cb8bb1f5ebcee893fbef3a0f047c32de8773830
2018-11-09 16:02:59 -08:00
Anton Hansson
0625f9a524 Merge "Move ro.build.characteristics to /product props" 2018-11-06 08:52:02 +00:00
Anton Hansson
5ac408badd Move ro.build.characteristics to /product props
This property is not device-generic, as it's used for things like
whether the product is phone/tablet/other and whether it has an
sdcard or not.

Bug: 118618261
Test: adb shell getprop ro.build.characteristics for aosp_blueline
Change-Id: I6bbf1d4c36d7f37f92c67bebde58d72aba9d0852
2018-11-05 17:29:28 +00:00
Dan Willemsen
37a1986454 De-dup INTERNAL_SYSTEMIMAGE_FILES to fix PDK builds
On PDK builds, we sometimes end up with multiple entries in
INTERNAL_SYSTEMIMAGE_FILES, if we've got the definition for it, and it's
in PDK_FUSION_SYSIMG_FILES. This causes us to define multiple rules in
sdk_font.mk, leading to overriding commands errors.

Bug: 118634643
Test: attempt PDK build
Change-Id: Ieb4f46c0eece96cf246197af4b03e693493cc6a1
2018-10-31 16:39:29 -07:00
Yifan Hong
779dc30020 Merge changes from topic "dpgroup"
* changes:
  Add dynamic partition info to target files
  BOARD_{GROUP}_SIZE must not be empty.
  Add _a and _b to group names to super.
2018-10-26 18:23:53 +00:00
Yifan Hong
07d3d79e6e Add dynamic partition info to target files
Test: builds and manual inspect
Bug: 117182932
Change-Id: Ic84860d976d18ef7aa8d050fd1118d1e75a0456d
2018-10-25 16:23:42 -07:00
Yifan Hong
16a07e1806 Add _a and _b to group names to super.
For A/B devices, append slot suffix to dynamic
partition group names. This ensures that during an
update, partitions from target slot doesn't take
more than half of the super partition.

Test: flash and lpdump
Bug: 111610495
Change-Id: I07a082b67d0f9faada150c7ac3527eb737a81655
2018-10-25 16:23:42 -07:00
Mark Salyzyn
780f595fac build_image: improvements to right size for dynamic partitions
If partition_reserved_size is 0 or undefined, and
use_dynamic_partition_size is true, we should approach no space
and no free inodes automatically.

Estimate the space and number of inodes required, then do a first
pass build to see how much space actually used, and use those values
to refine the estimate.

Depends on tune2fs to report the characteristics of the filesystem,
so only support for ext filesystems.  In the future if there has to
be a more generic ability, either a tool per a filesystem has to be
found, or we will need root capabilities to mount the filesystem to
acquire the characteristics live from the host system.

Test: manual + python -m unittest test_build_image
Bug: 111302946
Change-Id: I933a388be43516b6de7b5007b296765bd5556fde
2018-10-23 15:14:00 -07:00
Tianjie Xu
1e0742e2c3 Merge "Install the ota keys under recovery as a zipfile" 2018-10-23 02:40:55 +00:00
Tianjie Xu
ffbe6b9785 Install the ota keys under recovery as a zipfile
Recovery can now parse the pem encoded x509 keys from a zipfile. So
instead of dumping the keys into a text file with some intermediate format,
we can simply create a zipfile with the keys.

Bug: 116655889
Test: make bootimage and check the generated zipfile, run sign_target_files_apks
Change-Id: Ib76feecfb26d6be713a07644e80ec96133759004
2018-10-22 14:47:15 -07:00
Tao Bao
240dcb8c45 Only set set_hashtree_disabled_flag in top-level vbmeta.img.
It's sufficient to have the flag in top-level vbmeta.img, and libavb
expects no disable flag in chained vbmeta.img.

Bug: 118115607
Test: `m vbmetaimage` with an -eng target using vbmeta_system.img. Check
      the flag in the generated image
      (`avbtool info_image --image vbmeta_system.img`).
Change-Id: Ia429dd8a5cf0243e16ae305da210d3ea27c68abf
2018-10-22 13:06:49 -07:00
Dan Willemsen
3e8eb377db Stop passing DIST_DIR to Soong
Test: m dist
Change-Id: I812606595703299f5e333d4e62bc1abeaad15c05
2018-10-20 21:37:44 -07:00
Matt Wachowski
40afa81053 Supporting change for aosp/771168
Submitting the change above before this one will "work" for now but we
want to pass vbmeta.img instead of system.img for the more robust
solution.

Bug: 78113934
Test: Built on my local machine.  Asserted that VerifiedBootParams.proto
exists.  Asserted that the emulator boots correctly with this file.

Change-Id: Ie91f49a3c7d49fc667e3f12e7e3866c3d9eb1960
2018-10-17 16:38:53 -07:00
Treehugger Robot
d3e8e5321f Merge "Clean up DIST_DIR usages, move to dist-for-goals" 2018-10-17 15:26:38 +00:00
Dan Willemsen
7537fd050f Clean up DIST_DIR usages, move to dist-for-goals
soong_ui now guarantees DIST_DIR is set in the environment, so remove
the default.

Use dist-for-goals instead of writing directly into DIST_DIR.

When building the system image, use DIST_DIR from the environment
instead of from make. This will eventually stop working, but this will
work for now.

Bug: 117463001
Test: m dist  (check gpl_source.tgz, logs/product_copy_files_ignored.txt)
Test: m out/target/product/generic/product_copy_files_ignored.txt
Change-Id: Ice557e0a148602cb8eb154efb747d416f0d0db59
2018-10-16 23:37:51 -07:00
Treehugger Robot
206813151d Merge "Build group info to super image" 2018-10-17 01:37:24 +00:00
Yifan Hong
9edaa38bdf Build group info to super image
Bug: 116817738
Test: lpdump and manual inspect
Change-Id: I990300d1d5772ae5e9f28b916d91c5bea9cd9a50
2018-10-16 14:32:43 -07:00
David Anderson
7709ab2b69 Rename vbmeta_mainline to vbmeta_system.
Bug: 116859651
Test: device builds with chained vbmeta_system enabled
      vbmeta_system.img is generated

Change-Id: I75b52a89feeec8dd0e1e271d2a8c3c94036c932c
2018-10-15 14:42:29 -07:00
Tao Bao
93ab84467f Check dir existence before finding files for OTATOOLS_DEPS.
This avoids building errors in branches that don't include such projects
(e.g. external/avb or system/update_engine). Note that although it
won't actually build otatools in such branches, it fails while parsing
the Makefile.

Bug: 112293933
Test: Rename external/avb. `m otatools` passes.
Change-Id: I334239fb23b1795ec77049ba9b81b288d2b4e2da
2018-10-12 11:28:17 -07:00
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