Commit graph

1163 commits

Author SHA1 Message Date
David Zeuthen
4014a9daa7 Make room for AVB hashtree and metadata.
While the system.img images currently built with AVB support verify
correctly, mounting the filesystem content fails. This is because
'avbtool add_hashtree_footer' used to claim some of the unused /
DONT_CARE space for stashing the verity tables and this resulting in the
mapped device ending up being smaller causing the mount failure.

Fix this by leaving enough room for AVB hashtree and metadata before
building the image. This is achieved by moving the AVB hashtree support
into build_image.py and using a just added '--calc_max_image_size'
option to 'avbtool add_hashtree_footer' to figure out how much space to
leave out.

This depends on https://android-review.googlesource.com/#/c/281821/

Bug: 31264226
Test: Mounting dm-verity set up from system.img now works.

Merged-In: I4c5de1004c1059f8c582e76b3b8517d427aa1a87

Change-Id: I945a5f1f6782791736cd319f216cfa6b448fb04d
2016-10-04 17:32:16 -04:00
David Zeuthen
2ce63edab7 Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.

Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable

 BOARD_AVB_ENABLE := true

This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.

Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.

By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:

 BOARD_AVB_ALGORITHM := SHA512_RSA4096
 BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem

To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:

 BOARD_AVB_ROLLBACK_INDEX := 5

If this is not set, the rollback index defaults to 0.

The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.

The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.

The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.

BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
  vbmeta}.img in out/ directory as well as their counterparts in
  the IMAGES/ directory of edision-target_files-eng.zeuthen.zip

Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982

Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-29 11:19:36 -04:00
Dan Willemsen
b6c061e9ff Package up proguard jack_dictionary
Bug: 31182185
Test: m dist in an unbundled branch
Change-Id: I7ee1ba076cfa03f294f8231f6bdd8fa8df5557af
2016-09-20 14:21:53 -07:00
Ryan Campbell
81c9d29dad Implement path-based enabling of code coverage.
Native coverage is enabled by setting NATIVE_COVERAGE to true
and specifying a list of paths in the COVERAGE_PATHS
environment variable. Files are exported to a zip file in the
target out directory.

Change-Id: I66a2ddd88e849bec1cc0cdae1b51fe18a007e2c3
2016-09-13 10:27:25 -07:00
Dan Willemsen
572deecbca Use full path in symbols zip file
This was accidentally changed when moving to soong_zip.

Change-Id: I5f889c3c83b6f888e765d4c35486576fa11f6945
2016-09-06 13:47:05 -07:00
Dan Willemsen
fc92fb2b9b Identify modules ready to be converted to Soong
The output will be in the `m dist` results as soong_to_convert.txt, or
can be built using:

  $ m $OUT/soong_to_convert.txt

The output is a list of modules that are probably ready to convert to
Soong:

  # Blocked on Module (potential problems)
           283 libEGL (srcs_dotarm)
           246 libicuuc (dotdot_incs dotdot_srcs)
           221 libspeexresampler
           215 libcamera_metadata
               ...
             0 zram-perf (dotdot_incs)

The number at the beginning of the line shows how many native modules
depend on that module.

All of their dependencies have been satisfied, and any potential
problems that Make can detect are listed in parenthesis after the
module:

  dotdot_srcs: LOCAL_SRC_FILES contains paths outside $(LOCAL_PATH)
  dotdot_incs: LOCAL_C_INCLUDES contains paths include '..'
  srcs_dotarm: LOCAL_SRC_FILES contains source files like <...>.c.arm
  aidl: LOCAL_SRC_FILES contains .aidl sources
  dbus: LOCAL_SRC_FILES contains .dbus-xml sources
  objc: LOCAL_SRC_FILES contains Objective-C sources
  proto: LOCAL_SRC_FILES contains .proto sources
  rs: LOCAL_SRC_FILES contains renderscript sources
  vts: LOCAL_SRC_FILES contains .vts sources

Not all problems can be discovered, but this is a starting point.

Change-Id: I45674fe93fd267d4d1fb0bc3bc9aa025e20c5ac6
2016-08-26 13:33:31 -07:00
Casey Dahlin
14aa63a52a Merge "List partition_table.bpt as an output of running bpttool"
am: aba93cf736

