History log of /frameworks/native/cmds/installd/otapreopt.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef21fd2b6b08d5faddaeabe83718d875d20a6abc 22-May-2017 Andreas Gampe <agampe@google.com> Otapreopt: Add some static_asserts

Add some checks that indicate version issues.

Bug: 38501464
Test: m
Change-Id: Iec2043eda19126166139d7220618d11032e98af0
2520d44e664049f67f56795bedf5cc1d0494cc44 05-May-2017 Nicolas Geoffray <ngeoffray@google.com> Remove obsolete DEXOPT_SAFEMODE.

installd side of the change.

Test: build
Change-Id: I358c0784a7b563cbd6ceaecdb80710971f483d02
(cherry picked from commit bad623a225d0b3d94f30f8654bd4684969e90d4c)
12375069e753adea6c123fca7706b1018d358c92 10-May-2017 Andreas Gampe <agampe@google.com> Otapreopt: Work around bug 38186355

Temporarily also accept a malformed string for null.

Bug: 38186355
Test: m
Test: manual OTA
Change-Id: I19d527d04b86596551f7bed54221c67be06c34c7
645e79cb279575b569bd308e7dfb09645e19d0dd 19-Apr-2017 Andreas Gampe <agampe@google.com> Otapreopt: Fix count

Don't count null for argc.

Bug: 37158297
Test: m
Test: OTA pre-versioned -> OTA versioned
Change-Id: I378b0b7b445f34c766460182d724d6abd84ff773
b39d2f093242fe03772b540c031e914e857b9dc2 18-Apr-2017 Andreas Gampe <agampe@google.com> Otapreopt: Add non-profile fallback

Slightly refactor compilation flow. Add a fallback option: if the
compilation fails and was profile-guided, attempt a non-profile-
guided compilation. This makes A/B OTA more robust to profile
format changes.

Bug: 37256688
Test: m
Test: manual OTA N -> O
Change-Id: I20c4b44a87c0f7faa8920abdae01e39379405eca
c4ced4f015ef5ba66cc89440c89369190448a4e0 15-Apr-2017 Andreas Gampe <agampe@google.com> OtaPreopt: Add version support

Add versioning to otapreopt:

Give up on having otapreopt being a mostly-ignorant frontend to a
blackbox dexopt function. Remove the dexopt helper taking a char*[], and
replace with a direct call to the typed signature.

Add support for a versioned dexopt command. The current version is
"2." An unversioned command string is either version "1" (N) or
version "2" (O pre-versioning).

Translate version 1 to version 2 by
* filter DEXOPT_OTA
* override dexopt_needed to DEX2OAT_FROM_SCRATCH
* add null se_info

Bug: 37256688
Test: m
Test: Manual OTA N (v1) -> O (v2)
Test: Manual OTA O (pre-versioning) -> O (v2)
Test: Manual OTA O (v2) -> O (v2)
Change-Id: I9fff673f3ba99833e88cf1c5c9625f42436ec150
54e1a402610d7f392f7e421dcafcf6b017a99d88 21-Mar-2017 Andreas Gampe <agampe@google.com> Otapreopt: Check dexopt return status before retry

Only retry compilation (triggering a wipe and boot image regeneration)
when dex2oat failed in runtime creation.

(cherry picked from commit 2c925927ee7524086965be324e614c9041126085)

Bug: 36336122
Test: m
Test: Device boots
Test: Can install apps
Test: Can run A/B OTA
Change-Id: I1a2ae3a871a926002980acd8b7fa777fe8f7d739
013f02e58b0b17b5b9fb4b4a2b3dc482eecfc434 21-Mar-2017 Andreas Gampe <agampe@google.com> Installd: Clean up installd

Remove unnecessary includes.

Bug: 36336122
Test: m
Test: Device boots
Test: Can install apps
Change-Id: Iebbe049221d650667385efeac972956269bd53c2
7823e124e00576e20e47ec717cbe8bc89f0f2bf2 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if possible
- add system includes that are assumed as side effects
- define LOG_TAG first

Test: compile
Bug: 31289077
Bug: 30465923
Change-Id: I8d99b24c333578c9b5aa9f2a01324bd0bba268dd
a5e161b1207ef447a51e99856097d69d4a6111e1 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> Replace cutils/log.h and rationalize log/log.h and android/log.h

- cutils/log.h treat as deprecated and lead by example
- android/log.h to be used instead of log/log.h if required
- add system includes that are assumed as side effects of log.h
- modules that use SLOG should use SLOG for all logging (installd)
- define LOG_TAG first
- remove logging infrastructure if not used

