Commit Graph

158 Commits

Author SHA1 Message Date
Andreas Gampe
72ebebed87 Installd: Take boot status as dexopt parameter
Expect the boot status explicitly as a parameter so that we do not
have to rely on dev.bootcomplete, which isn't meaningfully set
when the device needs the decryption screen on boot.

Bug: 23898216
Change-Id: I9b34298caf70b1e5d40970cc0d04c469016a80a7
2015-09-21 13:21:30 -07:00
Andreas Gampe
21948005f0 Installd: Allow different behavior before bootcomplete
Check dev.bootcomplete in dex2oat(). Use the information for
two changes.

Only switch to the background when we're post bootcomplete.
This will ensure better utilization after upgrades.

Add a second dex2oat-threads property that is used pre
bootcomplete. A separation of these phases allows using less
cores when the device is up, freeing up resources for other
purposes, e.g., avoid jank. The precedence during boot is the
boot property, or the image property if the former doesn't
exist, or the default property as a fallback.

Bug: 23898216
Bug: 24004256
Change-Id: I5063f3fc4b437cbe88c4e94584e01c1c78eccc4d
2015-09-16 15:10:55 -07:00
Jeff Sharkey
a2307aefd0 Only restorecon_data once for all users.
restorecon_data already iterates across all found users internally,
so we don't need to call it for each UID moved.  In fact, this was a
bug that caused data for the owner to be relabeled when moving apps
back to internal storage.

Bug: 21813384
Change-Id: I5ba76d4f30d129365864c8a25b665f344b99a6b4
2015-07-20 16:26:22 -07:00
Andreas Gampe
c968c0175e Installd: Add a swap override flag
Add dalvik.vm.dex2oat-swap system property to override a default
decision.

Bug: 20658562
Change-Id: I34368c6e435d1a9ceec20a0bf1c8c6213e527f5e
2015-07-16 15:55:41 -07:00
Jeff Sharkey
31f08986f8 Split app move into separate copy/delete steps.
App movement now has three distinct stages: copying, scanning, and
cleanup.  Previously, a battery pull late in the move process would
end up with packages.xml pointing at the old location which had been
torn down.  Now, we update packages.xml to point at the new location
as the "source of truth" before we start deleting the old location.

Bug: 21831336
Change-Id: I62b8916c673265c240e2574ea968cdce5a7a0074
2015-07-07 13:31:53 -07:00
Daichi Hirono
a2ccb9e43d Fix directory path of codecache.
Previously installd removed the normal cache directory when delete_code_cache is
called. It should delete the code cache directory.

BUG=21206499

Change-Id: I5774430e389e22805fa7984b4c83420c3677ca75
2015-06-24 15:57:06 +09:00
David Srbecky
528c8ddc60 Rename --include-cfi to --generate-debug-info.
This follows a change in dex2oat.

(cherry picked from commit 741a6ff2e2)

Bug: 21924613
Change-Id: I6b2df1668fdd09d82cfe86e6e51360b954b6c8a9
2015-06-19 02:32:41 +01:00
Andreas Gampe
3822b8b79c Installd: Add debug.gencfi to run_dex2oat
Add the debug.gencfi system property that forces generation of
CFI data.

(cherry picked from commit 816243d470)

Bug: 21924613
Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369
2015-06-19 02:31:33 +01:00
Narayan Kamath
d845c96128 Add an installd command to link files
Given a pair of absolute paths {from_path, to_path} , check that
they are both valid apk subpaths (eg. /data/app/package/foo) and
link(2) to_path to from_path. This is required by staged installs,
where we link existing apks and oat files to their staging location.

bug: 20889739
Change-Id: I3b5e3b43677af68be59308121a4409caaa6a72f0
2015-06-09 11:35:43 +01:00
Jeff Sharkey
d792118c49 Offer to move both code and data together.
We now move code under /data/app/com.example when a complete move
is requested.  This really only works for new cluster-style installs
that also have native libraries and OAT contained inside.

Teach measuring code about cluster-style installs when measuring
app footprint.  Also offer to measure private data space for all
users.

