Commit graph

2422 commits

Author SHA1 Message Date
Tao Bao
e8aa7dcf19 Merge "Build build_image and build_super_image as modules."
am: 25cf50f582

Change-Id: Idb34ce99b01fe432e0fe2f7824a87cc8fa3541bf
2019-07-19 07:40:39 -07:00
Isaac Chen
36cfb54915 Merge "Include tools/files for GSI artifacts"
am: 34e90798e5

Change-Id: I6b21d8fef3c90d0a066698bc176d3436c5a2931b
2019-07-19 07:20:44 -07:00
Tao Bao
301c6f471b Removed an obsolete TODO.
The intended check was to ensure system image won't be built as a
chained partition when using dynamic partitions. Because such an image
can't be verified by bootloader.

As it evolves, GSI system image has been built against the intended
check. Because GSI system image will be verified by first stage init in
userspace.

Bug: 80195851
Test: TreeHugger
Change-Id: I45b079799e5d7443e82d73d43e2b63c613f33165
2019-07-18 15:46:31 -07:00
Chris Gross
15d9655906 Create ODM partition NOTICE file
Logic to create a seperate ODM NOTICE file for modules located at
TARGET_OUT_ODM.

Bug: 137542307
Test: Built an image with both a seperate ODM image and one where it is
built into vendor.img and ensured that a NOTICE.xml.gz was located at
/odm/etc and contained any license generated by ODM modules.

Change-Id: I9e6f46b1b94c5b6584c2a5810713fcf49f637d02
2019-07-18 14:00:43 -07:00
Tao Bao
2bbb07c53c Build build_image and build_super_image as modules.
Bug: 63866463
Test: TreeHugger
Test: `atest releasetools_test`
Test: `atest releasetools_py3_test`
Change-Id: I2059a4ced709d1b2ee331a9aaaa5ca30db4ebf6b
2019-07-18 10:27:38 -07:00
Isaac Chen
34e90798e5 Merge "Include tools/files for GSI artifacts" 2019-07-18 06:23:34 +00:00
Daniel Norman
ac7ae9f6bb Merge "Writes misc_info.txt in o/t/p without requiring 'm dist'."
am: b74fa6cf97

Change-Id: I2ffc7bdd65b57e4b86e50c0a60ea08798c3d38ea
2019-07-17 19:01:09 -07:00
Daniel Norman
e1e4808d57 Writes misc_info.txt in o/t/p without requiring 'm dist'.
Bug: 137291090
Test: `m misc_info`, diff with META/misc_info.txt from an old `m dist` build.
Change-Id: I9bb99d3418c91a64f7d585b4a4d6a17f540c7328
2019-07-17 14:13:27 -07:00
Isaac Chen
9e09d47df8 Include tools/files for GSI artifacts
Tools/files added in this CL are necessary for mixing GSI with vendor
images from other product and for the GSI to run on the emulator.

Bug: 136786169
Test: $ lunch aosp_x86-userdebug
      $ m -j updatepackage otatools-package emu_extra_imgs
      $ cd $TMP_DIR
      $ unzip $OUT/emu-extra-linux-system-images-eng.ycchen.zip
      $ cd x86
      $ unzip -n $OUT/aosp_x86-img-eng.ycchen.zip
      $ unzip $OUT/otatools bin/mk_combined_img bin/sgdisk
      $ unzip $OUT/otatools lib64/libc++.so lib64/libext2_uuid-host.so
      $ cut -d/ -f5 system-qemu-config.txt > composit.txt
      $ SGDISK=bin/sgdisk bin/mk_combined_img -i composit.txt -o system.img
      $ cd ..
      # Download sdk-repo-linux-emulator-*.zip from AB
      $ unzip -l sdk-repo-linux-emulator-*.zip
      $ ANDROID_PRODUCT_OUT=x86 ANDROID_BUILD_TOP=x86 emulator/emulator

Change-Id: Ibf88652eb4fb3244553062bbfb8bceac9a5cda47
2019-07-17 18:06:31 +08:00
Tianjie Xu
09f64c0cd5 Merge "Add update_host_simulator to otatools"
am: f70815cbd2

Change-Id: I48acd7a3754a771aebbd94252f41448c983684b2
2019-07-15 11:32:36 -07:00
Tianjie Xu
f70815cbd2 Merge "Add update_host_simulator to otatools" 2019-07-15 18:00:16 +00:00
Steve Muckle
b81725dff1 Merge "install modules.softdep from depmod output"
am: 10115f54b9

Change-Id: I3b8ac4d326b09da334eb29bcf5b7ff197247bbd9
2019-07-12 16:02:48 -07:00
Treehugger Robot
10115f54b9 Merge "install modules.softdep from depmod output" 2019-07-12 22:20:22 +00:00
Elliott Hughes
7a45e0ccb9 Merge "Stop building unnecessary tarballs."
am: 9a4b84de56

