Commit graph

426 commits

Author SHA1 Message Date
Jeff Sharkey
530a6c1787 am 71ebe154: Add mkdirs() command.
* commit '71ebe154a5fbbb4b394a439ff0b6b9c84fbd04f5':
  Add mkdirs() command.
2013-09-20 15:59:36 -07:00
Jeff Sharkey
71ebe154a5 Add mkdirs() command.
Apps without sdcard_r or sdcard_rw need to have someone create
package-specific directories on their behalf.  If apps have trouble
creating on their own, they now delegate through system to have
vold create the paths.

Requires that the requested path is actually managed by vold.

Bug: 10577808
Change-Id: I6835fc8f52240f9de07f89742a426a153e3ca32a
2013-09-20 14:29:59 -07:00
Nick Kralevich
20bab9ffdc vold: Remove obsolete xwarp support.
This code appears to be unused. Delete it.

This is essentially a revert of 2350c44ff3.

Change-Id: I20a525bb49f6ee8fec8c1ec22e01ad47d0c72960
2013-09-17 13:21:03 -07:00
Ken Sumrall
e550f78a3f Use android_fork_execvp() instead of system(3) to format filesystems
With the recent selinux changes imposed on vold, it no longer has
permission to run a shell, so invoking the filesystem formatting
commands with system(3) gives an error.  So change to using
android_fork_execvp().

Bug: 10279958

Change-Id: Ifa18b28867618858ec7c5cfcc67935e377de38fb
2013-08-21 11:30:16 -07:00
Ken Sumrall
550ac6c1ff Merge "Use a shared library when building vold" into klp-dev 2013-08-15 21:47:22 +00:00
Ken Sumrall
5cf759a9c5 Use a shared library when building vold
A quick fix to a broken build resulted in using a static library
to build vold when a shared library was available.  This fixes
that.

Bug: 10332978
Change-Id: I31c2b4a87c7b37647e71f7f3c93b0d64dd52da44
2013-08-14 20:15:17 -07:00
Kenny Root
2947e34e41 Initialize iterator
Iterator wasn't initialized in scrypt parameter scanning.

Bug: 10330227
Change-Id: If41fc25d9f827106fa8329bdb5966b7d786fddcb
2013-08-14 23:26:19 +00:00
Geremy Condra
c49f0f2f90 Add libext4 and libmincrypt to vold.
This accomodates verity changes, which now utilize these libraries.

Change-Id: I1ff8c012e972e245cf3e4bc3a02bef0989165d75
2013-08-07 13:13:24 -07:00
Jean-Baptiste Queru
2a18ea31bf am 5d09126a: am f99dfdb5: Merge "vold: fix potential socket leak"
* commit '5d09126ad1cd10c74e676fb158f1d057a37180b2':
  vold: fix potential socket leak
2013-07-02 12:41:36 -07:00
Nick Kralevich
a3026dfbac am 0002a85f: am 5d27f0a7: Merge "Fix spelling."
* commit '0002a85f8b94d96b9b86819bd33fdfd7cfe74080':
  Fix spelling.
2013-07-02 12:41:36 -07:00
Jean-Baptiste Queru
5d09126ad1 am f99dfdb5: Merge "vold: fix potential socket leak"
* commit 'f99dfdb5044ed6b120a8f2a86ddf2dd92a5bb9a2':
  vold: fix potential socket leak
2013-07-02 12:34:35 -07:00
Nick Kralevich
0002a85f8b am 5d27f0a7: Merge "Fix spelling."
* commit '5d27f0a71412fb1e6bba400da6066ad7c5ba8b72':
  Fix spelling.
2013-07-02 12:34:34 -07:00
Jean-Baptiste Queru
f99dfdb504 Merge "vold: fix potential socket leak" 2013-07-02 19:13:03 +00:00
Kaspter Ju
15bd71f82f vold: fix potential socket leak
Change-Id: Icdb4500fc1e055b058974087e1e518c878dc6b22
Signed-off-by: Kaspter Ju <kaspter@gmail.com>
2013-07-02 12:04:09 -07:00
Nick Kralevich
5d27f0a714 Merge "Fix spelling." 2013-07-02 16:05:21 +00:00
Nick Kralevich
3b20c39c90 Fix spelling.
Change-Id: I81debc5063716d7cbea060a0abb34c646d7cda93
2013-06-28 19:08:35 -07:00
Ken Sumrall
558830c38a Merge "vold: Use the new method of rebooting by asking init to do it" 2013-06-28 02:47:46 +00:00
Ken Sumrall
adfba3626e vold: Use the new method of rebooting by asking init to do it
Change-Id: I7fd5f1048c3cf43fa14597f079c929690cac367c
2013-06-26 17:51:44 -07:00
Kenny Root
c4c70f15bb Change key derivation to scrypt
scrypt is a sequential memory-hard key derivation algorithm that makes
it more difficult for adversaries to brute force passwords using
specialized equipment. See http://www.tarsnap.com/scrypt/scrypt.pdf for
more details of the algorithm.

