History log of /frameworks/native/cmds/installd/installd.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b1a6c2f95a455aa2829340fcc8d233493855f4d4 10-Nov-2014 Narayan Kamath <narayan@google.com> Add an installd command to mark the end of boot.

bug: 18280671

Change-Id: I6b3aeaf143ab3b78881f163ec5c17b9bf20172ed
/frameworks/native/cmds/installd/installd.c
60fd3feecab4336d964ca8e31c7c3220e1afb558 07-Oct-2014 Robin Lee <rgl@google.com> 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
/frameworks/native/cmds/installd/installd.c
770180a4dd86f8bda6af2e6db4676e99a5bb1548 09-Sep-2014 Jeff Sharkey <jsharkey@android.com> Add new system APK locations.

Add /system/priv-app and /oem/app paths to system paths. Also allow
rmdex on system apps, and quietly ignore when it was already removed.

Also relax logging when clearing code cache, since it's optional.

Bug: 17205122
Change-Id: I4fc4d0f63a3596937c4defbd64e1f8a1c563f02d
/frameworks/native/cmds/installd/installd.c
8b17ac6bd6b5114babac619cad3ff03fbf10a953 29-Aug-2014 Alex Light <allight@google.com> Remove obsolete prunedexcache

Bug: 16875245

(cherry picked from commit 5f727f86942a188354c028356f1167794fdc8655)

Change-Id: I06e14c405aa4af295795982c1d236be3cb00e893
/frameworks/native/cmds/installd/installd.c
b1efac103523efccbe671e76cc0eaaeab810415b 21-Aug-2014 Calin Juravle <calin@google.com> Add vm_safe_mode to dexopt.

The flag enforces interpret-only flag for dex2oat.

Bug: 12457423
Change-Id: Ifdafcc1afa32996577fa44c5682eeb58c79772ac
/frameworks/native/cmds/installd/installd.c
43c5d30795faf08ab639b8d88c2eceaf2b648c93 21-Jul-2014 Alex Light <allight@google.com> Make system use patchoat to relocate during runtime.

Make installd understand a patchoat directive and carry it out.

Bug: 15358152

(cherry picked from commit 7365a10689df23334d245b211ce272502ad20669)

Change-Id: Id84a15e626ddde63876914068d3d9aa037abc65b
/frameworks/native/cmds/installd/installd.c
119b765a053f650b4b47256245ce836f8c403d7f 19-Jul-2014 Elliott Hughes <enh@google.com> Fix implicit declaration of function 'prctl' in installd.

(cherry picked from commit ec535c5ba515f58791aa5044ba116d35a10a188e)

Change-Id: I3da977d85ce544b23ff00934fdbd201d683e9210
/frameworks/native/cmds/installd/installd.c
c796b681e52fbb792da9a5b4f30e935cc927c1d7 16-Jul-2014 Jeff Sharkey <jsharkey@android.com> Offer to delete code cache directories.

Bug: 16187224
Change-Id: Ia860b051a34ffdfb4f6e0ea19f90cb73509c4eee
/frameworks/native/cmds/installd/installd.c
7c5be65f2819bf0328715bc405483788dd7a81f2 09-Jul-2014 Robin Lee <rgl@google.com> Merge "Rename 'mkuser' command to 'mkuserconfig'"
1e57e4af8afb5a3b8b657e1c9ca3f9810e266083 17-Jun-2014 Narayan Kamath <narayan@google.com> Exclude subdirectories when pruning the dex cache.

This requires a companion package manager change to prune
each instruction specific dex cache individually.

bug: 15677279

Change-Id: I5891981512bde20e49bff65b1842c28886f2b177
/frameworks/native/cmds/installd/installd.c
8c9bcff892ae30897a971c3b97305e70db5b5bd3 16-Jun-2014 Narayan Kamath <narayan@google.com> Merge "Add an installd command to prune dex files."
7c8bec01790087748ec7afa69a31789828b751f9 10-Jun-2014 Robin Lee <rgl@google.com> Rename 'mkuser' command to 'mkuserconfig'

