OSDN Git Service

android-x86/system-vold.git
9 years agoMerge "Remove makefile cruft."
Dan Albert [Fri, 12 Sep 2014 18:07:50 +0000 (18:07 +0000)]
Merge "Remove makefile cruft."

9 years agoRemove makefile cruft.
Dan Albert [Fri, 12 Sep 2014 17:48:12 +0000 (10:48 -0700)]
Remove makefile cruft.

Don't manually include stlport, and don't use private bionic headers.

Change-Id: I44dd212fdd5874e625890c548e9d7bf3a9c27912

9 years agoMerge "Fix Vold to properly handle full-disk file systems"
JP Abgrall [Fri, 15 Aug 2014 20:49:09 +0000 (20:49 +0000)]
Merge "Fix Vold to properly handle full-disk file systems"

9 years agoFix Vold to properly handle full-disk file systems
Robert Chiras [Tue, 27 May 2014 07:40:37 +0000 (10:40 +0300)]
Fix Vold to properly handle full-disk file systems

(full-disk: no partitions)

In Android, Vold recognizes a USB drive having a full-disk file system
and mounts it properly, but when the drive is removed from system Vold
won't unmount the device. This is because Vold only unmounts partitions.
For a FAT32 USB drive (with partitions), kernel will create two devices:
sda (disk device) and sda1 (partition device). When the drive is removed,
Vold will receive two netlink events: one for partition remove (sda1)
and one for disk remove (sda). The unmount occurs only when partition
remove event is received.
For a full-disk FS USB drive, kernel will only create one device: sda
(disk device). When the drive is removed, Vold will only receive one
netlink event for disk remove (sda) and it won't unmount the device.

This patch will verify if there is a currently mounted device when disk
remove event is received and will perform unmount, to properly unmount
the device.

Change-Id: I4866ab2482fddfb40a8fc73083f31df846bbb24f
Signed-off-by: Robert Chiras <robert.chiras@intel.com>
9 years agoMerge "Enable SD card format"
JP Abgrall [Fri, 15 Aug 2014 02:46:35 +0000 (02:46 +0000)]
Merge "Enable SD card format"

10 years agoEnable SD card format
Bogdan George Stefan [Mon, 30 Jun 2014 12:40:03 +0000 (15:40 +0300)]
Enable SD card format

When an SD card has no MBR it cannot be formatted
and then mounted by Android. This is because
the device node was incremented by one by mistake
when building the device path

Change-Id: I8533c6028151fe28246e74f89a294c1e58e79438
Signed-off-by: Bogdan George Stefan <bogdan.g.stefan@intel.com>
10 years agoMerge "Fix vold %lld to PRId64."
Elliott Hughes [Thu, 26 Jun 2014 00:28:33 +0000 (00:28 +0000)]
Merge "Fix vold %lld to PRId64."

10 years agoFix vold %lld to PRId64.
Elliott Hughes [Thu, 26 Jun 2014 00:27:42 +0000 (17:27 -0700)]
Fix vold %lld to PRId64.

Change-Id: I6eb9f21fff124b8b22f4fae2ac74c2b41d93b384

10 years agoMerge "Replaces uses of index() with strchr()."
Dan Albert [Thu, 5 Jun 2014 19:56:03 +0000 (19:56 +0000)]
Merge "Replaces uses of index() with strchr()."

10 years agoReplaces uses of index() with strchr().
Dan Albert [Thu, 5 Jun 2014 18:44:40 +0000 (11:44 -0700)]
Replaces uses of index() with strchr().

Bionic is removing index() because it was removed from POSIX 2008.

Change-Id: I704fb8962ff2c08b8f12245d2db2118d410826b0

10 years agoam c6752b06: Merge "vold: wildcard support for device path matching"
JP Abgrall [Tue, 27 May 2014 19:21:48 +0000 (19:21 +0000)]
am c6752b06: Merge "vold: wildcard support for device path matching"

* commit 'c6752b06987207bd69b12ad1feadd358e296d52e':
  vold: wildcard support for device path matching

10 years agoMerge "vold: wildcard support for device path matching"
JP Abgrall [Tue, 27 May 2014 19:19:32 +0000 (19:19 +0000)]
Merge "vold: wildcard support for device path matching"