Bug: 19993667, 20275578
Change-Id: I6df7b947cb5cc8a4552f56f4b64a661e8512389f
2015-04-30 16:02:58 -07:00
Jeff Sharkey
e363724230 Command to move private app data between volumes.
New "mvuserdata" command will move all private app data from one
volume UUID to another.  It leverages the existing "cp" toybox
command to do the heavy lifting for all known users, preserving
details like timestamps and permissions.  It invokes restorecon()
to correctly label the new location when the copy is finished.

Changes installd to no longer drop capabilities, so we run as root
again.  This also allows us to exec "cp" with CAP_DAC_OVERRIDE and
CAP_FOWNER still in effect.

Bug: 19993667
Change-Id: I1f407a7c4a1af97ca5afc27b04eb16b4936cbdef
2015-04-10 00:21:35 -07:00
Jeff Sharkey
6fe28a0601 Start accepting volume UUIDs from framework.
We're now parsing and passing through volume UUIDs sent across the
command socket.  The "!" argument value is treated as null, which
means internal storage.

Bug: 19993667
Change-Id: I17729a769ce687a2e94e85991a6338c77ded0b66
2015-04-09 14:15:55 -07:00
Jeff Sharkey
41ea424413 More volume UUID awareness.
Teach free_cache() and restorecon_data() about building per-volume
paths.  Also clean up restorecon_data() by using std::string when
building paths.

Clearer names for path building utility methods, and tests to verify.

Bug: 19993667
Change-Id: Iacfbcdaa5b901cc2490bc8eba366dfdeb44f1d93
2015-04-09 11:44:06 -07:00
Andreas Gampe
0ad7a11003 Installd: Fix Clang build
Remove some unused parameters and variables.

Change-Id: I507ae48fe1744b800ceb29192d463fd26c2ccda7
2015-04-09 09:54:35 -07:00
Jeff Sharkey
d107c305f7 Merge "Plumb through volume UUID when building paths." 2015-04-09 16:27:19 +00:00
Jeff Sharkey
c03de09173 Plumb through volume UUID when building paths.
Since app data paths can live on expanded storage devices, accept the
target volume UUID when building paths.  The null UUID indicates the
default internal storage.

To improve readability, start using std::string in several places,
which throws when allocations fail.  For now, perform last-second
sanity checks on incoming path arguments, but we'll eventually want
to check arguments as they come through installd.cpp, instead of
crashing the entire daemon.

Also remove "lib" symlink code from install() and make_user_data(),
since we're no longer supporting /data/app-lib.  The framework
already uses linklib() to create the right symlink for the selected
ISA-specific library dir.

Bug: 19993667
Change-Id: Ib9343575ffb62bf3981e19375de8f3822fc31e28
2015-04-07 20:13:27 -07:00
Richard Uhler
c92fb6247d installd: Add support for SELF_PATCHOAT_NEEDED.
Change-Id: Ib9a6373f98474f1242367b5285086251a9d580e5
2015-04-07 16:39:29 -07:00
Jeff Sharkey
19803807cd Switch installd to compile as C++.
This is the minimal change needed to switch it over to C++, which
paves the way for using more robust utilities like std::string.

Change-Id: I80ed6280146875eb6ddbbb340c05450388ca13f0
2015-04-07 14:01:43 -07:00
Jeff Sharkey
e23a13299a Valid APK paths now include expanded storage.
Apps on expanded storage live at /mnt/expand/<uuid>/app/com.example,
so we need to relax one more directory level.

Bug: 19993667
Change-Id: I347ec7b92435ea69e632ed5d5fdfabe38ce0b56e
2015-04-07 14:01:12 -07:00
Fyodor Kupolov
8eed7e6a9b Use AID_SYSTEM as uid when creating oat dir
Previously AID_INSTALL was used, which was causing permission denied errors
when PackageManager was trying to recursively rename staging directory

Bug: 19550105
Bug: 20087446
Change-Id: I3a9e3056c1fbc1ce0077a3ce52cf77ea6b5085ee
2015-04-07 11:22:00 -07:00
Fyodor Kupolov
26ff93c1a7 Fix errors caused by unused variables
Change-Id: Ie52ae0e9a642504ee7b78c6bc54b61549cfb0342
2015-04-02 17:03:11 -07:00
Fyodor Kupolov
4eb88f8839 Merge "Support for storing OAT files in app directory" 2015-04-02 23:11:01 +00:00
Andreas Gampe
8d7af8b241 Installd: Support dex2oat threads system property
Check dalvik.vm.dex2oat-threads in installd and pass to dex2oat.