Change-Id: I9465ce123bc1d5ab9662069af6181dd7382eff57
2019-07-12 08:10:05 -07:00
Elliott Hughes
9a4b84de56 Merge "Stop building unnecessary tarballs." 2019-07-12 14:52:53 +00:00
Elliott Hughes
440c99f1f2 Stop building unnecessary tarballs.
Test: treehugger
Change-Id: Iaba2aa6d09ad891f37171cc76778d08c78c78f93
2019-07-12 05:04:12 +00:00
Steve Muckle
155c1cef48 Merge "add BOARD_VENDOR_RAMDISK_KERNEL_MODULES[_LOAD]"
am: 3f7c416650

Change-Id: I1930149589978edeebb4c00eb2bda56beca7c7b4
2019-07-11 21:48:46 -07:00
Steve Muckle
0f7bb1b84b install modules.softdep from depmod output
The modules.softdep file is used to communicate soft dependencies
between modules and is supported by libmodprobe.

Bug: 130585369
Change-Id: I790ea872fde7fb0cb58e07277a32aa4688adcac6
2019-07-11 17:50:05 -07:00
Steve Muckle
69280d22e6 add BOARD_VENDOR_RAMDISK_KERNEL_MODULES[_LOAD]
To accommodate a future vendor ramdisk, recognize
BOARD_VENDOR_RAMDISK_KERNEL_MODULES and
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD as a way to specify kernel
modules to be stored on the vendor ramdisk, and the optional override list of
kernel modules to be loaded by first stage init.

For now this will affect the modules loaded on the generic ramdisk,
but will provide a way for vendors to add support now and hopefully not
have to modify it later when the vendor ramdisk is created.

BOARD_RAMDISK_KERNEL_MODULES is renamed to
BOARD_GENERIC_RAMDISK_KERNEL_MODULES, which is not expected to be
modified by vendors.

Bug: 137297791
Change-Id: I05944e004ab5235172da3a15b8d1c6f4c4c021ce
2019-07-11 23:53:36 +00: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
Bill Peckham
653e527b5a Merge "Move definition of create-vendor-odm-symlink within BUILDING_VENDOR_IMAGE"
am: 150c4b1f32

Change-Id: Idd62c9cfc5e38c0e896e09877f3fc44a58c28091
2019-07-03 20:54:39 -07:00
Bill Peckham
1f9b8f0cc6 Move definition of create-vendor-odm-symlink within BUILDING_VENDOR_IMAGE
When we build the system image separately from the vendor image, we need the
/vendor/odm link (if any) to be created in the vendor build, not the system
build. This change moves the create-vendor-odm-symlink function outside the
BUILDING_SYSTEM_IMAGE gaurd, and inside the BUILDING_VENDOR_IMAGE gaurd.

Bug: 136516335
Test: Build vendor image, verify that /vendor/odm -> /odm
Change-Id: I6edf5d6d1fa0b2f632f67113f69a49b43f719941
2019-07-03 15:58:48 -07:00
TreeHugger Robot
218adad125 Merge "DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master" into stage-aosp-master 2019-07-02 07:40:58 +00:00
Tao Bao
48a2feb670 Change the condition for building super_empty.img.
This CL changes the condition for building super_empty.img from
PRODUCT_BUILD_SUPER_PARTITION to PRODUCT_USE_DYNAMIC_PARTITIONS, as a
follow-up to the change in [1].

With the CL in [1], it skips building super.img and super_empty.img both
when turning off PRODUCT_BUILD_SUPER_PARTITION. However, the latter
should be mandatory whenever dynamic partitions is enabled. Because
fastboot relies on this file to properly flash dynamic partitions. Plus,
the cost for building super_empty.img is much lower than the one for
super.img.

As part of the change, it'll write group info into target_files when
building with PRODUCT_BUILD_SUPER_PARTITION == false. It's the work for
target_files merging script to determine the values to be picked up. The
current logic in merge_target_files.py always uses the one from vendor
target_files. This CL adds a testcase to ensure the behavior.

[1] https://android-review.googlesource.com/c/platform/build/+/928756

Bug: 135752763
Test: `m dist` with a target that sets PRODUCT_BUILD_SUPER_PARTITION to
      false. Check the built artifacts contain super_empty.img. Verify
      that the build can be flashed properly.
Change-Id: I277f087eab45663a6c3b33333d16e9e576c1c25c
2019-06-28 14:23:53 -07:00
Steve Muckle
003f35d0d5 Merge "copy kernel modules to ramdisk, add modules.load[.recovery]" am: c1d847e885
am: 2b7a7c7c8f

Change-Id: Icab683e5802f6c18cddd180a1c5bbcd14c9eb268
2019-06-27 16:09:17 -07:00
Treehugger Robot
c1d847e885 Merge "copy kernel modules to ramdisk, add modules.load[.recovery]" 2019-06-27 21:52:56 +00:00
Kiyoung Kim
50cf856b4a Merge "Set INSTALLED_BOOTIMAGE_TARGET in case of TARGET_NO_KERNEL is true and BOARD_PREBUILT_BOOTIMAGE is set." am: 6b261101e4
am: ed3c9a9ad6

