Commit graph

1270 commits

Author SHA1 Message Date
Andreas Gampe
039b5c779f Build: ASAN in system
Add build system support for asan.tar.bz in the system image. This
is triggered by SANITIZE_TARGET_SYSTEM=true.

Bug: 36458146
Test: m && m SANITIZE_TARGET=true SANITIZE_TARGET_SYSTEM=true
Change-Id: I725f99f16a8c9182b1c7ad26580c73d3708f8554
2017-03-29 16:19:28 -07:00
Makoto Onuki
d625ef2894 Merge "Add USE_FILESLIST_GO to switch to fileslist.go" 2017-03-28 16:41:05 +00:00
Treehugger Robot
73461abd0c Merge "Fix modules.dep breakage with multiple module dependencies" 2017-03-28 01:11:39 +00:00
Steve Muckle
b74e0b9b0d Fix modules.dep breakage with multiple module dependencies
If a module has multiple dependencies, the current regexp for making
the dependencies absolute paths only modifies the first dependency.

Test: build sailfish with module configuration including multiple
      dependencies
Change-Id: I8f2b40c8c5ec228aa8f831086bcdd561c8714910
2017-03-27 13:48:28 -07:00
Makoto Onuki
9fe97e231b Add USE_FILESLIST_GO to switch to fileslist.go
fileslist.go is still disabled by default.  To enable, use:
USE_FILESLIST_GO=true m -j

Bug: 36274890
Test: Manual, with m -j

Change-Id: I722e17fa7fb6ba91e2b2c44cd7524d974cbe4a56
2017-03-24 16:12:16 -07:00
Dan Willemsen
5c8542e1b4 Fix fileslist for system other image
This got lost from the previous backport, since systemotherimage wasn't
in AOSP yet.

(The Merged-In is a random Change-Id only on master so that this only
merges up to master)

Test: lunch aosp_marlin-eng; m -j systemotherimage
Change-Id: I92c05f27c92d877f3b83e5c5ae2e76728eb162bd
Merged-In: Iafed66e19bc114552b0261dd299379dbb37873c6
2017-03-24 21:26:21 +00:00
Dan Willemsen
d79a08f9fb Depend on (bs|img)diff for target-files-package
add_img_to_target_files may use these to create the recovery patch, so
add a dependency. They were previously a transitive dependency through
the system image to the standalone recovery patch creation.

Bug: 36575896
Test: rm out/host/linux-x86/bin/imgdiff; m -j target-files-package
Change-Id: I2a43220e94c09393e88e1d9950032f5665a0d2ce
2017-03-23 22:09:06 -07:00
Dan Willemsen
f75d7fa8ea Ensure /system/vendor symlink exists in target-files-package
This used to happen in the system image creation, but the target-files
didn't really depend on the system image, so I removed that dependency.
But then we weren't creating the symlink all the time.

This should be safe to run in parallel with the same link step in the
system creation.

Bug: 36540023
Test: m -j target-files-package, ensure vendor symlink is created
      without system.img.
Change-Id: I37059fa1ce759a0870dc4c65c5515050992245e2
2017-03-23 13:22:46 -07:00
Treehugger Robot
bfc4f5e339 Merge changes I84e4f878,I37b65eb9
* changes:
  Parallelize system*.img and target-files-package
  Add missing dependencies of targets-files-package
2017-03-23 02:16:35 +00:00
Dan Willemsen
47ba4239c8 Merge "Speed up non-AB ota_from_target_files in the build system" 2017-03-22 01:41:39 +00:00
Dan Willemsen
aadd499bc3 Parallelize system*.img and target-files-package
We don't actually need to build the system image before
target-files-package, we just need to make sure everything is present in
$(PRODUCT_OUT)/system. So switch the dependencies around.

This can't be done as easily for the vendor image, since it may be a
prebuilt, or we may need to install some kernel modules into
$(PRODUCT_OUT)/vendor when building vendor.img. It tends to be smaller
anyway, so the time savings isn't as big.

Test: Make sure the build server outputs the same files
Test: Ensure target-files-package is identical before/after.
Change-Id: I84e4f878491ab2b71582f4f49418dbfbba75590f
2017-03-21 16:36:14 -07:00
Dan Willemsen
653bea928a Add missing dependencies of targets-files-package
And move simple cases of $(ACP) to cp. That does change OTA/bin/updater
from 0640 to 0700, but that's more consistent anyways.