Test: build
Bug: 31289077
Change-Id: Iea147a0104c7ab7f12451304131d6500f42141e7
f3e30b936ef103dc0f3d8697e0f86ba82b49609e 10-Dec-2016 Jeff Sharkey <jsharkey@android.com> Filename refactoring, remove DEXOPT_OTA flag.

Test: builds, boots
Bug: 13758960, 30944031
Change-Id: Ib60899fc70b12f76fad9dfad596b513777752703
6c2c056193010cf93b4264810d462c120ce801c8 07-Dec-2016 Jeff Sharkey <jsharkey@android.com> Final push of installd to Binder; goodbye socket!

Move last two straggling installd commands to Binder and destroy the
socket-based communication channel forever.

Test: builds, boots, apps install fine, pre-OTA dexopt works
Bug: 13758960, 30944031
Change-Id: I2ecd604fb6627b9028a7e32f87d0367e4a4afde3
ad95fc06aa902ee7b96c09bb07af4061f87fe77f 07-Sep-2016 David Brazdil <dbrazdil@google.com> Merge "installd: Simplify Dalvik cache path creation"
fd12edaeab839f3f1f087cc75bd18b4d8af5b192 12-Jul-2016 Andreas Gampe <agampe@google.com> Otapreopt: Try to mount vendor partition for A/B OTA

Vendor apps are usually not preopted, so A/B dexopt should pick
them up. update_engine is not mounting the vendor partition, so
let otapreopt_chroot do the work.

Bug: 25612095
Bug: 29498238
Change-Id: I5a77bdb78a8e478ce10f6c1d0f911a8d6686becb
(cherry picked from commit 0ba073ce81fbe544592e0a3cd526b274e83fdf9f)
d089ca1703769854356a263ca640d3e07ab8548d 27-Jun-2016 Andreas Gampe <agampe@google.com> Otapreopt: Implement new A/B OTA path

Refactor otapreopt_script, otapreopt_chroot and otapreopt such
that the actual work will be done as a child of the script driven
by update_engine.

The script now uses the new OtaDexoptService command to get the
right parameters for a dexopt call in otapreopt. As we reach
otapreopt_chroot and otapreopt directly, we can add parameters
without tainting the regular installd path. Use this to add the
target slot suffix, and make naming of the A/B artifacts include
the suffix instead of the generic "b."

Otapreopt_chroot startup is slightly complicated because all file
descriptors must be closed. Otherwise, dex2oat needs selinux
permissions to inherit the descriptors from update_engine.

Bug: 25612095
Bug: 28069686
Change-Id: I9d7b86ac8ecfdf91af3800f7e96f41534c0afc0f
(cherry picked from commit 0354bd0eaf24de533e86885b811f816f1e4d15c8)
56f79f96207c9c0101a5ca0237a8da631d93d5c5 09-Jun-2016 Andreas Gampe <agampe@google.com> Otapreopt: Filter preopted system apps

The tool will receive requests to compile preopted system apps, as
we can't detect changes right now and need to be conservative. As
some apps cannot be stripped (signed before being preopted), they
can be re-compiled on device, producing stale files that won't be
cleaned up.

Add code to detect this situation and avoid a compile.

Bug: 25612095
Change-Id: I5f489e61b8d4e5b619cbaa01f6c59880479a46cd
(cherry picked from commit 1409090c0a92751f9fe7406a6e043cdbce2ebe4d)
89b008dfb59ac827db00a45e7de1bac1c65b9c93 04-Jun-2016 Andreas Gampe <agampe@google.com> Installd: Change app image name computation

Refactor computation to take A/B OTAs into account.

Fix a const issue.

Bug: 25612095
Change-Id: I5cf79def532d1eeec4b35bb80014376959083a83
(cherry picked from commit d01a02ce6980de0024333b4673cff9a77be629cf)
6db8db9f3369c48de87f97f4d4636d446837fe32 03-Jun-2016 Andreas Gampe <agampe@google.com> Installd: Remove string-helpers

Replace string-helpers with equivalent functions from android::base.

Bug: 25612095
Change-Id: I186461b94dffe3590c16455d4dee0c2cbe921bf4
(cherry picked from commit 4769ccafd6e6b94ab73afcb755fe59764c228eae)
548bdb930895d8fe6651eaada0bc5739ee5248c8 03-Jun-2016 Andreas Gampe <agampe@google.com> Otapreopt: Fix after shared-library work