Brings the name more in line with what it actually does.

Change-Id: I0adb14deb1a035abdbe51714356bd0c94ccf04c5
/frameworks/native/cmds/installd/installd.c
3aee2c5c749dc2589f001b26fae1ec958ec89524 10-Jun-2014 Narayan Kamath <narayan@google.com> Add an installd command to prune dex files.

This is a straightforward port of logic from
PackageManagerService#pruneDexFiles.

bug: 14407732

Change-Id: I892cff027ddcbb1a4fb37a7af5ecf1697049a188
/frameworks/native/cmds/installd/installd.c
07053fcb61436221fac2281394e98ec9d0feab3d 29-Apr-2014 Robin Lee <rgl@google.com> Migrate keychain directories to /data/misc/user/0

With new CA certificates being stored in /data/misc/user/<userid>/
existing ones need to be moved into the same place.

After this update only the owner user will have custom trusted CAs; all
other users will revert to the default set.

Change-Id: I14a4cd6048685902ad5dd3b53494b03fadc41c04
/frameworks/native/cmds/installd/installd.c
095c763dd9aa26a206d10ab7c1d7e1c569298fb3 25-Apr-2014 Robin Lee <rgl@google.com> Add installd command to create /data/misc user dir

New command 'mkuser <id>' sets up a user directory in /data/misc/user/,
readable by all apps within that user and writeable by the local system
process.

Change-Id: I5ddde8c4a80f606e723bb41aa64581a0720842d5
/frameworks/native/cmds/installd/installd.c
1b4003207750ea8fe8c7b03eb32d80f1df83979e 11-Apr-2014 Narayan Kamath <narayan@google.com> Add instruction-set arguments to installd commands.

The instruction-set is used to construct the dalvik cache
path and is also passed down to dex2oat.

(cherry picked from commit 791781bfb8cdcdf90e32968159603e2fe5098d94)

Change-Id: I43396b16f6eaecacf0fb7d052526fc5a239167ac
/frameworks/native/cmds/installd/installd.c
da30dc7336f03ca629fe173db1425fdce989119c 27-Mar-2014 Robert Craig <rpcraig@tycho.ncsc.mil> Modify installd's restorecon function.

Changes above with PMS and below with libselinux
have resulted in a few changes to the restorecon data
api. This change is needed in order to support the new
way to issue a recursive restorecon of certain
/data/data directories.

The restorecondata function has also been modified to
find all users on the device for a given package name
(argument to the function) and to issue a separate
recursive restorecon call for each.

Change-Id: Ie440cba2c96f0907458086348197e1506d31c1b6
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
/frameworks/native/cmds/installd/installd.c
7abb52bcafa2f7b422dfe22c5ea275c2fa9e6201 26-Mar-2014 Stephen Smalley <sds@tycho.nsa.gov> Send libselinux logging to logcat.

Otherwise we can't readily see log messages from libselinux calls
made by installd.

Change-Id: I319b30c181470468fe19dd5fbe9251ef03f1163b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/frameworks/native/cmds/installd/installd.c
e9887e46cea4a095e4219927eadbe4c57bb1a5ee 20-Feb-2014 Robert Craig <rpcraig@tycho.ncsc.mil> Extend installd to support SELinux restorecon function.

Implement new restorecondata function which will allow
the relabeling of /data/data and /data/user directories.
This is needed in the case of certain OTAs. Not every
boot will apply this relabeling however. Consult change
I77bf2a0c4c34b1feef6fdf4d6c3bd92dbf32f4a1 for
clarification on this issue.

Change-Id: I05e8b438950ddb908e46c9168ea6ee601e6d674f
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
/frameworks/native/cmds/installd/installd.c
d93707342a61e66bc3eb2145628158452f577f42 30-Jan-2014 Dave Allison <dallison@google.com> ART profiler