Test: m -j target-files-package; ensure it's the same before/after.
Change-Id: I37b65eb9ddccd2f360aa007f929ece35c9e44f9b
2017-03-21 16:32:43 -07:00
Dan Willemsen
cea5cd210e Speed up non-AB ota_from_target_files in the build system
We've just created the target files package and still have the extracted
directory, so pass that to ota_from_target_files so that it doesn't have
to re-extract what we just compressed.

This saves a little bit of time -- for bullhead-userdebug on internal
master, this brings the time to build an OTA from ~340s -> ~310s. Much
of the time is still spent generating and signing the OTA.

Test: lunch bullhead-userdebug; m -j otapackage
Test: bullhead-ota-*.zip is identical before/after
Change-Id: Ib51cf6b02123e9c49280e9957c6590645470a52c
2017-03-21 15:34:27 -07:00
Treehugger Robot
8b6458e9a9 Merge "Fixed the issue that dirname: META got zipped twice." 2017-03-21 22:15:19 +00:00
Nan Zhang
cabecd9c55 Fixed the issue that dirname: META got zipped twice.
When building target-files-package, dir: META has to be copied first
to help early validation of the .zip file.

In order to prevent $(zip_root)/META from getting copied twice to $@.list,
use the method (find -path -prune -o -print) instead of (grep pattern -v).

Test: m target-files-package
Bug: b/31676493
Change-Id: Id6b4d77fb62aa136253de88573cc51a575b90be2
2017-03-21 20:07:41 +00:00
Dan Willemsen
05a2b931e9 Add LOCAL_VENDOR_MODULE as a synonym to LOCAL_PROPRIETARY_MODULE
The vendor image will have more than just proprietary modules in it
under Treble, so let's stop marking open source code as proprietary just
to move it to vendor.

Bug: 36452052
Test: compare build-aosp_arm.ninja before/after, no changes.
Test: Try defining LOCAL_VENDOR_MODULE / LOCAL_PROPRIETARY_MODULE in the
same and different ways, ensure it works.
Change-Id: I0ab046bcb7563a20d44ed00667e18497ef0873a8
2017-03-20 20:57:04 -07:00
Alex Klyubin
092c9025a9 Add /file_contexts.bin only to devices which need it
/file_contexts.bin is needed only by devices which do not have
PRODUCT_FULL_TREBLE set to true. Adding this file to devices which
have PRODUCT_FULL_TREBLE set to true causes confusion and wastes
about 800 kB of space.

/file_contexts.bin was being added unconditionally to all devices due
to the build system needing the combined file_contexts file for
host-side labelling of filesystems in images and for inclusion into
target files ZIP (again, to be used for host-side labelling later).

This change switches these targets to depend on the same file, but
from intermediates directory. As a result, everything continues to
work just fine, but without pulling in /file_contexts.bin. On devices
which need /file_contexts.bin, it is pulled in by
system/core/init/Android.mk.

Test: /file_contexts.bin still there on bullhead, but not there on
      sailfish with PRODUCT_FULL_TREBLE set to true.
Test: Clean build, device boots up with, no new denials.
      Reboot to recovery, recovery boots up fine too, no denials.
      This was tested on sailfish-eng and marlin-eng.
Bug: 36002414

Change-Id: I9bbbb08bbf7d874bba0bafcc19bcbf9eec564326
2017-03-13 13:28:34 -07:00
Alex Klyubin
2a7171a71a Explicitly depend on sepolicy artifacts in recovery targets
This makes recoveryimage/bootimage targets explicitly depend on SELinux
policy artifacts needed by recovery. Prior to this change, the
dependency was contrived: these targets would rely on copying these
files from "root" directory, and then overwriting sepolicy file with
sepolicy.recovery.

Test: Clean build, flash, device boots up just fine. No new denials.
      Reboot into recovery, recovery boot up just fine, no denials.
      This was tested on bullhead (non A/B device) and sailfish (A/B
      device).
Bug: 33642277
Change-Id: Id2369253d0c7e02e079ae01ac7140b41880fd5ad
2017-03-13 08:43:02 -07:00
Tao Bao
8fad03e771 releasetools: Drop the support for BBOTA v1 and v2.
BBOTA v1 and v2 (introduced in L and L MR1 respectively) don't support
resumable OTA. We shouldn't generate packages using v1/v2 at the risk of
bricking devices.

BBOTA v3 (since M) and v4 (since N) both support resumable OTAs. BBOTA
v4 additionally supports using FEC to possibly recover a corrupted
image.

Bug: 33694730
Test: Generate full and incremental OTAs w/ and w/o the CL. They should
      give identical packages (in v4).