10 years agovold: wildcard support for device path matching
Octavian Purdila [Mon, 5 May 2014 12:13:12 +0000 (15:13 +0300)]
vold: wildcard support for device path matching

Switching the kernel to the new sysfs layout (unselecting
CONFIG_SYSFS_DEPRECATED) complicates VolD block device recognition.

The uevents are reporting full specific paths, such as:

/devices/pci0000:0e/0000:0e:18.0/mmc_host/mmc0/mmc0:1234/block/mmcblk0

Because the full device path may contain variable IDs (in this MMC
case "1234") using full path entries in fstab does not work. Android
supports partial matches but only as a prefix at the beginning of the
path.

This patch adds support for matching shell wildcard patterns via
fnmatch(). The prefix matching rule is preserved, but if it is
detected a warning is issued.

Change-Id: Ia0c5eddec06bd71bec6ce838be3b5345278e0bab
Author:    Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Jim Bride <jim.bride@intel.com>
Reviewed-by: Bergeron, Michael <michael.bergeron@intel.com>
Tested-by: Uyyala, Sridhar <sridhar.uyyala@intel.com>
Reviewed-by: Leung, Daniel <daniel.leung@intel.com>
Reviewed-by: Uyyala, Sridhar <sridhar.uyyala@intel.com>
10 years agoam 470f0b3f: Merge "Avoid segv by checking argc in "storage user <mountpoint>""
JP Abgrall [Thu, 13 Mar 2014 15:54:36 +0000 (15:54 +0000)]
am 470f0b3f: Merge "Avoid segv by checking argc in "storage user <mountpoint>""

* commit '470f0b3ff46493b4a46b3599db33a29e94615d30':
  Avoid segv by checking argc in "storage user <mountpoint>"

10 years agoMerge "Avoid segv by checking argc in "storage user <mountpoint>""
JP Abgrall [Wed, 12 Mar 2014 17:56:32 +0000 (17:56 +0000)]
Merge "Avoid segv by checking argc in "storage user <mountpoint>""

10 years agoAvoid segv by checking argc in "storage user <mountpoint>"
JP Abgrall [Wed, 12 Mar 2014 17:41:05 +0000 (10:41 -0700)]
Avoid segv by checking argc in "storage user <mountpoint>"

Change-Id: Iffd67746e2e273c4c3f87741e5f13aa511ccb557
Signed-off-by: JP Abgrall <jpa@google.com>
10 years agoam 3c0d02aa: Merge "Convert all selinux_android_restorecon and _setfilecon calls...
Nick Kralevich [Fri, 7 Mar 2014 02:29:39 +0000 (02:29 +0000)]
am 3c0d02aa: Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."

* commit '3c0d02aa03118713e6e770b54d1c530ff866f156':
  Convert all selinux_android_restorecon and _setfilecon calls to new API.

10 years agoam 1dc1fb4a: Merge "vold: suppress unused argument warning messages"
Mark Salyzyn [Fri, 7 Mar 2014 02:29:27 +0000 (02:29 +0000)]
am 1dc1fb4a: Merge "vold: suppress unused argument warning messages"

* commit '1dc1fb4adc71ea9cf26a5033513bd3a1474f79a1':
  vold: suppress unused argument warning messages

10 years agoam 311edc8c: Merge "Add SELinux restorecon calls on ASEC containers."
Nick Kralevich [Fri, 7 Mar 2014 02:26:58 +0000 (02:26 +0000)]
am 311edc8c: Merge "Add SELinux restorecon calls on ASEC containers."

* commit '311edc8cb2dd5c86bad49f9696333874b400f9c4':
  Add SELinux restorecon calls on ASEC containers.

10 years agoam 1d8e3ce8: Merge "vold: fix errors inside ALOGV"
Colin Cross [Fri, 7 Mar 2014 02:25:15 +0000 (02:25 +0000)]
am 1d8e3ce8: Merge "vold: fix errors inside ALOGV"

* commit '1d8e3ce8da962e5ff98d36e75f6b02873fdddb70':
  vold: fix errors inside ALOGV

