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
Handle missing UUID/LABEL from blkid.

Bug: 11627785
Change-Id: Iee757abbc3795234f41d513a6aed8ad33855cb7a
vold: mount ext4 with forced SELinux context

Always mount voldmanaged ext4 partitions with the SELinux sdcard_external
context. For other file systems, this is done via the genfs_context,
but since ext4 supports SELinux natively, it must be set here.

Change-Id: I1364f37018b25d79b1826c85849def64e868d72f
vold: force SELinux context only for sdcard

Google uses this code to mount ASEC as well and we shouldn't force
their SELinux contexts

Change-Id: I873af4dc2309d3d0942ce466b8acf8158abb85ae
minivold: adjustments for vold in recovery

- Mount directly to /storage/ instead of /mnt/media_rw
- Do not attempt to mount ASEC

Change-Id: Icb088a413e07222b302264d10f7c7f2aadfebcab
vold: allow non-vfat devices to be used as ASEC

CM supports alternative file systems (which some devices specify
in the fstab as 'auto').

Change-Id: I7e78fe87a7efc49d6749d5892107085d55156cce
vold: support more than 1 UMS share

Used for devices with both mountable internal and external sdcards.

This is a forward-port and clean up of the 10.2 code (which contains
a lot of deadcode.)

Original authors:

    Alex Zepeda <alex@inferiorhumanorgans.com>
    Genokolar <genokolar@gmail.com>
    Josh Stone <cuviper@gmail.com>
    mik_os <kiril.mik.os@gmail.com>
    Oran Avraham <oranav@gmail.com>
    Pawit Pornkitprasan <p.pawit@gmail.com>
    Tony Layher <layhertony@gmail.com>

Change-Id: I926ce244255414697373d26d252a9da89aea7226
vold: pass selinux context to ext4 mount (remount ro)

Change-Id: Ic0bb314b30e42489c45caec29d35d6896c9849eb
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
vold: Raise MAX_PARTITIONS to 32

 * We raised this in 10.2 globally, lets put it back to 32 so that
   new bringups don't get stuck on this. It's likely that every single
   device which uses physical, nonremovable volumes with vold will hit
   this limit.

Change-Id: Id7522681a2317c4aff49ca27e1c57e69fe57213c
vold: Initialize flag variables

* These variables may actually be checked before they are set. Set them
  to reasonable defaults to prevent very strange behavior.

Change-Id: I303c4c6742ce86bbde6bda768f4e396263518ed2
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
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>
Merge tag 'android-4.4.1_r1' into HEAD

Android 4.4.1 Release 1

Conflicts:
	Android.mk
	Volume.cpp
	Volume.h
	VolumeManager.cpp

Change-Id: Ic3e413d61df82b9fbe49079279ca0d00b08d8ed3
vold: allow non-vfat devices to be used as ASEC

CM supports alternative file systems (which some devices specify
in the fstab as 'auto').

Change-Id: I7e78fe87a7efc49d6749d5892107085d55156cce
Merge commit 'refs/changes/50/450/2' of https://gerrit.slimroms.net/SlimRoms/android_system_vold into HEAD