Commit b63d91fd2737680351876406277b6c759f4db33c broke the installd
to otapreopt connection. Fix this. Also refactor a bit to make an
inadvertant break harder.

Bug: 25612095
Change-Id: I8e7b944ecbd5457e4ac4d6ffffdb0468618cf65f
(cherry picked from commit aef445d1c659698612c0e5a8f3d5f2b9f8a2b778)
249c1796a2e62f8751348e5bafce9f40e6538cba 06-Sep-2016 David Brazdil <dbrazdil@google.com> installd: Simplify Dalvik cache path creation

Installd computes Dalvik cache path for a dex file by concatenating
'/classes.dex' to the APKs absolute path and then replacing all '/'
characters with '@'. OTA preopt does the same, only in reverse order,
i.e by concatenating '@classes.dex' to altered absolute path.

This patch unifies the two approaches so as to keep only one string

Change-Id: I69bb6bca831f45c873a0eb8580cf8d4b011f3b09
9c8f93a2a6ed6a764de7a617fe7a01657d0f4479 04-Jun-2016 Dan Austin <danielaustin@google.com> fixing const/non-const issues in preparation for libcxx rebase

Change-Id: I8528edd3af4a801f29c17f1f54c44be1a1a0b563
b63d91fd2737680351876406277b6c759f4db33c 16-Mar-2016 Jeff Hao <jeffhao@google.com> Support to pass <uses-library> option through to dex2oat.

This change takes an app's shared libraries specified by <uses-library>
and passes it through to dex2oat to be used during compilation.

Part of a multi-project change.

Includes fix from c09662d9bbd35840b24cae8d336a0d11c0cbdb7b

Bug: 26880306

(cherry-picked from commmit de7f0cf8a699f6f7a7d29b4a14d800bea9abbef4)

Change-Id: Ideb2aba46f4cf52acb9dd480993513a60dbfd6ce
4d0f825dd76a1972a3d081e771cde28513a1c6ff 20-Mar-2016 Andreas Gampe <agampe@google.com> Installd: Separate profile merging and compilation

Create a new merge_profiles command to check and merge profiles.

(Almost) always pass a profile to a dexopt pass.

Require compilation filter input to dexopt and use it for dex2oat
(except for hard overrides like safe-mode).

Bug: 27689078
Change-Id: I1257857cc15c17e2271d1261ea4cc80752270fcb
1842af3a4a8fccf71f5c569071518de14b3698ac 16-Mar-2016 Andreas Gampe <agampe@google.com> Otapreopt: Load properties from files

Refactor file parsing into a helper.

Load system properties, completely, from the right sources. Add code
to parse init.environ.rc for environment variables.

Bug: 25612095
Change-Id: I3e5b2ff620ccb374c775ed1922baa0d9b8ed5974
9fb85b0667235ebfdea00ea345febc8f6eb203d2 16-Mar-2016 Andreas Gampe <agampe@google.com> Otapreopt: Remove b_mount_path

The final chosen design runs the tool in a chroot, no B mount path

Bug: 25612095
Change-Id: Iba920455799da1aff97f759afc784ce43c4bf0b1
febf0bf33ca81edcdaab3625e2711fa58b398cc5 01-Mar-2016 Andreas Gampe <agampe@google.com> Otapreopt: Fix patchoat delta parameter

Only give the delta, not the new base address.

Bug: 25612095
Change-Id: Ieeed5000da5e72477764fc92fe8fa016287d4cd8
5709b5758d75085aeab121db94e8d6dbafe0b7ae 13-Feb-2016 Andreas Gampe <agampe@google.com> Otapreopt: Add path for patching boot image

Add a path to use a preopted boot image during A/B OTA. This uses
a hard-coded check for the default preopted boot.art location.

Bug: 25612095
Change-Id: Ia6b954d5aca6b3455ac9feacdf9739fd964417e8
73dae11162aa61396c06cbdb05b954764e944e02 19-Nov-2015 Andreas Gampe <agampe@google.com> Installd: Introduce otapreopt

Add a tool for dexopt during OTA. The tool will use /data/ota as
an ANDROID_ROOT wrt/ the dalvik-cache, compiling a new boot image
and system apps into this directory. Other apps will be compiled
to odex files suffixed with ".b".

Bug: 25612095
Change-Id: I6ac382973f13850f6b37402a1b2330c0014b47d9