10 years agoMerge "Convert all selinux_android_restorecon and _setfilecon calls to new API."
Nick Kralevich [Wed, 12 Feb 2014 23:09:58 +0000 (23:09 +0000)]
Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."

10 years agoMerge "vold: suppress unused argument warning messages"
Mark Salyzyn [Wed, 12 Feb 2014 23:03:22 +0000 (23:03 +0000)]
Merge "vold: suppress unused argument warning messages"

10 years agovold: suppress unused argument warning messages
Mark Salyzyn [Wed, 12 Feb 2014 22:16:14 +0000 (14:16 -0800)]
vold: suppress unused argument warning messages

(cherry picked from commit 3e971277db0d87652af5622c989233e7159ab909)

Change-Id: Ic1ab533f756fbd44b1f2e5ae12e2f5736ace7740

10 years agoConvert all selinux_android_restorecon and _setfilecon calls to new API.
Stephen Smalley [Wed, 12 Feb 2014 14:43:08 +0000 (09:43 -0500)]
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>
10 years agoMerge "Add SELinux restorecon calls on ASEC containers."
Nick Kralevich [Tue, 11 Feb 2014 17:13:46 +0000 (17:13 +0000)]
Merge "Add SELinux restorecon calls on ASEC containers."

10 years agoMerge "vold: fix errors inside ALOGV"
Colin Cross [Fri, 7 Feb 2014 21:27:34 +0000 (21:27 +0000)]
Merge "vold: fix errors inside ALOGV"

10 years agovold: fix errors inside ALOGV
Colin Cross [Fri, 7 Feb 2014 04:34:29 +0000 (20:34 -0800)]
vold: fix errors inside ALOGV

Fix errors exposed by adding compile-time checking to disabled ALOGVs.

Change-Id: I29bd6e9a7648ccca02e0e9a96b79ee0ea7b5cfc6

10 years agoAdd SELinux restorecon calls on ASEC containers.
Robert Craig [Tue, 4 Feb 2014 15:53:00 +0000 (10:53 -0500)]
Add SELinux restorecon calls on ASEC containers.

This will allow fine-grained labeling of the
contents of ASEC containers. Some of the contents
need to be world readable and thus should be
distinguishable in policy.

Change-Id: Iefee74214d664acd262edecbb4f981d633ff96ce
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
10 years agoam 4d5d99ce: am 7cf05b15: am 2f0a1d66: am 7f6932df: am 35ab6119: am 3e03bf8a: am...
Nick Kralevich [Tue, 28 Jan 2014 14:11:06 +0000 (14:11 +0000)]
am 4d5d99ce: am 7cf05b15: am 2f0a1d66: am 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit '4d5d99ce39b5edd0b78c47a93563aed6b3d56356':
  Validate asec names.

10 years agoam 7cf05b15: am 2f0a1d66: am 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am...
Nick Kralevich [Tue, 28 Jan 2014 14:06:00 +0000 (14:06 +0000)]
am 7cf05b15: am 2f0a1d66: am 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit '7cf05b15b76b91aa07182e86a730d7552b23130c':
  Validate asec names.

10 years agoam 2f0a1d66: am 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am...
Nick Kralevich [Tue, 28 Jan 2014 03:32:29 +0000 (19:32 -0800)]
am 2f0a1d66: am 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit '2f0a1d66585fb44f59d913d3417422486ef10225':
  Validate asec names.

10 years agoam 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validat...
Nick Kralevich [Tue, 28 Jan 2014 03:27:11 +0000 (19:27 -0800)]
am 7f6932df: am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit '7f6932df89756f796c3a1f04f748db39a0564561':
  Validate asec names.

10 years agoam 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.
Nick Kralevich [Tue, 28 Jan 2014 03:25:27 +0000 (19:25 -0800)]
am 35ab6119: am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit '35ab611925aea29fc4088b5c3de7c8c77d956b8b':
  Validate asec names.

10 years agoam 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.
Nick Kralevich [Tue, 28 Jan 2014 03:21:00 +0000 (19:21 -0800)]
am 3e03bf8a: am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit '3e03bf8a7ab9dcee8897f275c75adfcdb20e0fdc':
  Validate asec names.