This adds support for initializing disk encryption using scrypt and
upgrading from the previous PBKDF2 algorithm.

Change-Id: I1d26db4eb9d27fea7310be3e49c8e6219e6d2c3b
2013-06-24 09:40:54 -07:00
Kenny Root
c96a5f8edf Extract some version constants to header
In order to make it easier to upgrade the crypto footer, extract some
constants to a header file instead. Then the header can control what the
current version is and the upgrade_crypto_ftr code should be the only
thing that needs to be updated.

Change-Id: I3ed5a7d3b640419cd8af91388d94a00de8cc09db
2013-06-14 12:50:02 -07:00
Kenny Root
7434b3111b Change upgrade code to allow multiple versions
In the future, we'd like to have the ability to upgrade from any
supported version to any future version. Change the upgrade function
slightly to support this.

Change-Id: I3b20ccfff51c4c86f1e5e08690c263dc95ff5ce4
2013-06-14 11:32:18 -07:00
Ken Sumrall
9caab76c6b vold: Add an optional wipe paramter to the volume format command
The new wipe option to the vold format command will invoke BLKDISCARD
on the partition before invoking newfs_msdos.  This will be used whenever
a full wipe of the device is wanted, as this is more secure than just
doing newfs_msdos.

Bug: 9392982
Change-Id: Ie106f1b9cc70abc61206006d1821641c27c7ccae
2013-06-12 18:42:02 -07:00
The Android Open Source Project
dfbf110dfa am 9420c0b3: (-s ours) Reconcile with jb-mr2-release - do not merge
* commit '9420c0b338106eed246b362238b063ecdab3a710':
  Grab a partial wakelock when doing fstrim
2013-05-16 05:48:24 -07:00
The Android Open Source Project
9420c0b338 Reconcile with jb-mr2-release - do not merge
Change-Id: I58dee084939bd1b49432bfb4e460dddeb4f6e15a
2013-05-16 05:44:19 -07:00
The Android Automerger
d0be146cee merge in jb-mr2-release history after reset to jb-mr2-dev 2013-05-15 05:55:51 -07:00
Ken Sumrall
e88e1eb745 am c587269c: vold: Increase timeout due to selinux changes
* commit 'c587269c5a34d4e7412ff42e53ed6312359a8505':
  vold: Increase timeout due to selinux changes
2013-05-14 19:19:22 -07:00
Ken Sumrall
c587269c5a vold: Increase timeout due to selinux changes
The new selinux_reload_policy command can take a while to complete on
some systems.  The reason is being investigated, and hopefully a fix can
be found to improve performance, but for now, increase the timeout that
vold waits for the post_fs_data section to complete when decrypting a
device on boot.

Also, emit a decent error message if the device times out.

Bug: 8967715
Change-Id: Ifb01c983dffe095a9de752c17c467a1751e9ce99
2013-05-14 15:26:31 -07:00
Alex Klyubin
707795ad39 Fix a typo in a comment
Change-Id: Ibb9667d762189849ebcbefef4ba70ffd34cf885e
2013-05-10 15:17:07 -07:00
Ken Sumrall
1ede90d504 am bc7d5088: vold: Have the fstrim log start and finish times in the event log
* commit 'bc7d5088f7f7cbd097f99d2f6d015e2c0a73cacb':
  vold: Have the fstrim log start and finish times in the event log
2013-05-08 15:03:52 -07:00
The Android Automerger
4d5a7ca549 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-05-08 05:55:57 -07:00
Ken Sumrall
bc7d5088f7 vold: Have the fstrim log start and finish times in the event log
bug: 8688454

Change-Id: I5540ab27d3ade2c42ee8fd0de6fbfc1d1e19e36f
2013-05-07 17:29:12 -07:00
Ken Sumrall
8cca752b80 Grab a partial wakelock when doing fstrim
Fstrim can take a while, so grab a wakelock so it finishes now,
not when the user picks up the device and wakes it back up.

This change does not protect against multiple calls to fstrim
before the first one completes.  When the first one completes, it
will release the wakelock, and the device will go to sleep.
However, normal usage is this will not be invoked by the framework
more than once a day, so this should not be an issue.

Bug: 8781133

Change-Id: I8065d1380eaf52ca8a7ca308af66fb6e86d60a66
2013-05-02 15:47:40 -07:00
Ken Sumrall
924d9defc6 am e78cd4f3: Grab a partial wakelock when doing fstrim
* commit 'e78cd4f33d2b7969f1baca2b274740e1b53b3121':
  Grab a partial wakelock when doing fstrim
2013-05-02 11:36:02 -07:00
Ken Sumrall
e78cd4f33d Grab a partial wakelock when doing fstrim
Fstrim can take a while, so grab a wakelock so it finishes now,
not when the user picks up the device and wakes it back up.

This change does not protect against multiple calls to fstrim
before the first one completes.  When the first one completes, it
will release the wakelock, and the device will go to sleep.
However, normal usage is this will not be invoked by the framework
more than once a day, so this should not be an issue.