Add args to the installd commands for profiler usage.
Make installd create the profile files and allow apps
to write to them.

The profile files are in /data/dalvik-cache/profiles. This
central location is needed due to permissions issues with
dex2oat reading from an app's data directory. The solution
is to put the profile file in a directory owned by the
install user and make the file writeable by the shared group
id of for the app. The app can read and write to these files
only in the profiles directory. The 'system' user also needs
to be able to read the files in order to determine the amount
of change to the file over time.

Bug: 12877748
Change-Id: I9b8e59e3bd7df8a1bf60fa7ffd376a24ba0eb42f

Conflicts:
cmds/installd/commands.c
/frameworks/native/cmds/installd/installd.c
2044ac43e53b517526b3c70dc4fbc60ffc01693f 13-Feb-2014 Nick Kralevich <nnk@google.com> Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."
26288202e7bdf2e897a11bf31a15685d7c20945f 07-Feb-2014 Stephen Smalley <sds@tycho.nsa.gov> Convert all selinux_android_restorecon and _setfilecon calls to new API.

libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.

Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.

Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/frameworks/native/cmds/installd/installd.c
63568b1430d741f40ca008391c854ef1cc880138 31-Jan-2014 MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> Runtime resource overlay, iteration 2

Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

<overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
Initial AssetManager object created
+ idmap --scan creates idmaps for overlays targeting 'android', \
stores list of overlays in /data/resource-cache/overlays.list
AssetManager caches framework-res.apk
+ AssetManager caches overlay packages listed in overlays.list

Android boot
New AssetManager's ResTable acquired
AssetManager re-uses cached framework-res.apk
+ AssetManager re-uses cached 'android' overlays (if any)

App boot
ActivityThread prepares AssetManager to load app.apk
+ ActivityThread prepares AssetManager to load app overlays (if any)
New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

<overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

+------+------+- -+------+------+
| 0x01 | | ... | | 0x7f |
+------+------+- -+------+------+
| |
"android" Target package A
|
Pre-installed overlay B (priority 1)
|
Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e
/frameworks/native/cmds/installd/installd.c
47a351834f202386b01a27d42ec41ceb1f17b754 17-Dec-2013 Stephen Smalley <sds@tycho.nsa.gov> restorecon /data/media when re-creating it for multi-user upgrade.

Change-Id: I112c61863f2104d1962697c54cff25106e9b48a0
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/frameworks/native/cmds/installd/installd.c
bef08b8d1b30976ff273fc9041bc8d934f52fea9 27-Nov-2013 Nick Kralevich <nnk@google.com> Merge "Handle policy reloads within installd rather than restarting it."
e4e91c4ead821afb5aced2e33ee39d8878eb4d1e 20-Sep-2013 Nick Kralevich <nnk@google.com> resolved conflicts for merge of e678897f to klp-dev-plus-aosp

Change-Id: Ie2a5e7a917ab7f5a0ee98300b880d22c7a10bf70
880d1a957ebcb63fb9d3724e2f91c58b7ff0cd54 29-Jul-2013 Robert Craig <rpcraig@tycho.ncsc.mil> Proper security labeling of multi-user data directories.

Add seinfo paramater to appropriate make directory
functions. This allows proper labeling for multi-user
scenarios.

Change-Id: Iaba7c40645bc7b6cc823d613da0c3782acf6ddd5
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
/frameworks/native/cmds/installd/installd.c
bd558d61871218f5b13df2fe4b7cc3b530ee947c 16-Apr-2013 Stephen Smalley <sds@tycho.nsa.gov> Handle policy reloads within installd rather than restarting it.

Restarting installd upon policy reloads has reportedly caused
stability problems for some users. Stop restarting installd
and instead handle policy reloads within it.

Change-Id: I697a736d8e414cfc6cfa131ed7b97c7f7694d022
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/frameworks/native/cmds/installd/installd.c
abe4fe5b46157ecd2a52d28abf938c816c3ce878 11-Jul-2013 Jeff Sharkey <jsharkey@android.com> Change legacy "persona" references to userid_t.