10 years agoam fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.
Nick Kralevich [Tue, 28 Jan 2014 03:19:25 +0000 (19:19 -0800)]
am fd2dcf90: am f4770dcf: am 0de7c611: Validate asec names.

* commit 'fd2dcf905abd3dc76738fd864e3979bd6e5ce183':
  Validate asec names.

10 years agoam f4770dcf: am 0de7c611: Validate asec names.
Nick Kralevich [Tue, 28 Jan 2014 03:17:13 +0000 (19:17 -0800)]
am f4770dcf: am 0de7c611: Validate asec names.

* commit 'f4770dcf6ffe2baba16cbb290aba16f735c51962':
  Validate asec names.

10 years agoam 0de7c611: Validate asec names.
Nick Kralevich [Tue, 28 Jan 2014 03:14:34 +0000 (19:14 -0800)]
am 0de7c611: Validate asec names.

* commit '0de7c61102611ccd5df1ca48cb733bf037512c6b':
  Validate asec names.

10 years agoValidate asec names.
Nick Kralevich [Mon, 27 Jan 2014 22:58:06 +0000 (14:58 -0800)]
Validate asec names.

Make sure asec names only contain alphanumeric, underscores,
dots, or dashes. Don't allow double dots.

Bug: 12504045

(cherry picked from commit 669626096513cf741646cf18a9e8ba246d359596)

Change-Id: Ia9d04f373aa95878b2e81584c4167dc2d4aa0c78

10 years agoMerge "vold: fix warnings for 64-bit"
Colin Cross [Fri, 24 Jan 2014 20:28:19 +0000 (20:28 +0000)]
Merge "vold: fix warnings for 64-bit"

10 years agovold: fix warnings for 64-bit
Colin Cross [Thu, 23 Jan 2014 07:59:41 +0000 (23:59 -0800)]
vold: fix warnings for 64-bit

Replace MINOR(dev_t) and MAJOR(dev_t) with minor and major,
which cast to int.
Cast int to uintptr_t before casting to pointer

Change-Id: I59375518f15d27f400fcd4f8a8dfe5ebdd8350e6

10 years agoMerge "vold: remove $(KERNEL_HEADERS) from include path"
Colin Cross [Thu, 23 Jan 2014 23:02:07 +0000 (23:02 +0000)]
Merge "vold: remove $(KERNEL_HEADERS) from include path"

10 years agovold: remove $(KERNEL_HEADERS) from include path
Colin Cross [Thu, 23 Jan 2014 07:59:16 +0000 (23:59 -0800)]
vold: remove $(KERNEL_HEADERS) from include path

The kernel headers are already in the include path, and manually
adding them again will break on a multiarch build, where the
kernel headers may be different for each arch.

Change-Id: Ifb11fa7bdff6b317c44258968244313b7039a9e1

10 years agoam 7bdfa52d: vold: cryptfs: Don\'t update KDF without validating pwd/key.
JP Abgrall [Fri, 15 Nov 2013 22:21:32 +0000 (14:21 -0800)]
am 7bdfa52d: vold: cryptfs: Don\'t update KDF without validating pwd/key.

* commit '7bdfa52d934465e2182e2f1c200c4d8581ad5da6':
  vold: cryptfs: Don't update KDF without validating pwd/key.

10 years agovold: cryptfs: Don't update KDF without validating pwd/key.
JP Abgrall [Fri, 15 Nov 2013 21:42:56 +0000 (13:42 -0800)]
vold: cryptfs: Don't update KDF without validating pwd/key.

Prior to this, the Key derivation function would get
 blindly updated even if the user entered the wrong password.
Now, we only attempt to upgrade the KDF if the pwd/key have
been verified (i.e. after a successful mount).

Bug: 11460197
Change-Id: I0469228cc9b87c47754e8ca3c7146651da177da5

10 years agoam 6bcd362e: Handle missing UUID/LABEL from blkid.
Jeff Sharkey [Mon, 11 Nov 2013 23:29:25 +0000 (15:29 -0800)]
am 6bcd362e: Handle missing UUID/LABEL from blkid.