Change-Id: Ib986d3551a2bfff5ce813139380378b11dd84d82
2016-08-23 00:56:19 +00:00
Casey Dahlin
04d15dd9a3 List partition_table.bpt as an output of running bpttool
Change-Id: I8bb1e03e451bf148e421ecac346bf20ce5d4695b
Test: Verified builds can now depend on partition_table.bpt
Bug: 30971990
2016-08-22 16:00:39 -07:00
Dan Willemsen
faac87dd9a Merge "Support dist-ing the userdatatarball"
am: 9abbeb3d8f

Change-Id: I0dac58c2eed164247fe595da6897ff00f0786e18
2016-08-17 17:48:54 +00:00
Dan Willemsen
69af2e4102 Support dist-ing the userdatatarball
So that we can get to the contents of userdata from the build server
without extracting the image.

Bug: 27719200
Test: m userdatatarball dist
Change-Id: I1438597bd29df80665571f7dc3b4957b9adde870
2016-08-16 23:41:50 +00:00
Dan Willemsen
96963dfd4d Merge "Use soong_zip and zip2zip to make dist faster"
am: 6dcdb45485

Change-Id: I9a4241b436f7dead5de7b02d3af56004b1eed42f
2016-08-11 19:33:10 +00:00
Dan Willemsen
5e29cad1d5 Use soong_zip and zip2zip to make dist faster
soong_zip parallelizes the compression when creating a zip file, which
makes these packaging steps far shorter.

zip2zip skips the decompression and recompression during the -img- file
creation.

For an aosp_arm64-eng aosp/master build:

target_files.zip: 92s to 60s
symbols.zip: 147s to 7s
img.zip: 64s to 0.5s

There's still room to parallelize the image compression during
target_files.zip (add_img_to_target_files step takes most of the time)

Change-Id: I7b6a91e4a7dbeda2e49ca936b10181cff2f973d7
2016-08-10 16:13:58 -07:00
Alex Deymo
93ff77ad1a Merge changes from topic 'ab_sideload'
am: 3750ed3e17

Change-Id: I4afbecc40068c7a87c7532b22a404319c24e2c05
2016-08-10 05:00:57 +00:00
Alex Deymo
3750ed3e17 Merge changes from topic 'ab_sideload'
* changes:
  Replace OTA sideload verification key when signing A/B devices.
  Install the update-payload-key in the recovery image as well.
2016-08-10 03:55:24 +00:00
Alex Naidis
7fa7758bd3 Merge "core: Makefile: fix a typo in a comment"
am: 80ad0df403

Change-Id: Id0fce6adadada6d80cca5b08b1e61f0e7a88a01c
2016-08-07 16:06:35 +00:00
Alex Naidis
47e24e9fe2 core: Makefile: fix a typo in a comment
Change-Id: I1a8f1a4e2d7d29fa930fd0a07f4885c162f3e1f4
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2016-08-07 14:36:50 +00:00
Alex Deymo
c6ebe9fcd7 Install the update-payload-key in the recovery image as well.
The update-payload-key is required to verify the contents of the OTA in
recovery while sideloading an update.

Bug: 27178350
TEST=`make` builds a boot.img with the payload key in recovery.

Change-Id: I04616979023b84aa4a1feb6916db2b2725b25c54
2016-08-03 20:52:54 -07:00
Dan Willemsen
922ae6846b resolve merge conflicts of dd9aee1 to stage-aosp-master
Change-Id: I4278b9700c8729a06d38acc26e22ce7c340382f2
2016-07-29 14:15:14 -07:00
Dan Willemsen
dd9aee166b Merge "Record module type statistics" 2016-07-29 20:47:14 +00:00
Dan Willemsen
3bf15e71d3 Record module type statistics
Creates a build_system_stats.txt build artifact that contains statistics
on how many BUILD_* modules are defined in a build. Also writes out
information about the Soong module types sent from the Soong build.

Merged-In: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
Change-Id: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
2016-07-29 19:58:35 +00:00
Alex Deymo
21f2fda8ba Merge \"Remove unused libraries from otatools.\"
am: 4698a191e5

Change-Id: I6a1203c2c789d7f3e4e6c5d048c6ec766f172915
2016-07-26 00:45:46 +00:00
Alex Deymo
3c1075b2a5 Remove unused libraries from otatools.
libbrillo-http was actually never used but it was being liked into
delta_generator anyway.