Bug: 19992386
Change-Id: I5e7806cf560607d31a1d6901dffb14bee538c9cc
2015-03-30 18:45:03 -07:00
Fyodor Kupolov
88ce4ff7a9 Support for storing OAT files in app directory
Changes to installd:
- dexopt now allows oat_dir param for custom output directory
- Added helper method calculate_oat_file_path for calculating oat file
  output location based on oat_dir and apk_path.

Bug: 19550105
Change-Id: I6b079207310583adeb6dad918a58034a059e34c4
2015-03-30 13:48:22 -07:00
Richard Uhler
009b877132 Store odex files in oat/<isa>/ directory.
Previously odex files were stored alongside the dex location as:
  dex location: /foo/bar/base.apk
  odex location: /foo/bar/<isa>/base.odex

This changes where odex files are stored, adding an "oat" directory:
  dex location: /foo/bar/base.apk
  odex location: /foo/bar/oat/<isa>/base.odex

See also the corresponding changes in platform/art and platform/build.

Bug: 19550105
Change-Id: I4c6be4f0c41ff175904846db8e360c4af815b265
2015-03-25 11:11:05 -07:00
Mathieu Chartier
d4a7b459f4 Use verify-at-runtime if debug.usejit is true
Bug: 19735273
Change-Id: Ib65b50dbde00184544a1341f351a0fe0ef504d32
2015-03-20 16:05:18 -07:00
Andreas Gampe
1fc747d20c am 5a25a63d: Merge "Installd: Pass debuggable flag"
* commit '5a25a63de2693177b15817fb19b684ca7bfec582':
  Installd: Pass debuggable flag
2015-03-10 02:10:06 +00:00
Andreas Gampe
598c25e23f Installd: Pass debuggable flag
Pass the debuggable flag from the package manager to dex2oat.

Change-Id: Id17ec72babe2ee88713a0d274eff86508de30666
2015-03-09 15:13:24 -07:00
Bill Yi
28d41f5640 Merge commit '26cc3d0b67ff4daf31eaeed0ecd87b391978aadb' into HEAD 2015-02-19 14:31:45 -08:00
Elliott Hughes
2ead70ce67 Add missing <sys/file.h> include for flock.
Change-Id: I5c9bb4aa74d8a36d44e086bbcb5d60876727ce4c
2015-02-16 10:44:22 -08:00
Andreas Gampe
ee7ed02077 am 96e4409e: Merge "Installd: Disallow relocation for decryption"
* commit '96e4409e8c38b1d79285eca9886d44ff850b5748':
  Installd: Disallow relocation for decryption
2015-01-07 22:12:26 +00:00
neo.chae
14e084d39a Installd: Disallow relocation for decryption
When decrypting a device, a tmpfs is temporarily mounted as /data,
the size of which is usually small. When the zygote, system server
and necessary apps are brought up, they will be compiled into the
tmpfs.

If the system image contains prebuilts, they will be relocated instead
of compiled. This is unnecessary. In this special situation it is
acceptable to run out of the prebuilt oat files without relocation,
which can save space in the tmpfs.

This patch ensures that apps are not being relocated.

Change-Id: I42bfb7e3039574b7e4f2772e0d395f093d59ed1b
Signed-off-by: Hyangseok Chae <neo.chae@lge.com>
2015-01-07 22:03:07 +00:00
Andreas Gampe
4fb9f9377e am d3255076: Merge "Installd: Swap file for dex2oat"
* commit 'd325507698d8379e431a8c8fefcfafe59956bd88':
  Installd: Swap file for dex2oat
2014-12-22 18:39:37 +00:00
Andreas Gampe
e1c01353c4 Installd: Swap file for dex2oat
Add swap file support for dex2oat to installd. Only use in low-memory
mode.

Bug: 18596910

(cherry picked from commit f68ce4de7f)