Change-Id: Ib89d9cd63ba08e8e9aa4131bed18876b89d244c0
2017-03-09 12:25:46 -08:00
Tao Bao
f388104eaa releasetools: Remove dead functions in EdifyGenerator.
Remove the following functions that are needed for file-based OTAs only:
 - SetPermissions()
 - SetPermissionsRecursive()
 - MakeSymlinks()
 - DeleteFiles()
 - DeleteFilesIfNotMatching()
 - RenameFiles()
 - SkipNextActionIfTargetExists()

Bug: 35853185
Test: Verified there's no reference to these functions.
Change-Id: Iff24a9d705476211effaef28eed2a147fa5fcbce
2017-03-08 16:37:07 -08:00
Dan Willemsen
c619f99e2f Merge changes Ia5ce6870,I155654cd
* changes:
  Zip after add_img_to_target_files
  Allow add_img_to_target_files to work on a directory
2017-03-08 20:45:56 +00:00
Sen Jiang
9b8e4ca518 Put system_version in target_files.zip
Bug: 35364984
Test: m dist
Change-Id: I309acb41eb85de239c4c1718e14d9442ca1b0408
(cherry picked from commit cea4d52d2fee19281e660943129e1ad3bdc51fef)
2017-03-07 17:40:27 -08:00
Dan Willemsen
2a5a34f6bd Zip after add_img_to_target_files
For aosp_marlin (on AOSP), this speeds up target files creation from
~57 seconds to ~15 seconds.

For marlin-userdebug (on internal master), this speeds up target files
creation from ~300 seconds to ~95 seconds.

This does make some minor changes to the resulting target_files zip:

* All of the META files are actually at the beginning of the zip now,
  previously the ones created by add_img_to_target_files would be at
  the end.
* The images are slightly larger. Go's zip implementation in soong_zip
  isn't quite as good as the `zip` tool.
* vendor_filesystem_config.txt isn't present if we're not building a
  vendor image.

Test: aosp_marlin target_files zip changes look reasonable
Test: marlin target_files zip changes look reasonable
Test: bullhead target_files zip changes look reasonable
Change-Id: Ia5ce6870b85559d65107c3b94332391b4b43a0ea
2017-03-07 15:28:42 -08:00
Steven Moreland
a2e734d786 Add vnod.
Short name for vendorimage-nodeps like snod.

Bug: 33356516
Test: works
Change-Id: Iad62aa5a021d603fa9cebe90f4e28cf09d5d49ae
2017-03-07 12:17:51 -08:00
Treehugger Robot
2f6c2b44d0 Merge "Support kernel modules in vendor, recovery images" 2017-03-04 03:35:00 +00:00
Howard Chen
adbb9c30d1 Support kernel modules in vendor, recovery images
Support BOARD_VENDOR_KERNEL_MODULES which accepts a list of the
kernel module binaries. Binaries listed there are copied to
$(TARGET_OUT_VENDOR)/lib/modules and 'depmod' is executed to generate
the dependencies. BOARD_RECOVERY_KERNEL_MODULES is similarly
implemented to provide a way to specify kernel modules to be copied
to the recovery image.

Bug: 33305644
Test: android master build on marlin and load dummy modules
Merged-In: I0a58a270dbb0d2d38fd089f4abff66e62e14fac1
Change-Id: Ia5f429508ca3d7c77448358e42af6efa98fa8624
2017-03-03 18:35:30 -08:00
Alex Deymo
b4309d4f54 Update product_id and product_version location.
These files are used by the update console to determine the product
associated with a given target_files.zip.

Bug: 35804180
Bug: 33211225
Test: `make dist` generates a target_files.zip with these files.
Change-Id: I6066da07d76749ae64c26d5f661c7a6d06f3fb3d
2017-03-03 17:32:42 +00:00
Josh Gao
61d68b6152 Merge "Statically link libwinpthread into windows binaries." 2017-02-24 21:02:25 +00:00
Josh Gao
4d9268e704 Statically link libwinpthread into windows binaries.
Statically link libwinpthread.a, so that we don't have to ship a
libwinpthread dll with all of our windows exectuables.

Bug: http://b/31665213
Test: wine adb.exe
Test: wine fastboot.exe
Change-Id: I96414e980d8894f8f6a58c1c7bbd9dc5e0f5169c
2017-02-23 17:56:44 -08:00
Tao Bao
d2aed4309a Make the packaging of VBOOT_SIGNER tools conditional.
Otherwise it may fail the targets that don't have
external/vboot_reference in the manifest.

