Commit graph

1255 commits

Author SHA1 Message Date
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
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
Tao Bao
7f02f3413b Makefile: Pack verity_verifier into otatools.zip.
verity_verifier is needed when verifying verity metadata.

Bug: 32173582
Test: `m otatools-package`
Change-Id: I63fdeb75cdca10ea38c1df978d64701acdd4c1db
2016-11-22 15:36:57 -08:00
Adrien Schildknecht
9a072cc0b0 Add support for creating ext4 images with mke2fs
We are investigating replacing make_ext4fs with the upstream tool mke2fs.
To mitigate the trouble that may arise if the new tool behave differently
compared to the old one, there will be a transition period.

Devices that want to use the new way of creating ext4 images can set the
variable "TARGET_USES_MKE2FS" to true in their BoardConfig.mk
By default, the build system will choose the old tool 'make_ext4fs'.

Test: m otapackage with TARGET_USES_MKE2FS={,false,true}
Change-Id: I282bcb9efe335a86c53986283090ca947d65c7f8
2016-11-18 17:06:29 -08:00
Dan Albert
55c6b82091 Merge "Add a dist goal for the NDK."
am: e5d1926c61

Change-Id: I469216eb13da6061854a48f28d3fb3fcea4a0068
2016-10-17 23:09:26 +00:00
Treehugger Robot
e5d1926c61 Merge "Add a dist goal for the NDK." 2016-10-17 22:59:17 +00:00
Sasha Levitskiy
1ea9eacdae Merge "build: tools: Add json collection of installed files with hashes."
am: fe77369b50

Change-Id: Ib3e9c8dead0a6fdbb0f93690da66e2a8e1ea0f39
2016-10-15 01:13:22 +00:00
Dan Albert
4d323338fe Add a dist goal for the NDK.
Test: make sdk dist
Bug: None
Change-Id: I07dfc73e3cea5afebcf5ed10cf860eb3f33cbff6
2016-10-14 16:45:30 -07:00
Sasha Levitskiy
4a34533e11 build: tools: Add json collection of installed files with hashes.
Adds installed-files.json in addition to installed-files.txt
Further sorts the file list to be ordered within the same size bucket.

Test: manual, cross-checked checksums with sha256sum utility
      checked build outputs.

Bug: 19988819
Merged-in: Ifb632eb4df65ec48645c8f93e36bae44ccc52ba8
Change-Id: Ifb632eb4df65ec48645c8f93e36bae44ccc52ba8
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2016-10-14 16:29:16 -07:00
David Zeuthen
757d17753b resolve merge conflicts of aa126ab to nyc-mr1-dev-plus-aosp
Change-Id: I6e45dff4fcc873a91b6067a04f9fa4e801a1f4c2
2016-10-07 16:27:34 -04:00
Treehugger Robot
01bd1d34db Merge "Make AVB work when BOARD_USES_RECOVERY_AS_BOOT is set to true." 2016-10-07 19:44:37 +00:00
Dan Willemsen
829ab04c9b Merge "Replace product variable stashing with .KATI_READONLY" am: 157ad04cfc am: 9d2208441c
am: 34d8c31258

Change-Id: Idc49bb5ad4890c368762cd73ac34e995b2633d1d
2016-10-06 23:53:30 +00:00
David Zeuthen
b2fea5878c Make AVB work when BOARD_USES_RECOVERY_AS_BOOT is set to true.
Often BOARD_USES_RECOVERY_AS_BOOT is used together with
BOARD_BUILD_SYSTEM_ROOT_IMAGE, but with this combination we're currently
not adding a hash footer to boot.img. Fix this.

Bug: 31119415
Test: Built with BOARD_USES_RECOVERY_AS_BOOT set to true and inspected images.
Merged-In: If033e5c93f5b71fd17405af7d970dc3f0540a1d2
Change-Id: I2f10bbffb0ba2467d53e3e62d5379c3ab7236063
2016-10-06 15:15:00 -04:00
Dan Willemsen
c1f17ffc7d Replace product variable stashing with .KATI_READONLY
Instead of using rot13 / rot26, use the Kati extension to mark these
variables as readonly.

Move $(strip) for a few variables to before they're marked readonly. Use
a different variable for modifications to BOARD_KERNEL_CMDLINE in
build/core/Makefile.

Test: build/tools/kati_all_products.mk on AOSP and internal master
Test: build-aosp_bullhead.ninja the same before / after
Change-Id: If98b24af763831a9c5c2de38037a69ab1bf9e023
2016-10-06 10:50:26 -07:00
Dan Willemsen
90d946e577 Remove obsolete BOARD_BVB_ENABLE reference
Test: None
Change-Id: Ic6af0ecb0bb6989501189344f9e57d21c4ced0bb
2016-10-06 10:26:19 -07:00
David Zeuthen
4e9c89ab87 resolve merge conflicts of 86180eb to nyc-mr1-dev-plus-aosp
Change-Id: Ia4bfb2571bac509cebe22f70ff43e6696f832423
2016-10-04 18:53:34 -04:00
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