Bug: 8781133

Change-Id: I8065d1380eaf52ca8a7ca308af66fb6e86d60a66
2013-05-01 23:37:45 -07:00
Ken Sumrall
2c4b563b3d vold: Do not print fstrim amount if ioctl returns an error
Change-Id: I8620ea67a774ead51bd6bd9b6e737bf3d634470b
2013-04-29 19:17:56 -07:00
Ken Sumrall
160b4d68ec vold: Add support for unencrypted persistent info
In order to display the correct language, timezone, airplane
mode and other settings on the decrypt screen, a copy of those
settings needs to be stored unencrypted so the framework can
query them.  This adds support to vold to store up to 32
property like key/value pairs that are not encrypted.

Change-Id: Id5c936d2c57d46ed5cff9325d92ba1e8d2ec8972
2013-04-26 15:44:59 -07:00
Ken Sumrall
d3ae5221e2 am 743a5ec9: vold: Perform fstrim work in a separate thread.
* commit '743a5ec96cd54bdc06234be15cdde65296357a6a':
  vold: Perform fstrim work in a separate thread.
2013-04-23 15:02:09 -07:00
Ken Sumrall
743a5ec96c vold: Perform fstrim work in a separate thread.
Some devices can take up to a few minutes to do fstrim.  If done
in the same thread as the rest of the vold command listener, then
vold is blocked from responding to any other commands until the
trim is done.  So create a thread to do the work, and return
immediately.

bug: 8688454

Change-Id: I780baae03ba7de2d3e805c3e9f103ec03be84c47
2013-04-22 19:21:07 -07:00
Ken Sumrall
5fb923142f am b55025bf: Merge "vold: set klog level so e2fsck output is logged" into jb-mr2-dev
* commit 'b55025bfa1039c8fa205727b49fe4a8dd1df7725':
  vold: set klog level so e2fsck output is logged
2013-04-15 10:42:11 -07:00
Ken Sumrall
b55025bfa1 Merge "vold: set klog level so e2fsck output is logged" into jb-mr2-dev 2013-04-15 17:34:25 +00:00
Ken Sumrall
b9738ea969 vold: set klog level so e2fsck output is logged
When mounting an encrypted filesystem vold calls fs_mgr, which
will call e2fsck on the fielsystem if it's configured to, and
fs_mgr will attempt to log the output the kernel log. However,
if won't log anything unless the klog level is set to 6, aka INFO.

Change-Id: I8ac34941330262ea3414681b872fbbeb75391461
2013-04-10 02:28:55 -07:00
Ying Wang
476c893041 am 741a1699: Add liblog
* commit '741a1699b15c628e36e5c26457bd703b11f1e515':
  Add liblog
2013-04-09 22:17:32 -07:00
Ying Wang
741a1699b1 Add liblog
Bug: 8580410
Change-Id: I1a59b45c87cd901b3de52540ad7b670c42ffcbd5
2013-04-09 22:05:28 -07:00
Ken Sumrall
91ff7128dd am c5771b5a: Merge "Vold: Add the fstrim subsystem to vold" into jb-mr2-dev
* commit 'c5771b5a4d66a0c7ca0e2cb1056e670f38b3834f':
  Vold: Add the fstrim subsystem to vold
2013-03-27 14:18:38 -07:00
Ken Sumrall
c5771b5a4d Merge "Vold: Add the fstrim subsystem to vold" into jb-mr2-dev 2013-03-27 21:15:55 +00:00
Ken Sumrall
b87937cdea Vold: Add the fstrim subsystem to vold
The fstrim subsystem implements the dotrim command, which goes
through all the writable filesystems on the device, and invokes
the FITRIM ioctl() on them.  This marks all the unused blocks on
the underlying flash device as unused, so the device performs better.

Change-Id: I5fc8c2f60e0bc823f162d0f89580fb288ecb2160
2013-03-22 02:19:15 -07:00
Jean-Baptiste Queru
2d907482fd am 6bbf28da: (-s ours) am c004cfd8: am b843601a: am 77acfc4d: (-s ours) am 3c73fdaa: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '6bbf28da27dde1d3154456ab44a68ff62ee81c3c':
2013-03-11 20:51:43 +00:00
Jean-Baptiste Queru
6bbf28da27 am c004cfd8: am b843601a: am 77acfc4d: (-s ours) am 3c73fdaa: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'c004cfd80c5b54c971b8854fa1d10ee23be1c868':
2013-03-11 13:44:17 -07:00
Jean-Baptiste Queru
c004cfd80c am b843601a: am 77acfc4d: (-s ours) am 3c73fdaa: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit 'b843601a9de78a0015c8d963187efaa530e46d46':
2013-03-11 13:06:39 -07:00
Jean-Baptiste Queru
b843601a9d am 77acfc4d: (-s ours) am 3c73fdaa: (-s ours) Reconcile with jb-mr1-release - do not merge
* commit '77acfc4d6dc30f0b46ade8c6e12445065a2520eb':
2013-03-11 12:47:14 -07:00