Bug: 35467608
Test: lunch aosp_dragon-userdebug; m otatools-package
Test: lunch aosp_bullhead-userdebug; m otatools-package
Change-Id: I35700a4d7d0723992badcfb4a03be85d07a4b9a9
2017-02-23 14:32:44 -08:00
Tao Bao
4b577413ff Makefile: Add the missing dependency on FUTILITY.
Bug: 35467608
Test: lunch aosp_dragon-userdebug; m dist
Change-Id: If3824ac22926f3c3cc09d5b82cb0f6da4132f937
2017-02-22 22:54:49 -08:00
Colin Cross
63fe36abbe Use ifndef or ifeq () instead of ifeq ""
ifeq with quotes is technically correct make syntax, but rarely used.
Replace it with the simpler ifndef when comparing against empty, or
with parenthesis for consistency.

Test: builds
Change-Id: Idcbe0586c4626c67d560694596b0bd9f5f93484a
2017-02-21 17:29:10 -08:00
Tao Bao
e98fb7a8d3 Build FUTILITY tool from futility-host.
Also pack the tool, vboot_signer.sh script and the test keys into
otatools.zip. This allows signing ryu target without a source repo.

Bug: 35467608
Test: m otatools-package and check the newly included files.
Test: Use otatools.zip to sign a ryu target.
Change-Id: I70f7b359f21a579463d5c7251daac81a97e338cc
2017-02-17 14:16:46 -08:00
Baligh Uddin
a6b90881ca Remove -host
Bug: 34689537
Change-Id: Idd6b24a14caa863857303633ba15bd3b41a3a624
(cherry picked from commit b24470e989)
2017-02-01 09:34:41 -08:00
Baligh Uddin
96755d1296 Add libext2_misc to otatools package
Bug: 34689537
Change-Id: I4323acdbadb1c4c8faa6dbb17a79bce72c063407
(cherry picked from commit 3d1ce3a640)
2017-02-01 09:34:06 -08:00
Dan Willemsen
6cf21a7d14 Fix symbol zip creation with OUT_DIR outside source
Bug: 34818739
Test: OUT_DIR=/... m -j /.../aosp_arm64-symbols-eng.dwillemsen.zip
Change-Id: I1d0d3a9f70d3457a536dee6fc25f49a16c353ae8
2017-01-30 20:42:28 -08:00
Tao Bao
04c8a03c85 Makefile: Pack libsparse-host.so into otatools.zip.
delta_generator has a dependency on that.

Bug: 34731113
Bug: 34723547
Test: m otatools-package
Change-Id: I70752a8c283bf98cb6106d3999515d0fd01f43b2
2017-01-26 16:27:18 +00:00
Jaekyun Seok
7ace0d60ef Prevent abuse of property overrides
To prevent abuse of PRODUCT_*PROPERTY_OVERRIDES and
ADDITIONAL*PROPERTIES, the following rules should be applied.

- Mark PRODUCT_*PROPERTY_OVERRIDES readonly after reading product
 specs.
- Disallow any changes on ADDITIONAL*PROPERTIES from product specs
 and BoardConfig.mk.
- Mark ADDITIONAL*PROPERTIES readonly before reading Android.mk
 files.

Test: building succeeded on marlin-userdebug.
Bug: 34116668
Change-Id: I93d8de086ec85ba787165a156bdcc7df04310be1
(cherry picked from commit 294286d95c)
2017-01-25 13:00:25 +09:00
Connor O'Brien
20f08c3e16 Pass flash erase & logical block size to mke2fs
This information can be used to tune ext4 stripe and stride in the
userdata partition for better performance

Test: Build & flash userdata, confirm correct stripe & stride values
Bug: 33243520
Merged-In: Ia97cdd2d0239c3484b895fce49299f692ef911d8
Change-Id: Ia97cdd2d0239c3484b895fce49299f692ef911d8
Signed-off-by: Connor O'Brien <connoro@google.com>
2017-01-13 12:17:05 -08:00
Tao Bao
bcc3109262 Makefile: Pack e2fsdroid into otatools.zip.
e2fsdroid is needed to create ext4 images with mke2fs. Also pack both
sets of mke2fs and make_ext4fs tools into otatools.zip. Because we use
the latest otatools.zip to create OTAs, which needs to handle
target_files.zip using either of them.

Bug: 34126605
Test: `m otatools-package` and check it has e2fsdroid and make_ext4fs.
Test: Use otatools.zip to sign a TF.zip that defines
      TARGET_USES_MKE2FS={true,false}.