Change-Id: I96fa27bf51caf484c0301e6a42bdbbcc6b699d20
2019-06-26 23:37:35 -07:00
Kiyoung Kim
6b261101e4 Merge "Set INSTALLED_BOOTIMAGE_TARGET in case of TARGET_NO_KERNEL is true and BOARD_PREBUILT_BOOTIMAGE is set." 2019-06-27 05:44:33 +00:00
Steve Muckle
474e4d04a3 copy kernel modules to ramdisk, add modules.load[.recovery]
Build support exists to copy a set of kernel modules to the recovery,
vendor, and odm images. Extend similar support for copying kernel
modules to the ramdisk via BOARD_RAMDISK_KERNEL_MODULES. If
BOARD_USES_RECOVERY_AS_BOOT, then BOARD_RAMDISK_KERNEL_MODULES is
added to the set of modules to be copied to recovery.

Libmodprobe now supports reading a list of kernel modules to be loaded.
Enable the creation of modules.load and modules.load.recovery files.
These files contain the contents of
BOARD_[RAMDISK|VENDOR|ODM|RECOVERY]_KERNEL_MODULES_LOAD, or if those
variables are not set, the contents of
BOARD_[RAMDISK|VENDOR|ODM|RECOVERY]_KERNEL_MODULES (indicating all
modules should be loaded by default). This allows for
optional customization of the set of modules to be loaded by
libmodprobe and the order they are loaded in.

Bug: 130585369
Change-Id: I9340787d31d71aebc8552344675d9696c189a8a1
2019-06-26 17:16:30 -07:00
Tianjie Xu
4e5591ffb9 Add update_host_simulator to otatools
Therefore, we can access the tool in tradefed test. And partners can also
run simulation without a git repo.

Bug: 131911365
Test: build otatools-package
Change-Id: Ibfeeab360517e129f47f18372bfa236b437bce9b
2019-06-26 10:57:01 -07:00
Tao Bao
8a746b5689 Merge "Stop passing --block and MKBOOTIMG to ota_from_target_files." am: ac0749ff98
am: 6855138e15

Change-Id: I986ff8caeaba5dbf29df58a6882e68cd9cde1e51
2019-06-25 16:26:38 -07:00
Tao Bao
c931547560 Stop passing --block and MKBOOTIMG to ota_from_target_files.
- `--block` has been a no-op since Oreo [1] -- ota_from_target_files
  will always build block-based OTAs or A/B OTAs.
- MKBOOTIMG is no longer needed when calling ota_from_target_files, at
  least for the callsite in Makefile. Because target_files.zip has been
  including boot/recovery images since Lollipop [2].

This CL also switches to long options to improve readability.

[1] commit 457cbf6a8a
[2] commit 3c84f56948

Test: TreeHugger
Change-Id: I801bd0525d2529156bbf783698661d90ba24017a
2019-06-25 13:04:06 -07:00
Tao Bao
b1b275873c Merge "Clean up the dependencies for user image creation." am: ec53f441fa
am: 8ae72adb4b

Change-Id: Ica87f15572d10b384e13436ec63572922df8de7c
2019-06-25 11:52:02 -07:00
Tao Bao
ec53f441fa Merge "Clean up the dependencies for user image creation." 2019-06-25 17:57:43 +00:00
Isaac Chen
378f856e9c Merge "Add lpunpack to otatools for rebuilding super.img" am: 17a3aa4819
am: 7f338d71d0

Change-Id: Ic91d89e1fafddf7e286a637d2b38db3acfd61248
2019-06-25 10:38:55 -07:00
Isaac Chen
17a3aa4819 Merge "Add lpunpack to otatools for rebuilding super.img" 2019-06-25 17:19:46 +00:00
Isaac Chen
eec4a7cba4 Add lpunpack to otatools for rebuilding super.img
lpunpack is needed to repackage super.img for mixed-image virtual devices.
For Cuttlefish, it's included in host package. We need to include it in
otatools.zip so Goldfish or other devices can use it to mix their super images.
Necessary SOs are the same as lpmake and have been included in otatools.zip.

Bug: 134461288
Test: $ lunch aosp_x86-userdebug
      $ m otatools-package
      $ unzip -l $OUT/ota* | grep lpunpack
        467824  2008-01-01 00:00   bin/lpunpack

Change-Id: Ie2092f18afb88721b29b1738847a0b781dbcd431
2019-06-25 11:50:58 +08:00
Tao Bao
1b1c093c74 Merge "Fix an issue in setting up PATH." am: 9392fb3905
am: eb13604f24

Change-Id: I90bc221f6c71196a0995fcd8b41acd4fb32bb66a
2019-06-24 16:32:49 -07:00
Tao Bao
dba635a3b7 Clean up the dependencies for user image creation.
The dependency on MAKE_EXT4FS (mke2fs) has been covered by the rule for
MKEXTUSERIMG (mkuserimg_mke2fs):
https://android.googlesource.com/platform/system/extras/+/refs/heads/master/ext4_utils/Android.bp

The dependency on mksquashfs and img2simg comes from mksquashfsimage.sh,
which has been moved into mksquashfsimage's building rule.

This CL also fixes the ordering of INTERNAL_USERIMAGES_BINARY_PATHS,
which should come after adding all the binaries to
INTERNAL_USERIMAGES_DEPS.