Bug: None
TEST=`lddtree delta_generator` doesn't show librillo-http.

Change-Id: I69ac66c87847d925b5798cf261c79466a3ff432a
2016-07-25 16:10:14 -07:00
Dan Willemsen
d136a4d7f2 Merge \"Revert \"Rename libevent-host to libevent\"\"
am: 79498a069a

Change-Id: Id2d9cc234438de271a5d83b44c77806fba32a5bf
2016-07-23 00:49:58 +00:00
Treehugger Robot
79498a069a Merge "Revert "Rename libevent-host to libevent"" 2016-07-23 00:40:35 +00:00
Dan Willemsen
8c2b6bb15e Revert "Rename libevent-host to libevent"
This reverts commit ef31fc6477.
It's now using unique_host_soname to use a different installed name,
but keeping the libevent module name.

Change-Id: I1cb6e8e670636089993054236b089da059629da1
2016-07-22 23:16:30 +00:00
Dan Willemsen
6d1049454d Merge \"Rename libevent-host to libevent\"
am: 575a023039

Change-Id: Ia98511562db8071258101d38f83f4083db966357
2016-07-18 19:26:18 +00:00
Dan Willemsen
575a023039 Merge "Rename libevent-host to libevent" 2016-07-18 19:18:32 +00:00
Badhri Jagan Sridharan
59c0529d6d Merge \"Add build variant to kernel command line\"
am: 70a9714625

Change-Id: I5e10a5375f50e9562af73407212fd4a800884b20
2016-07-15 17:10:40 +00:00
Dan Willemsen
ef31fc6477 Rename libevent-host to libevent
There's no need to use a different name for target and host modules, and
in Soong, it's better to use the same for both.

Change-Id: Ib2d8d0cc8a1e0f7f95d7c2795a360f02d946fa1a
2016-07-13 23:47:24 -07:00
Badhri Jagan Sridharan
45373976b1 Merge \"Extract public key ID from cert\"
am: 606ad22def

Change-Id: Idfc1ff8ec8766d4b15a5b1908a8eb830e28b42f3
2016-06-28 23:40:22 +00:00
Badhri Jagan Sridharan
997c9af7b1 Add build variant to kernel command line
Verity is not enabled in eng builds. Pass the build variant so
that kernel does not try to enable verity in eng builds

BUG:29276559
Change-Id: I7f412196ac59aa63e91c21d825ad15bae9f51691
2016-06-28 23:36:45 +00:00
Badhri Jagan Sridharan
131e1977f6 Extract public key ID from cert
Extracts keyid inline using openssl commands.
The keyid is passed as one of the kernel command line parameters
for the dm-android-verity module to mount root fs(system)
with verity enabled.