* commit '6bcd362edd1f0ad97807276ff7f9f16991df99a4':
  Handle missing UUID/LABEL from blkid.

10 years agoHandle missing UUID/LABEL from blkid.
Jeff Sharkey [Mon, 11 Nov 2013 22:46:39 +0000 (14:46 -0800)]
Handle missing UUID/LABEL from blkid.

Bug: 11627785
Change-Id: Iee757abbc3795234f41d513a6aed8ad33855cb7a

10 years agoam cc21d6ea: Use correct minor device number to format SD card
Blair Prescott [Fri, 25 Oct 2013 22:06:12 +0000 (15:06 -0700)]
am cc21d6ea: Use correct minor device number to format SD card

* commit 'cc21d6ea5881a9f576296317bde8d818b3e4fc01':
  Use correct minor device number to format SD card

10 years agoUse correct minor device number to format SD card
Blair Prescott [Mon, 21 Oct 2013 22:25:37 +0000 (15:25 -0700)]
Use correct minor device number to format SD card

When formatting SD card partitions, instead of assuming partition
minor device numbers start from 1, use (minor device number of
the disk device + 1) as the starting point.

Bug: 11352632
Change-Id: I69d37f57aec6b62fe2a055470f7525ec09dc3859
Signed-off-by: Blair Prescott <blairp@broadcom.com>
Signed-off-by: Pierre <pierre@broadcom.com>
10 years agoam bcdbd9ac: Merge "Clean up ASEC unmounting on physical storage." into klp-dev
Jeff Sharkey [Fri, 18 Oct 2013 01:53:27 +0000 (18:53 -0700)]
am bcdbd9ac: Merge "Clean up ASEC unmounting on physical storage." into klp-dev

* commit 'bcdbd9ac0657a27ff9f7772e74c45ec1e2d460c7':
  Clean up ASEC unmounting on physical storage.

10 years agoam 10939ac7: Merge "Extract UUID and label from inserted volumes." into klp-dev
Jeff Sharkey [Fri, 18 Oct 2013 01:53:26 +0000 (18:53 -0700)]
am 10939ac7: Merge "Extract UUID and label from inserted volumes." into klp-dev

* commit '10939ac7e8c9fd141f45f1d6d82c78d5f5f5319c':
  Extract UUID and label from inserted volumes.

10 years agoMerge "Clean up ASEC unmounting on physical storage." into klp-dev
Jeff Sharkey [Fri, 18 Oct 2013 01:46:43 +0000 (01:46 +0000)]
Merge "Clean up ASEC unmounting on physical storage." into klp-dev

10 years agoMerge "Extract UUID and label from inserted volumes." into klp-dev
Jeff Sharkey [Fri, 18 Oct 2013 01:45:47 +0000 (01:45 +0000)]
Merge "Extract UUID and label from inserted volumes." into klp-dev

10 years agoClean up ASEC unmounting on physical storage.
Jeff Sharkey [Thu, 17 Oct 2013 22:17:19 +0000 (15:17 -0700)]
Clean up ASEC unmounting on physical storage.

When physical devices are unsafely removed, unmountAllAsecsInDir()
fails to find any ASECs, and leaves them all mounted, preventing the
rest of volume from going down.

Now we examine all ASEC containers, and remove when on external
storage, or when the storage media is no longer found.

Bug: 11175082
Change-Id: Iffa38ea43f7e5ad78b598374ebeb60a8727d99fd

10 years agoExtract UUID and label from inserted volumes.
Jeff Sharkey [Wed, 16 Oct 2013 23:24:19 +0000 (16:24 -0700)]
Extract UUID and label from inserted volumes.

Uses "blkid" tool to extract metadata from an inserted volume, and
reports it up to the framework.  This needs to happen in vold, since
only the FUSE-wrapped volume is visible to userspace.

Remove autorun sanitization, since FUSE takes care of this now.

Bug: 11175082
Change-Id: Ie69b38011ad6011bfb50e40d4f35a29e02150c19

10 years agoam 18afaca1: Merge "DO NOT MERGE. Fix crash in vold" into klp-dev
Jeff Sharkey [Thu, 17 Oct 2013 16:18:31 +0000 (09:18 -0700)]
am 18afaca1: Merge "DO NOT MERGE. Fix crash in vold" into klp-dev