Test: TreeHugger
Change-Id: I8b30bf87860d9711e88eecca4b76db72f5cd8241
2019-06-24 15:47:47 -07:00
Tao Bao
cf821fc963 Fix an issue in setting up PATH.
`PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH` will
produce a space separated string due to `foreach`, if
$(INTERNAL_USERIMAGES_BINARY_PATHS) has more than one string. We didn't
hit the issue in the past because $(INTERNAL_USERIMAGES_BINARY_PATHS)
had contained only one path in practice.

Test: TreeHugger
Change-Id: I74ef4356668af63d871a81f6bfd4c9324aa1d956
2019-06-24 14:08:36 -07:00
Kiyoung Kim
62e2231b82 Set INSTALLED_BOOTIMAGE_TARGET in case of TARGET_NO_KERNEL is true and
BOARD_PREBUILT_BOOTIMAGE is set.

Based on current Makefile INSTALLED_BOOTIMAGE_TARGET always kept as
empty if TARGET_NO_KERNEL is true, so build fails with empty out path.
This change is to set up INSTALLED_BOOTIMAGE_TARGET with
$(PRODUCT_OUT)/boot.img in case of TARGET_NO_KERNEL is true and
BOARD_PREBUILT_BOOTIMAGE is defined.

Bug: 135648566
Test: m -j passed
Change-Id: I9658f215c2e2cc5d87040d5085521ef44722c4ef
2019-06-24 09:45:28 +09:00
Jaewoong Jung
9bc1ceb1c9 Merge "Fixes a typo in a comment." am: fde688ebc8
am: 35aebeb18a

Change-Id: Icee0466bf2134b11e8c4c4dc3ece046102fbca87
2019-06-19 23:06:51 -07:00
Treehugger Robot
fde688ebc8 Merge "Fixes a typo in a comment." 2019-06-20 04:20:36 +00:00
Jaewoong Jung
e6f57e05ec Fixes a typo in a comment.
Test: TreeHugger
Change-Id: Ie124090280eb0c1235e50baa4a869399bb440abb
2019-06-16 21:48:42 -07:00
Hridya Valsaraju
a0d14a8647 Merge "Fail build when sum of sizes of logical partitions exceeds OEM-set limit" am: acfbc544e6
am: a7f33ab8d9

Change-Id: I9b8df9e495a20bc01bbe383c3f1d359faa9cea94
2019-06-14 14:12:02 -07:00
Treehugger Robot
acfbc544e6 Merge "Fail build when sum of sizes of logical partitions exceeds OEM-set limit" 2019-06-14 20:23:08 +00:00
Hridya Valsaraju
219b6294dc Fail build when sum of sizes of logical partitions exceeds OEM-set limit
BOARD_SUPER_PARTITION_ERROR_LIMIT can be set by OEMs to cause a
build failure when the sum of sizes of logical partitions exceeds the same.
It is set to BOARD_SUPER_PARTITION_SIZE by default.

Bug: 133329143
Test: mmm -j32

Change-Id: Ief85c9ab3e3b9d071cd22b70e13b5c64bb784b9c
2019-06-14 09:34:46 -07:00
Dan Willemsen
6b61e81a6e Merge changes I2183ac9f,I2c76701c,Ibbe4e11a,I0706faa2,Ic5b7c4fb, ... am: 491ae5b2d1
am: fea54c0231

Change-Id: Ib485a13372709505f98643e6f69947d4c8f75a2f
2019-06-13 10:38:47 -07:00
Treehugger Robot
491ae5b2d1 Merge changes I2183ac9f,I2c76701c,Ibbe4e11a,I0706faa2,Ic5b7c4fb, ...
* changes:
  Fix dependency on BOARD_AVB_SYSTEM_KEY_PATH
  Fix some java library dependencies
  Depend on NDK libraries
  Call clean-path in more places
  Add missing dependecy on SOONG_ZIP
  Add dependencies on the toolchain (clang, etc)
2019-06-13 17:13:22 +00:00
Colin Cross
8ed5deeae1 Merge "Make kernel modules into normal installed files" am: b7035aef21
am: ffaf599a6e

Change-Id: I8c333170b760d32f109d7d82b3454f2b61769ff0
2019-06-13 04:11:39 -07:00
Treehugger Robot
b7035aef21 Merge "Make kernel modules into normal installed files" 2019-06-13 10:51:23 +00:00
Dan Willemsen
6b72c73a50 Fix dependency on BOARD_AVB_SYSTEM_KEY_PATH
Bug: 130111713
Test: treehugger
Change-Id: I2183ac9f8c45eec178876768dfcc83ae62445293
2019-06-12 21:36:57 +00:00
Oliver Nguyen
6f69d2164b Merge "Package coverage files as a zip." am: 6aef14d0e9
am: dcb71cf2bb

Change-Id: I7437fe7d5ff8f2b90f110f8e6e0787ed1c900a61
2019-06-11 19:27:56 -07:00
Treehugger Robot
6aef14d0e9 Merge "Package coverage files as a zip." 2019-06-12 02:00:01 +00:00
Dan Willemsen
3b37c4cad4 Merge "Add missing dependencies to python scripts" am: 56bfae6402
am: 083777a4c9