Change-Id: I9967e4f078cbe912914c6c511681cba82356ae8e
2017-01-06 14:32:51 -08:00
Keun Soo Yim
b74649d027 include VTS packaging task files
Test: m -j vts
Change-Id: I8737412bf4e7b5c2db32325105e7c588949b959d
(cherry picked from commit 199a710f73)
2017-01-04 13:16:33 -08:00
Tao Bao
376c0146b3 Merge "HOST_OUT_EXECUTABLES path is not needed in misc_info file" 2016-12-21 06:08:23 +00:00
Vikram Dattu
29e88b850e HOST_OUT_EXECUTABLES path is not needed in misc_info file
HOST_OUT_EXECUTABLES is already added to the PATH variable,
so it is not needed to add the path info for binaries in
misc_info.txt and <partition>_image_info.txt.

Earlier the mkuserimg item in the build_image dictionary is
hardcoded to "mkuserimg.sh", but now it is customized for
mkuserimg.sh and mkuserimg_mke2fs.sh, and maintained in
dictionary "ext_mkuserimg=$(MKEXTUSERIMG)" in misc_info.txt
and <partition>_image_info.txt, where it is used in the
build_image script while creating the images.

The problem here is the value for this key is set to build
path of the file mkuserimg file
$(HOST_OUT_EXECUTABLES)/mkuserimg.sh,
i.e. out/host/linux_x86/bin/mkuserimg.sh,
there by standalone signing the images using otatools is
not working as the executables are packed in bin folder.

Test: tools/releasetools/sign_target_files_apks
    -p <extracted ota-tools.zip folder>
    --extra_signapk_args=-f /etc/opt/cert_data.dat
    -v
    --replace_verity_private_key ~/build/target/product/security/verity
    --replace_verity_public_key ~/build/target/product/security/verity.x509.pem
    -k <key maping>
    <input target files zip>
    <output target files zip>

Change-Id: I57af1025ec38f3794f779c49faa0bf965afc6a5d
2016-12-20 13:55:06 +01:00
Vikram Dattu
8be44674a1 otatools: added missing shared library for make_ext4fs
Added the missing shared library libpcre2.so for make_ext4fs
in the otatools.zip.
Standalone signing the images with otatools zip is not working
due to missing library for make_ext4fs.

Test: tools/releasetools/sign_target_files_apks
    -p <extracted ota-tools.zip folder>
    --extra_signapk_args=-f /etc/opt/cert_data.dat
    -v
    --replace_verity_private_key ~/build/target/product/security/verity
    --replace_verity_public_key ~/build/target/product/security/verity.x509.pem
    -k <key maping>
    <input target files zip>
    <output target files zip>

Change-Id: I4fc71a1c710f3075bb3bdb90d915538526004ee6
2016-12-20 13:53:34 +01:00
Daniel Cashman
df1e2102c6 Revert "Add build dependencies for split sepolicy files."
This reverts commit 086189145c.

Change-Id: Idfd210d1f16eefcedda6154b0361611f53c5158f
2016-12-17 00:53:52 +00:00
dcashman
086189145c Add build dependencies for split sepolicy files.
Add build targets for split sepolicy files so they'll appear in the root dir for
on-device compilation.  nonplat_sepolicy will eventually be removed as it should
be provided by a different partition.  Also replace sepolicy.recovery with the
appropriate split components.

Bug: 31363362
Test: Policy builds on-device and boots.
Change-Id: I017dabe6940c3cd20de6c00bb5253274d5a9269b
2016-12-16 14:01:29 -08:00
Patrick Tjin
a1900841bb build_image: add support for specifying number of inodes
Add support for specifying number of inodes when creating
system, vendor, oem partitions.  These are all read-only
and have no use for extra inodes.  Removing extra inodes
saves a lot of space.

Bug: 32246383
Change-Id: I13f1d4614b64a4abc752c42a1c65d3d151481c21
(cherry picked from commit b59eca3586)
2016-12-06 21:07:23 -08:00
The Android Automerger
ada51f3b8f Manually merge commit 'c13da91' into stage-aosp-master
* commit 'c13da91':
  Add support for creating ext4 images with mke2fs

BUG:33304034
2016-12-03 04:02:09 +00:00
Treehugger Robot
c13da91023 Merge "Add support for creating ext4 images with mke2fs" 2016-12-02 22:48:23 +00:00
Tao Bao
3b35352e1b Makefile: Pack verity_verifier into otatools.zip.
am: 7f02f3413b

Change-Id: Ib9c73dd16016b582dbaf2c40ebfc9b20c1adabe3
2016-11-28 18:13:43 +00:00