(cherry-picked from 3af315aed5
https://googleplex-android-review.git.corp.google.com/#/c/1061691/)

BUG: 28384658
Change-Id: I8efbe1b0e415ef1d396f9b51cfa4b3fa01b22484
2016-06-28 23:35:41 +00:00
Guang Zhu
a9bc78af69 move test artifact build rules into open source location
Bug: 29404304
Change-Id: I5553d275fe478fac0d6fe00a931a1c1f1e3bdd59
(cherry picked from commit 8322be7252)
2016-06-21 15:49:09 -07:00
Dan Willemsen
a988de3baa Merge \\"Clean up vendor image handling\\" am: 4f807026e2
am: edc6ed7aa0

Change-Id: Ia5dea45324ee41c84d997ca3e83401713e3a9ba9
2016-06-21 22:03:30 +00:00
Dan Willemsen
edc6ed7aa0 Merge \"Clean up vendor image handling\"
am: 4f807026e2

Change-Id: I637ed099a6f127aa8abca980329ddc6ecad5e3ec
2016-06-21 22:00:21 +00:00
Guang Zhu
8322be7252 move test artifact build rules into open source location
Bug: 29404304
Change-Id: I5553d275fe478fac0d6fe00a931a1c1f1e3bdd59
2016-06-20 22:32:16 -07:00
Dan Willemsen
6c3e79b8e3 Clean up vendor image handling
Standardize symlinking /system/vendor -> /vendor for aosp_* devices,
since some /vendor binaries still use /system/vendor/... paths.

Support using a prebuilt vendor image and including it into all the
normal packaging steps.

Bug: 28987532
Change-Id: I27040e8a8d1df0777e16cd1e3c3a9f1b28695e96
2016-06-18 17:47:12 -07:00
Mohamad Ayyash
3336f9ae67 Merge \"squashfs: make disable-4k-align a parameter\" into nyc-dev
am: 8ebbc4e7e2

Change-Id: Ia5c59b7bfc7f2b25fa9b13c2ce52c1bd75ccecce
2016-06-16 16:39:39 +00:00
Mohamad Ayyash
1b6d3485fc squashfs: make disable-4k-align a parameter
BUG: 29388879
Change-Id: I121d2b76db5fb269e2f7152abb2e78098437a0d5
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-06-15 16:37:21 -07:00
David Zeuthen
a787117cc5 Merge \\"bvb: Update path to key since repo was moved.\\" am: 8b3b1727da
am: 8ab7487660

Change-Id: I04b9b35c392b6e99b15f4c78358c70c9a9794532
2016-06-13 16:06:54 +00:00
David Zeuthen
bca24302bb bvb: Update path to key since repo was moved.
We recently moved Brillo verified boot from system/bvb to external/bvb
so update the path accordingly.

TEST=Build with 'BOARD_BVB_ENABLE := true' succeeds.
BUG=29099910

Change-Id: I66f3b90e23d6b2afc09f81af571ede7b573325e9
2016-06-13 11:26:26 -04:00
Tao Bao
97b55bc7a5 Merge "Add support for TARGET_RECOVERY_BRICK." am: daf55776be
am: 88df5bee3a

* commit '88df5bee3addaacddd32adf7f78fd5fe1493c38a':
  Add support for TARGET_RECOVERY_BRICK.

Change-Id: I90717df1ee18cadb89bec8afa5280b3ebf434a13
2016-06-02 22:56:43 +00:00
Tao Bao
a062c7e62d Add support for TARGET_RECOVERY_BRICK.
TARGET_RECOVERY_BRICK specifies the file that lists all the partitions
to be bricked under recovery. The file, if present, will be copied to
'$(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.brick'.

Bug: 27253717
Change-Id: Id84195b5ee1031a83bf7a077be070a3728416580
(cherry picked from commit 3051f4f11a)
2016-06-02 14:46:53 -07:00
Baligh Uddin
ae8784bbc8 Merge commit \'9b4daacaf8f7ce5a534fae524507e4a4f7622ce4\' into nyc-dev
am: 0418406186

* commit '0418406186f67096a3c42fa276799095620e2296':
  Add Oem Props to otatools package

Change-Id: Ib278834d9237965f9f663508ff312fad89ef920a
2016-05-21 00:31:19 +00:00
Baligh Uddin
0418406186 Merge commit '9b4daacaf8f7ce5a534fae524507e4a4f7622ce4' into nyc-dev 2016-05-20 17:27:18 -07:00
Baligh Uddin
9b4daacaf8 Merge commit '6c70b85cb3c75650e5154366fb5e08e3aadf9a50' into mnc-dr1.5-dev 2016-05-20 17:14:04 -07:00
Baligh Uddin
6c70b85cb3 Merge commit \'8c0c5e61498783496eec848da4f2aa4e30fe98b6\' into mnc-dr-dev
am: 275af3429f

* commit '275af3429f3049378862883dc6a0db2701f9311f':
  Add Oem Props to otatools package

Change-Id: I7e26f26d773c1dac31b274b6c7e708aee1537be8
2016-05-21 00:04:37 +00:00
Baligh Uddin
275af3429f Merge commit '8c0c5e61498783496eec848da4f2aa4e30fe98b6' into mnc-dr-dev 2016-05-20 16:59:14 -07:00
Baligh Uddin
8c0c5e6149 Merge commit \'c1937df4b12afecfdfc6a5d3b37f0aaf6ffdda5b\' into lmp-mr1-ub-dev
am: 50cae53b10

* commit '50cae53b10b7e6a18fe6016bd5dc9eaba715545d':
  Add Oem Props to otatools package

Change-Id: I4ca967ea935f4a3a5c709047ca2ed486d196e974
2016-05-20 23:50:56 +00:00
Baligh Uddin
50cae53b10 Merge commit 'c1937df4b12afecfdfc6a5d3b37f0aaf6ffdda5b' into lmp-mr1-ub-dev 2016-05-20 16:44:27 -07:00