Change-Id: I791359b0acebb29402c8ebb922c0a3b30717889c
2019-06-10 20:37:40 -07:00
Treehugger Robot
56bfae6402 Merge "Add missing dependencies to python scripts" 2019-06-11 03:15:54 +00:00
Jooyung Han
7921c73255 Merge "Ignore testcases' NOTICE files" am: e6d5b8321f
am: 415074c997

Change-Id: I2af85be677cad04196776756f5528de9c8c59b70
2019-06-10 18:00:54 -07:00
Treehugger Robot
e6d5b8321f Merge "Ignore testcases' NOTICE files" 2019-06-11 00:24:31 +00:00
Dan Willemsen
c84e4cb917 Add missing dependencies to python scripts
These were found when trying to run remotely on RBE with only the
sources depended upon available for each rule.

Bug: 130111713
Test: treehugger
Change-Id: Id763f8fc7dfbe60445f98604db3422147165f537
2019-06-10 23:58:49 +00:00
Oliver Nguyen
e91ab2397f Package coverage files as a zip.
Test: make NATIVE_COVERAGE=true COVERAGE_PATHS="*"
Change-Id: I7ee9253ef47a502a9d29f7e15a4402cbb90e34ae
2019-06-10 15:27:31 -07:00
Hridya Valsaraju
0606ded214 Merge "Print a warning when sum of sizes of logical partitions an OEM-set limit" am: f1e61651e0
am: 9f72c850d7

Change-Id: I7ff45a5a34be2fa85c73f050cac698dc3169c125
2019-06-10 11:33:04 -07:00
Treehugger Robot
f1e61651e0 Merge "Print a warning when sum of sizes of logical partitions an OEM-set limit" 2019-06-10 18:17:40 +00:00
Hridya Valsaraju
6fab18a7eb Print a warning when sum of sizes of logical partitions an OEM-set limit
BOARD_SUPER_PARTITION_WARN_LIMIT can be set by OEMs to print
a warning when the sum of sizes of logical partitions exceed the same.
It is set to 95% of BOARD_SUPER_PARTITION_SIZE by default.

Bug: 133329143
Test: mmm -j32

Change-Id: I7d3bedd970a92be60991898e436f63d914359301
2019-06-07 09:50:47 -07:00
Alistair Strachan
126c86e559 Merge "Add misc_info.txt to rebuild super.img" am: 95836d71e6
am: c0e3153e3f

Change-Id: I095512c218d962fa0d10ec5e59a4c58071ee7564
2019-06-06 13:42:39 -07:00
Alistair Strachan
95836d71e6 Merge "Add misc_info.txt to rebuild super.img" 2019-06-06 20:23:17 +00:00
Colin Cross
4f60e366db Make kernel modules into normal installed files
We sometimes see build failures when building platform.zip happens
at the same time as building vendor.img if the vendor.img rule
runs rm -rf $OUT/vendor/lib/modules at the same time that platform.zip
is zipping $OUT/vendor/.  Move the kernel modules into normal
installation rules so that they are in place by the time either
the vendor.img or platform.zip rules run.

This will also cause the kernel modules to show up in
installed-files*.txt.

Test: m vendorimage && ls $OUT/vendor/lib/modules
Change-Id: I178b1d54bfcdb5cf5c29885ace9183ac28fc8826
2019-06-06 12:51:47 -07:00
Tao Bao
41376712ca Merge "Rebuild recovery-from-boot patch when calling add_img_to_target_files." am: e55c0ae469
am: d4680b2f33