* commit '18afaca1ad6f480ab6ac259278c8c8013aaab45a':
  DO NOT MERGE. Fix crash in vold

10 years agoMerge "DO NOT MERGE. Fix crash in vold" into klp-dev
Jeff Sharkey [Thu, 17 Oct 2013 16:12:38 +0000 (16:12 +0000)]
Merge "DO NOT MERGE. Fix crash in vold" into klp-dev

10 years agoam 4d9c9bd5: merge in klp-release (no-op)
Ed Heyl [Thu, 17 Oct 2013 01:07:28 +0000 (18:07 -0700)]
am 4d9c9bd5: merge in klp-release (no-op)

* commit '4d9c9bd5cc5f81954b1e9724d125b8947b412b04':

10 years agomerge in klp-release (no-op)
Ed Heyl [Thu, 17 Oct 2013 00:48:33 +0000 (17:48 -0700)]
merge in klp-release (no-op)

10 years agoDO NOT MERGE. Fix crash in vold
Marco Nelissen [Tue, 15 Oct 2013 22:22:28 +0000 (15:22 -0700)]
DO NOT MERGE. Fix crash in vold

b/11239345

Change-Id: I46a8d6b38e3c093e20e1e5c4f01efc13d1960ad4

10 years agoam 98d05700: Merge "Remove unused MAX_PARTS define"
Kenny Root [Thu, 10 Oct 2013 17:36:33 +0000 (10:36 -0700)]
am 98d05700: Merge "Remove unused MAX_PARTS define"

* commit '98d05700d6055532e6e37675e21b83b3c97b7c6e':
  Remove unused MAX_PARTS define

10 years agoMerge "Remove unused MAX_PARTS define"
Kenny Root [Thu, 10 Oct 2013 15:51:11 +0000 (15:51 +0000)]
Merge "Remove unused MAX_PARTS define"

10 years agomerge in klp-release history after reset to klp-dev
The Android Automerger [Wed, 9 Oct 2013 13:02:14 +0000 (06:02 -0700)]
merge in klp-release history after reset to klp-dev

10 years agomerge in KQS81M
Ed Heyl [Tue, 8 Oct 2013 22:45:14 +0000 (15:45 -0700)]
merge in KQS81M

10 years agoAdd support for more expressive SD card permissions
Jeff Sharkey [Tue, 16 Jul 2013 01:14:25 +0000 (18:14 -0700)]
Add support for more expressive SD card permissions

We now run an sdcard fuse daemon on top of a physical SD card.
Add support for that.

Bug: 10330128

Change-Id: I6a291f861ccb0f2911c07cc8f659e2cec4e6d76c

10 years agoRemove unused MAX_PARTS define
Bjorn Andersson [Thu, 27 Jun 2013 15:39:39 +0000 (17:39 +0200)]
Remove unused MAX_PARTS define

The MAX_PARTS define is not used anywhere in the source code and as
the MAX_PARTITIONS constant was introduced at the same time and used
to hold the same value it's most likely just a remainder from the
development of the partition support code.

Change-Id: I2ae8a062c5643839429f4e3e30a9af05597ce499

10 years agomerge in klp-release history after reset to klp-dev
The Android Automerger [Sun, 22 Sep 2013 17:52:01 +0000 (10:52 -0700)]
merge in klp-release history after reset to klp-dev

10 years agoAdd mkdirs() command.
Jeff Sharkey [Wed, 18 Sep 2013 00:24:38 +0000 (17:24 -0700)]
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

10 years agoUse android_fork_execvp() instead of system(3) to format filesystems
Ken Sumrall [Tue, 20 Aug 2013 20:48:23 +0000 (13:48 -0700)]
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

10 years agoUse android_fork_execvp() instead of system(3) to format filesystems
Ken Sumrall [Tue, 20 Aug 2013 20:48:23 +0000 (13:48 -0700)]
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

10 years agoMerge "Use a shared library when building vold" into klp-dev
Ken Sumrall [Thu, 15 Aug 2013 21:47:18 +0000 (21:47 +0000)]
Merge "Use a shared library when building vold" into klp-dev

