Commit Graph

149 Commits

Author SHA1 Message Date
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
Robin Lee
664a72d3ac am 91c395f6: am 60fd3fee: Migrate CA certificates to all users
* commit '91c395f6c344682f1ae5926766d4d7247dee6df4':
  Migrate CA certificates to all users
2014-10-15 23:57:04 +00:00
Robin Lee
0adea3b792 am 60fd3fee: Migrate CA certificates to all users
* commit '60fd3feecab4336d964ca8e31c7c3220e1afb558':
  Migrate CA certificates to all users
2014-10-15 19:26:36 +00:00
Robin Lee
60fd3feeca Migrate CA certificates to all users
Copies the /data/misc/keychain/cacert-* directories to all users on
the device, whereas previously they were simply copied to user 0.

This is a shallow copy so anything that wasn't supposed to be there
will disappear.

Bug: 17811821
Change-Id: Iae5909ab8d5efdb83c9c8fdf0e10ab7060d022cc
2014-10-15 19:04:33 +00:00
Narayan Kamath
7f8ecd6dba am cde4b13a: Merge "Allow more than one dex2oat extra option"
* commit 'cde4b13a12a0bc8a7bd031f5d5c1b2b2bdd13335':
  Allow more than one dex2oat extra option
2014-10-01 11:18:25 +00:00
Narayan Kamath
28da32889b am cde4b13a: Merge "Allow more than one dex2oat extra option"
* commit 'cde4b13a12a0bc8a7bd031f5d5c1b2b2bdd13335':
  Allow more than one dex2oat extra option
2014-10-01 11:15:12 +00:00
Yevgeny Rouban
b0d8d00b29 Allow more than one dex2oat extra option
All extra options are provided as one argument to dex2oat.
The patch splits all options to individual ones.

Change-Id: Ied65bb9cf38b114611e88a8d5d86305021700d0b
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
2014-09-17 10:58:35 +00:00
Dan Albert
4355c0c986 am e1e3d278: Merge "Clean cruft out of makefiles."
* commit 'e1e3d278549eb6389eb0b5fa3f13a4ac079a55a2':
  Clean cruft out of makefiles.
2014-09-12 16:22:03 +00:00
Dan Albert
9e8b528926 resolved conflicts for merge of 07c9557f to lmp-dev-plus-aosp
Change-Id: Ic212ab2ee90b1cc7db7203210b047c870bb5c476
2014-09-12 09:00:50 -07:00
Dan Albert
b79dfe6721 Clean cruft out of makefiles.
Cleans up manual uses of stlport and bionic (and removes uses of private
bionic headers).

Change-Id: I157309d702e59152adfa3450939082248ae4c043
2014-09-11 18:49:47 -07:00