Change-Id: Ifa54144ab48d54b7b2b18425f2951f249b625274
2019-06-05 21:19:26 -07:00
Isaac Chen
4e5e42b749 Add misc_info.txt to rebuild super.img
Include misc_info.txt (of CF's super.img) in *-img-*.zip.
This is needed if we want to rebuild super.img by replacing
some partitions in it.

Other tools, lpunpack and lpmake, are included in CF's
host package in another CL.

Bug: 134461288
Test: $ lunch aosp_cf_x86-userdebug
      $ m dist
      $ unzip -l $OUT/*-img-*.zip | grep misc_info
            619  2019-05-27 17:42   misc_info.txt

Change-Id: Idf6146c2a7f9f32c9c4e5ddd2f6b9e65fc6bf55b
2019-06-05 14:23:31 +08:00
Tao Bao
4978fa99d1 Rebuild recovery-from-boot patch when calling add_img_to_target_files.
When using Verified Boot 2.0, releasetools specifies a salt value based
on build fingerprint, so that to give idempotent images.

However, the change that removed static `ro.build.fingerprint` [1] broke
the behavior, as common.LoadInfoDict still relies on fingerprints.
Without a fixed salt, the first call to make_recovery_patch.py and the
second one (which writes IMAGES/{boot,recovery}.img) will see different
images, which leads to install-recovery.sh failure.

Note that currently there's a dependency that requires getting bootable
images through two separate calls. make_recovery_patch.py has to happen
first to get (placeholder) files in the system image. We then generate
canned fs_config files, and finally use add_img_to_target_files.py to
write the images.

This CL adds a quick workaround to force rebuilding the
recovery-from-boot patch while calling add_img_to_target_files.py.

[1] https://android-review.googlesource.com/c/platform/build/+/892933

Bug: 134123803
Bug: 134525174
Test: TreeHugger
Test: Build a non-A/B target that uses AVB. Run validate_target_files.py
      on the generated target_files.zip.
Change-Id: I5859e30be63bfd54398cf41fd2d907f15285f560
2019-06-04 22:44:45 -07:00
Jooyung Han
4416b009e1 Ignore testcases' NOTICE files
$(BUILD_NATIVE_TEST) will install a test binary into /testcases
regardless of is proprietary or not.
For now, since NOTICE.xml for a system partition depends on all modules in
/testcases, "m systemimage" may trigger "installing a proprietary test".

Modules in /testcase are not actually installed, so we can ignore them
when we make a notice file.

Bug: 133454731
Test: (internal) m systemimage, and see /vendor/lib if there are
unexpected files installed.

Change-Id: I54ee51a761049b8a5ce9e3369b30b7ade6344146
2019-06-01 09:57:28 +09:00
Dan Willemsen
25b25360f0 Merge changes Id8365ce4,I952515c2 am: c85f6d56f5
am: bcdd57abde

Change-Id: I150a18742e8e0016c961ae1c55a0812bdb3ecbf7
2019-05-29 10:31:32 -07:00
Dan Willemsen
288bedfc8f Convert more uses of $(ACP) to cp
Test: treehugger
Change-Id: Id8365ce4c06dfe731be9b80f805e071fab522909
2019-05-28 15:36:47 -07:00
Jooyung Han
bbf665b6c9 Merge "Remove recovery.id completely" am: 8614d0181c
am: af14113dc9

Change-Id: I3f19273ab2df9b6ae0848bc09eb413d1b8787c11
2019-05-24 11:16:25 -07:00
Treehugger Robot
8614d0181c Merge "Remove recovery.id completely" 2019-05-24 16:35:44 +00:00
Daniel Norman
4d3dcaf5ab Merge "Adds image-specific selinux_fc props to allow different file_contexts." am: c9fc1120c1
am: 07f55ba840

Change-Id: I02b37b267b816a1bcc8eee94651b147d1e45bfd8
2019-05-23 22:12:59 -07:00
Daniel Norman
c9fc1120c1 Merge "Adds image-specific selinux_fc props to allow different file_contexts." 2019-05-23 23:42:13 +00:00
Daniel Norman
72c626f017 Adds image-specific selinux_fc props to allow different file_contexts.
This enables mixed builds to use the file_contexts.bin from the system
build when regenerating images that come from system target files, and
similarly for file_contexts.bin from the other build when regenerating
images from other target files.

In monolithic (non-mixed) builds all image-specific selinux_fc props
point to the same file_contexts.

Bug: 132108151
Test: Built and booted mixed build devices.
Change-Id: Id51ed6d96ea6337879f1ab21d47c93c67bc25312
2019-05-23 11:21:02 -07:00
Jooyung Han
72b65abd41 Remove recovery.id completely
Since aosp/887473 removed ro.expect.recovery_id,
There is no usage of "RECOVERYIMAGE_ID_FILE" which points
$(PRODUCT_OUT)/recovery.id.

Test: m && boot
Change-Id: I704af874b7e4141d2e006595242f7b681aa47f05
2019-05-23 19:48:13 +09:00
Treehugger Robot
41b46710e9 Merge "Moving /odm/build.prop to /odm/etc/buid.prop" 2019-05-23 09:16:34 +00:00
Bowgo Tsai
63b4c9eb76 Moving /odm/build.prop to /odm/etc/buid.prop
am: 33ff602070

Change-Id: I9b26413a5fbfe43e900d79010075a4c234d4b310
2019-05-22 21:07:11 -07:00
Hridya Valsaraju
70f8340a23 Merge "Allow for the DTB image to be built by the Android build system." am: 0c45b0d982
am: f8a9d57439

Change-Id: Iee1434697514a9d442c22562c0d1e36a031d9f92
2019-05-22 05:22:48 -07:00
Bowgo Tsai
33ff602070 Moving /odm/build.prop to /odm/etc/buid.prop
In device root directory, we have the following symlinks:
  - /odm/app -> /vendor/odm/app
  - /odm/bin -> /vendor/odm/bin
  - /odm/etc -> /vendor/odm/etc
  ...

This allows the Generic System Image (GSI) to be used on both devices:
  1) Has a physical odm partition, where those symlink will be hidden
     when /odm is used as the mount point
  2) Has no physical odm partition and fallback to /vendor/odm/.

We can't just have the symlink /odm -> /vendor/odm, because the former
devices won't have /vendor/odm directory, which leads to mount failure
when the mount point /odm is resolved to /vendor/odm.

The existing /vendor/odm/build.prop won't be loaded in the latter
devices, because there is no symlink:
    - /odm/build.prop -> /vendor/odm/build.prop.

Note that init blocks reading through direct symlinks (O_NOFOLLOW) so
the above symlink won't work either. This CL moves the odm build.prop
to /odm/etc/build.prop for init to load it (symlinks in earlier
components of the path will still be followed by O_NOFOLLOW).

Bug: 132128501
Test: boot a device and checks /odm/etc/build.prop is loaded
Test: make dist with an odm.img, checks $OUT/odm/etc/build.prop is loaded
Change-Id: I6f88763db755c9ec6068bfdd9cee81c19d72e9d7
Merged-In: I6f88763db755c9ec6068bfdd9cee81c19d72e9d7
(cherry picked from commit 6c62884000)
2019-05-22 16:14:53 +08:00
Treehugger Robot
0c45b0d982 Merge "Allow for the DTB image to be built by the Android build system." 2019-05-22 07:28:24 +00:00
Bowgo Tsai
71a4d5cdd5 Moving /odm/build.prop to /odm/etc/buid.prop
In device root directory, we have the following symlinks:
  - /odm/app -> /vendor/odm/app
  - /odm/bin -> /vendor/odm/bin
  - /odm/etc -> /vendor/odm/etc
  ...

This allows the Generic System Image (GSI) to be used on both devices:
  1) Has a physical odm partition, where those symlink will be hidden
     when /odm is used as the mount point
  2) Has no physical odm partition and fallback to /vendor/odm/.

We can't just have the symlink /odm -> /vendor/odm, because the former
devices won't have /vendor/odm directory, which leads to mount failure
when the mount point /odm is resolved to /vendor/odm.

The existing /vendor/odm/build.prop won't be loaded in the latter
devices, because there is no symlink:
    - /odm/build.prop -> /vendor/odm/build.prop.

Note that init blocks reading through direct symlinks (O_NOFOLLOW) so
the above symlink won't work either. This CL moves the odm build.prop
to /odm/etc/build.prop for init to load it (symlinks in earlier
components of the path will still be followed by O_NOFOLLOW).

Bug: 132128501
Test: boot a device and checks /odm/etc/build.prop is loaded
Test: make dist with an odm.img, checks $OUT/odm/etc/build.prop is loaded
Change-Id: I6f88763db755c9ec6068bfdd9cee81c19d72e9d7
Merged-In: I6f88763db755c9ec6068bfdd9cee81c19d72e9d7
(cherry picked from commit 6c62884000)
2019-05-22 14:04:39 +08:00
Hridya Valsaraju
59eaef078d Allow for the DTB image to be built by the Android build system.
The current solution expects BOARD_PREBUILT_DTBIMAGE_DIR to
contain prebuilt DTB files that are concatenated by the build system
to create $OUT/dtb.img. In order to accommodate devices that build
the dtb image locally, make boot.img creation depend on $OUT/dtb.img
only when BOARD_PREBUILT_DTBIMAGE_DIR is undefined.

Bug: 133161451
Test: Build with BOARD_PREBUILT_DTBIMAGE_DIR undefined and verify
using unpack_bootimg.py that $OUT/dtb.img was included in boot.img.

Change-Id: Iae2c634ccdc1d83589b26d382882f75fb8565a31
2019-05-22 03:51:41 +00:00
Chris Gross
99a22624a5 Merge "Add merging of apexkeys and apkcerts metadata" am: a489a92fdc
am: 07d985d122

Change-Id: Ib5e6d864f3704ffeeb4adb1933bb34f92d3511d8
2019-05-20 18:24:32 -07:00
Colin Cross
55a499b28b Merge "Move check-all-partition-sizes to a non-phony rule" am: 2ee5efd824
am: 468549471a

Change-Id: Ia83d37b549c97fd3dc91f6f3fddc7328fb2696bf
2019-05-20 18:23:36 -07:00
Chris Gross
a489a92fdc Merge "Add merging of apexkeys and apkcerts metadata" 2019-05-20 23:36:45 +00:00
Chris Gross
fabf50a577 Add merging of apexkeys and apkcerts metadata
Bug: 131437873
Test: Built system-only and vendor builds for merge. Compared
resulting apkcertx and apexkeys text files to that of a monolithic
build,
Test: Created colliding entries in both apexkeys and apkcerts text
files and ensure the script exited with an appropriate error message.
Test: Created unit tests to cover both non-colliding and colliding
entries
Change-Id: I6e42ce682ffa9059344e8cd63ba3a720c1f93452
2019-05-20 18:35:22 +00:00
Colin Cross
606c9f4d0d Move check-all-partition-sizes to a non-phony rule
Phony rules with recipes run on every build, move the recipe for
check-all-partition-sizes to a rule with an output.

Fixes: 132900128
Test: m && m
Change-Id: I9b4d335bf269cd09a01094e895fc15053b410415
2019-05-17 15:51:39 -07:00
Bowgo Tsai
ce8b063507 Appending per-partition os_version into AVB props
os_version is important for keymaster version binding, where it
refuses to perform operations with a key that is bound to an old
system version.  This ensures that an attacker who discovers a
weakness in an old version of system or TEE software cannot roll a
device back to the vulnerable version and use keys created with the
newer version.

Previously, os_version for system.img is added into boot.img header
for bootloader to read the value then pass to TEE before booting the
HLOS. However, with project Treble to modularize each partition, all
images are now in the trajectory to be built independently (still
on-going). Also, in the Generic System Image (GSI) compliance test,
the os_version in OEM's boot.img cannot reflect the actual version of
GSI.

This CL adds per-partition os_versions into AVB metadata, which is
readable by bootloader via libavb without file system dependency. It's
still unclear for how os_version in non-system partition should be used.
We just add them for completeness here.

See more details in:
https://source.android.com/security/keystore/version-binding

Bug: 132233601
Test: build and avbtool info_image $OUT/vbmeta.img
      - Prop: com.android.build.boot.os_version -> '10'
      - Prop: com.android.build.system.os_version -> '10'
      - Prop: com.android.build.system.security_patch -> '2019-06-05'
      - Prop: com.android.build.vendor.os_version -> '10'
      - Prop: com.android.build.vendor.security_patch -> '2019-06-05'
      - Prop: com.android.build.product.os_version -> '10'
      - Prop: com.android.build.product.security_patch -> '2019-06-05'

Change-Id: I21a77420f2e8a3456f7a8cae5158eb8fc41319e7
Merged-In: I21a77420f2e8a3456f7a8cae5158eb8fc41319e7
(cherry picked from commit 9b54801b58)
2019-05-16 21:46:53 +08:00
Bowgo Tsai
813f0a975c Merge "Appending per-partition os_version into AVB props" am: 196f64bc6b
am: 5aa1aecc21

Change-Id: Ia1aa5965dfa03403f3bab5ea1acc42fbe6d9e113
2019-05-16 04:44:36 -07:00
Bowgo Tsai
9b54801b58 Appending per-partition os_version into AVB props
os_version is important for keymaster version binding, where it
refuses to perform operations with a key that is bound to an old
system version.  This ensures that an attacker who discovers a
weakness in an old version of system or TEE software cannot roll a
device back to the vulnerable version and use keys created with the
newer version.

Previously, os_version for system.img is added into boot.img header
for bootloader to read the value then pass to TEE before booting the
HLOS. However, with project Treble to modularize each partition, all
images are now in the trajectory to be built independently (still
on-going). Also, in the Generic System Image (GSI) compliance test,
the os_version in OEM's boot.img cannot reflect the actual version of
GSI.

This CL adds per-partition os_versions into AVB metadata, which is
readable by bootloader via libavb without file system dependency. It's
still unclear for how os_version in non-system partition should be used.
We just add them for completeness here.

See more details in:
https://source.android.com/security/keystore/version-binding

Bug: 132233601
Test: build and avbtool info_image $OUT/vbmeta.img
      - Prop: com.android.build.boot.os_version -> '10'
      - Prop: com.android.build.system.os_version -> '10'
      - Prop: com.android.build.system.security_patch -> '2019-06-05'
      - Prop: com.android.build.vendor.os_version -> '10'
      - Prop: com.android.build.vendor.security_patch -> '2019-06-05'
      - Prop: com.android.build.product.os_version -> '10'
      - Prop: com.android.build.product.security_patch -> '2019-06-05'

Change-Id: I21a77420f2e8a3456f7a8cae5158eb8fc41319e7
2019-05-16 12:56:41 +08:00
Martin Stjernholm
e954e3e47d Add the library absence check as a kati stage check.
(cherry picked from commit a5181f67a7)

Test: m systemimage
Test: build_test on Forrest
Bug: 132289438
Merged-In: I7a93cc0ac4480404a3d56c75eb43ae499e8a3a05
Change-Id: I6012e16bb02d4fea1cff51b20de94560da7a8d09
2019-05-10 16:14:50 +00:00
Martin Stjernholm
4c62151f8e Add libs that have been resolved to the library absence check.
(cherry picked from commit 7a2dde8bd5)

Test: m systemimage
Test: build_test on Forrest
Bug: 132289438
Merged-In: I9e517d3c2344b39cf2743a34723572e646675677
Change-Id: Id39a947c1522cf3a226ff1a4430c57bf7d861141
2019-05-10 16:14:29 +00:00
Martin Stjernholm
4a901c6d41 Ignore vndk-* subdirectories in the library absence check.
(cherry picked from commit 8222ce45dd)

Test: m systemimage
Test: build_test on Forrest
Bug: 132289438
Merged-In: I059c9d0edb78e52838a25cef0472807847d77417
Change-Id: I57359dc9f1aa2230acd3252118aaf41f42b7a913
2019-05-10 16:14:20 +00:00
Martin Stjernholm
b4e549bfb7 Exclude lib/arm(64) from the library absence check.
(cherry picked from commit 4655206209)

Test: m systemimage
Test: build_test on Forrest
Bug: 132289438
Merged-In: I5dfb534aa2bc24a8d0a75fde31b139a6ed86e6a5
Change-Id: Ied158548f391d67f44ca31b74a3711d1cb5216fe
2019-05-10 16:13:54 +00:00
TreeHugger Robot
cfca3e591d Merge "Move ro.boot.dynamic_partitions to vendor/build.prop" into qt-dev 2019-05-08 23:28:51 +00:00
Hridya Valsaraju
6cf5155f31 Merge "Move ro.boot.dynamic_partitions to vendor/build.prop" am: e591ef32a0
am: 1c87bffec6

Change-Id: Iac569cd79d6cdbe33ed3761ffc6c2bbb3e3bb6d9
2019-05-08 15:29:56 -07:00