10 years agoUse a shared library when building vold
Ken Sumrall [Thu, 15 Aug 2013 03:15:17 +0000 (20:15 -0700)]
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

10 years agoInitialize iterator
Kenny Root [Wed, 14 Aug 2013 22:54:49 +0000 (15:54 -0700)]
Initialize iterator

Iterator wasn't initialized in scrypt parameter scanning.

Bug: 10330227
Change-Id: If41fc25d9f827106fa8329bdb5966b7d786fddcb

11 years agoAdd libext4 and libmincrypt to vold.
Geremy Condra [Wed, 7 Aug 2013 20:12:41 +0000 (13:12 -0700)]
Add libext4 and libmincrypt to vold.

This accomodates verity changes, which now utilize these libraries.

Change-Id: I1ff8c012e972e245cf3e4bc3a02bef0989165d75

11 years agoam 5d09126a: am f99dfdb5: Merge "vold: fix potential socket leak"
Jean-Baptiste Queru [Tue, 2 Jul 2013 19:41:36 +0000 (12:41 -0700)]
am 5d09126a: am f99dfdb5: Merge "vold: fix potential socket leak"

* commit '5d09126ad1cd10c74e676fb158f1d057a37180b2':
  vold: fix potential socket leak

11 years agoam 0002a85f: am 5d27f0a7: Merge "Fix spelling."
Nick Kralevich [Tue, 2 Jul 2013 19:41:36 +0000 (12:41 -0700)]
am 0002a85f: am 5d27f0a7: Merge "Fix spelling."

* commit '0002a85f8b94d96b9b86819bd33fdfd7cfe74080':
  Fix spelling.

11 years agoam f99dfdb5: Merge "vold: fix potential socket leak"
Jean-Baptiste Queru [Tue, 2 Jul 2013 19:34:35 +0000 (12:34 -0700)]
am f99dfdb5: Merge "vold: fix potential socket leak"

* commit 'f99dfdb5044ed6b120a8f2a86ddf2dd92a5bb9a2':
  vold: fix potential socket leak

11 years agoam 5d27f0a7: Merge "Fix spelling."
Nick Kralevich [Tue, 2 Jul 2013 19:34:34 +0000 (12:34 -0700)]
am 5d27f0a7: Merge "Fix spelling."

* commit '5d27f0a71412fb1e6bba400da6066ad7c5ba8b72':
  Fix spelling.

11 years agoMerge "vold: fix potential socket leak"
Jean-Baptiste Queru [Tue, 2 Jul 2013 19:13:03 +0000 (19:13 +0000)]
Merge "vold: fix potential socket leak"

11 years agovold: fix potential socket leak
Kaspter Ju [Sat, 14 Apr 2012 02:48:45 +0000 (10:48 +0800)]
vold: fix potential socket leak

Change-Id: Icdb4500fc1e055b058974087e1e518c878dc6b22
Signed-off-by: Kaspter Ju <kaspter@gmail.com>
11 years agoMerge "Fix spelling."
Nick Kralevich [Tue, 2 Jul 2013 16:05:21 +0000 (16:05 +0000)]
Merge "Fix spelling."

11 years agoFix spelling.
Nick Kralevich [Sat, 29 Jun 2013 02:08:35 +0000 (19:08 -0700)]
Fix spelling.

Change-Id: I81debc5063716d7cbea060a0abb34c646d7cda93

11 years agoMerge "vold: Use the new method of rebooting by asking init to do it"
Ken Sumrall [Fri, 28 Jun 2013 02:47:45 +0000 (02:47 +0000)]
Merge "vold: Use the new method of rebooting by asking init to do it"

11 years agovold: Use the new method of rebooting by asking init to do it
Ken Sumrall [Tue, 4 Jun 2013 23:37:52 +0000 (16:37 -0700)]
vold: Use the new method of rebooting by asking init to do it

Change-Id: I7fd5f1048c3cf43fa14597f079c929690cac367c

11 years agoChange key derivation to scrypt
Kenny Root [Fri, 14 Jun 2013 19:11:38 +0000 (12:11 -0700)]
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