Offers stronger typing with no functional change.

Change-Id: I09f0262470feec5cfdf26658f998c20550af84d4
/frameworks/native/cmds/installd/installd.c
1705fc44fb85c4232637f9f7189c3bdca98a63d5 22-Mar-2013 Brian Carlstrom <bdc@google.com> Moving dex2oat installd patches from frameworks/base

(cherry picked from commit 3fa3a652ba9a7c5b23b6f2bc7c1851d4e23e430f)

Change-Id: I2f9bb66e1b0463bef41805f2d220160880121813
/frameworks/native/cmds/installd/installd.c
8b41780d73930b37b6254cc1dac5607c843839c0 02-May-2013 Dianne Hackborn <hackbod@google.com> Fix issue #8768456: Settings > App Info under reports...

...app storage size for apps w/ .so files

The lib directories are tagged with the apk install number,
so must be explicitly passed down to installd.

Change-Id: Iae8815afd6ba964f5b2ed86a0d04a91827391ed6
/frameworks/native/cmds/installd/installd.c
4d3fd4e9988c0eb284dd5104c4dea757f723c716 25-Mar-2013 Robert Craig <rpcraig@tycho.ncsc.mil> Add seinfo parsing to PackageManagerService.

This patch set allows the PMS to parse the
mac_permissions.xml file which contains the
seinfo values. Each package that is installed
on the device will be assigned an seinfo value
based on policy. This seinfo value will help label
the app process and data directory. Modifications
include adjustments to ApplicationInfo.java
to store the seinfo tag per package as well as
adjustments to installd to communicate the seinfo
tag to libselinux.

Change-Id: I61ad1ea12fb6a9a6d0b108ec163bc4bf4c954b58
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
/frameworks/native/cmds/installd/installd.c
d747129e1e8876f5a50f47156ec50b6969a638e4 01-Mar-2013 Nick Kralevich <nnk@google.com> installd: use correct header file.

This is a port of https://android-review.googlesource.com/52540 ,
which doesn't apply cleanly to master.

Change-Id: I2824bb7afd4e343b5dc8bed9f24002ec1dcbf07f
/frameworks/native/cmds/installd/installd.c
a2d838a542c34d2887a0ec1fafa5f47566d595e9 10-Jan-2013 Nick Kralevich <nnk@google.com> Revert "App home directories are now 0700 for targetSdkVersion > 17"

This reverts commit 7f5c84a0b25706746a92ad1233cbbb8923eda54d.

Bug: 7966399
Bug: 7208882
Change-Id: I9fb13cf06c0f6605f3d992525346b14fe3259c66
/frameworks/native/cmds/installd/installd.c
7f5c84a0b25706746a92ad1233cbbb8923eda54d 13-Dec-2012 Nick Kralevich <nnk@google.com> App home directories are now 0700 for targetSdkVersion > 17

Have installd set an app's home directory permissions to
0700 if the app has targetSdkVersion > 17.

Bug: 7208882
Change-Id: Iaa4fc42fec69bc1abdfae53704d6264dd6fa965f
/frameworks/native/cmds/installd/installd.c
f62d2851a83f6976e22932e09c35013a6bb0c3f3 12-Dec-2012 Nick Kralevich <nnk@google.com> remove unused code.

Change-Id: Iacc8b2664a0e404dfa554f223a44126c41581ae4
/frameworks/native/cmds/installd/installd.c
94afecf4b6f437b3ee9a076242402e421c6c07a6 24-Oct-2012 Mike Lockwood <lockwood@google.com> Move non-Java commands over from frameworks/base

Change-Id: I0571813c1cfcf66abd36eb9f178fc49b618e88a6
Signed-off-by: Mike Lockwood <lockwood@google.com>
/frameworks/native/cmds/installd/installd.c