Change-Id: I131448f3907115054a592af73db86d2b9257ea33
2014-12-18 17:23:34 -08:00
Andreas Gampe
37321282ec am 1be4021c: Merge "Installd: Remove dalvik paths"
* commit '1be4021c2a867c7e067a3c5b937a054f0eb7817f':
  Installd: Remove dalvik paths
2014-12-16 20:34:31 +00:00
Andreas Gampe
bd872e4956 Installd: Remove dalvik paths
Dalvik is dead. Dexopt is dead.

Change-Id: I9ff6b638a3e2c52ae7aec33d7b08a7bee012854f
2014-12-15 11:41:11 -08:00
Bernhard Rosenkränzer
7fb390d10c Mark 2 unused paramters as such
Mark 2 unused paramters to prevent clang from erroring out

Change-Id: Ifc9b4a5b820bd6318e9259e737e708d25fdb174b
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2014-11-23 22:28:26 +01:00
Mike Lockwood
8b1a27740d am 754f16fc: Merge "Fix installd command line parser"
* commit '754f16fcf4b56f52450f91e3e840bad8a2cc997c':
  Fix installd command line parser
2014-11-21 05:10:57 +00:00
Mike Lockwood
754f16fcf4 Merge "Fix installd command line parser" 2014-11-21 05:02:51 +00:00
Elliott Hughes
8d84b6f9f5 am ba4a43c6: Merge "Kill INCLUDE_SYS_MOUNT_FOR_STATFS."
* commit 'ba4a43c6c78547444446181b4fae20a5d61d35ff':
  Kill INCLUDE_SYS_MOUNT_FOR_STATFS.
2014-11-20 23:00:26 +00:00
Elliott Hughes
ba4a43c6c7 Merge "Kill INCLUDE_SYS_MOUNT_FOR_STATFS." 2014-11-20 20:58:53 +00:00
Elliott Hughes
9a4e7f492e Kill INCLUDE_SYS_MOUNT_FOR_STATFS.
Change-Id: I692179cae9d476dd5a0b5fa92813b61934dd7c87
2014-11-20 12:54:21 -08:00
Narayan Kamath
091ea779d4 Add an installd command to mark the end of boot.
bug: 18280671

(cherry picked from commit b1a6c2f95a)

Change-Id: I97542875ffff1b68ab324e9b04fb9266c82633cc
2014-11-19 14:43:05 +00:00
Ian Rogers
35e5423d4d am 11bf9e5c: Merge "Add support for dalvik.vm.isa.<instruction set>.variant"
* commit '11bf9e5c2f90101d56d918e1b3fe780b873e5566':
  Add support for dalvik.vm.isa.<instruction set>.variant
2014-11-14 00:30:33 +00:00
Dmitriy Ivanov
741625a17e resolved conflicts for merge of 37878b1e to lmp-mr1-dev-plus-aosp
Change-Id: I748a7d2fb43fd63189f4688edbd0991e2b609dba
2014-11-11 16:08:29 -08:00
Narayan Kamath
b1a6c2f95a Add an installd command to mark the end of boot.
bug: 18280671

Change-Id: I6b3aeaf143ab3b78881f163ec5c17b9bf20172ed
2014-11-10 17:04:12 +00:00
Ian Rogers
16a95b267a Add support for dalvik.vm.isa.<instruction set>.variant
Bug: 18056890
Change-Id: Ia266fa9f2a79158ced82016106aa1cd2529259c9
2014-11-08 16:58:13 -08:00
Igor Murashkin
cd647d01e5 am 106e5820: Merge "installd: Set priority to background for dexopting" into lmp-mr1-dev
* commit '106e582053121f1934c33a6c98d35377e8ae384a':
  installd: Set priority to background for dexopting
2014-11-06 02:55:23 +00:00
Igor Murashkin
9e87a80140 installd: Set priority to background for dexopting
This fixes jank caused by dex2oat while installing an application in the
background.

Bug: 17497551
Change-Id: I5a69b00c0fd76ae22a0d1adb242bef6c18a75743
2014-11-05 15:21:12 -08:00
Serguei Katkov
62bb385728 Fix installd command line parser
Parser does not take into account that the last argument can be empty.
In this case it will skip end of line marker and continue parsing.

Change-Id: I2d029a69ed22cef497893e592ff3275ced97f85f
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
2014-11-05 13:39:43 +06:00