11 years agoExtract some version constants to header
Kenny Root [Fri, 14 Jun 2013 19:08:28 +0000 (12:08 -0700)]
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

11 years agoChange upgrade code to allow multiple versions
Kenny Root [Fri, 14 Jun 2013 18:29:53 +0000 (11:29 -0700)]
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

11 years agovold: Add an optional wipe paramter to the volume format command
Ken Sumrall [Wed, 12 Jun 2013 02:10:20 +0000 (19:10 -0700)]
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

11 years agoam 9420c0b3: (-s ours) Reconcile with jb-mr2-release - do not merge
The Android Open Source Project [Thu, 16 May 2013 12:48:24 +0000 (05:48 -0700)]
am 9420c0b3: (-s ours) Reconcile with jb-mr2-release - do not merge

* commit '9420c0b338106eed246b362238b063ecdab3a710':
  Grab a partial wakelock when doing fstrim

11 years agoReconcile with jb-mr2-release - do not merge
The Android Open Source Project [Thu, 16 May 2013 12:44:19 +0000 (05:44 -0700)]
Reconcile with jb-mr2-release - do not merge

Change-Id: I58dee084939bd1b49432bfb4e460dddeb4f6e15a

11 years agomerge in jb-mr2-release history after reset to jb-mr2-dev
The Android Automerger [Wed, 15 May 2013 12:55:51 +0000 (05:55 -0700)]
merge in jb-mr2-release history after reset to jb-mr2-dev

11 years agoam c587269c: vold: Increase timeout due to selinux changes
Ken Sumrall [Wed, 15 May 2013 02:19:22 +0000 (19:19 -0700)]
am c587269c: vold: Increase timeout due to selinux changes

* commit 'c587269c5a34d4e7412ff42e53ed6312359a8505':
  vold: Increase timeout due to selinux changes

11 years agovold: Increase timeout due to selinux changes
Ken Sumrall [Tue, 14 May 2013 22:26:31 +0000 (15:26 -0700)]
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

11 years agoFix a typo in a comment
Alex Klyubin [Fri, 10 May 2013 22:17:07 +0000 (15:17 -0700)]
Fix a typo in a comment

Change-Id: Ibb9667d762189849ebcbefef4ba70ffd34cf885e

11 years agoam bc7d5088: vold: Have the fstrim log start and finish times in the event log
Ken Sumrall [Wed, 8 May 2013 22:03:52 +0000 (15:03 -0700)]
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

11 years agomerge in jb-mr2-release history after reset to jb-mr2-dev
The Android Automerger [Wed, 8 May 2013 12:55:57 +0000 (05:55 -0700)]
merge in jb-mr2-release history after reset to jb-mr2-dev

11 years agovold: Have the fstrim log start and finish times in the event log
Ken Sumrall [Wed, 8 May 2013 00:28:21 +0000 (17:28 -0700)]
vold: Have the fstrim log start and finish times in the event log

bug: 8688454

Change-Id: I5540ab27d3ade2c42ee8fd0de6fbfc1d1e19e36f

11 years agoGrab a partial wakelock when doing fstrim
Ken Sumrall [Thu, 2 May 2013 06:34:57 +0000 (23:34 -0700)]
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

11 years agoam e78cd4f3: Grab a partial wakelock when doing fstrim
Ken Sumrall [Thu, 2 May 2013 18:36:02 +0000 (11:36 -0700)]
am e78cd4f3: Grab a partial wakelock when doing fstrim

* commit 'e78cd4f33d2b7969f1baca2b274740e1b53b3121':
  Grab a partial wakelock when doing fstrim

11 years agoGrab a partial wakelock when doing fstrim
Ken Sumrall [Thu, 2 May 2013 06:34:57 +0000 (23:34 -0700)]
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

11 years agovold: Do not print fstrim amount if ioctl returns an error
Ken Sumrall [Tue, 30 Apr 2013 02:17:56 +0000 (19:17 -0700)]
vold: Do not print fstrim amount if ioctl returns an error

Change-Id: I8620ea67a774ead51bd6bd9b6e737bf3d634470b