Commit graph

22 commits

Author SHA1 Message Date
JP Abgrall
eafe0eb772 am 52f5425f: Merge "Fix Vold to properly handle full-disk file systems"
* commit '52f5425ff53216e3d7e2410bffd05e0df2b13c9c':
  Fix Vold to properly handle full-disk file systems
2014-08-15 20:56:13 +00:00
JP Abgrall
52f5425ff5 Merge "Fix Vold to properly handle full-disk file systems" 2014-08-15 18:58:32 +00:00
Robert Chiras
961d20d9fd 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>
2014-08-15 20:38:23 +00:00
JP Abgrall
12e36398b5 am 099b20f3: am 1881395b: am c6752b06: Merge "vold: wildcard support for device path matching"
* commit '099b20f3ce42a49ba49a1a70a818047ea59612ad':
  vold: wildcard support for device path matching
2014-05-27 19:28:07 +00:00
Cylen Yao
b31f33b5e4 Support non-sequential partition index
Add support for the storage with non-sequential partition index
Ex: if using  extended partition, the index of the partition will be greater than 5

[toddpoynor@google.com: fixup mPendingPartCount data type]
Change-Id: I5dbc870fbaac24045f5b994fcb899d5df73c6a55
2014-05-16 13:15:27 -07:00
Octavian Purdila
46c301c03e 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>
2014-05-05 18:23:27 +03:00
Jeff Sharkey
32e2090562 am bcdbd9ac: Merge "Clean up ASEC unmounting on physical storage." into klp-dev
* commit 'bcdbd9ac0657a27ff9f7772e74c45ec1e2d460c7':
  Clean up ASEC unmounting on physical storage.
2013-10-17 18:53:27 -07:00
Jeff Sharkey
8c2c15b1c6 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
2013-10-17 15:30:30 -07:00
Kenny Root
1e89211d10 am 98d05700: Merge "Remove unused MAX_PARTS define"
* commit '98d05700d6055532e6e37675e21b83b3c97b7c6e':
  Remove unused MAX_PARTS define
2013-10-10 10:36:33 -07:00
Jeff Sharkey
ba6ae8db13 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
2013-10-08 10:13:04 -07:00
Bjorn Andersson
63b69e1412 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
2013-10-01 15:27:56 -07:00
Hirofumi Ando
b4a8c9cd90 Extend the maximum number of partitions from 4 to 32
Some platforms needs more than 4 partitions, e.g. the lt26.

Change-Id: Id22125313824b0ae15a4596709f52c4ab609a542
2012-09-20 12:00:33 +02:00
Ken Sumrall
0b8b597193 Add the ability to revert a crypto mapping when unmounting a volume
Add the force_and_revert option to the unmount command which will force
the unmount, and revert a crypto mapping.  This is used during factory
reset so that when the internal sdcard volume is formatted, it formats
the raw device, not the encrypted mapping.

Change-Id: I36b6ff9bb54863b121de635472a303bf4a2334a9
2011-08-31 18:09:35 -07:00
Ken Sumrall
29d8da8cef vold: allow to store key in a file on another partition
Add support for keeping the keys in a separate file on another partition,
for devices with no space reserved for a footer after the userdata filesystem.

Add support for encrypting the volumes managed by vold, if they meet certain
criteria, namely being marked as nonremovable and encryptable in vold.fstab.
A bit of trickiness is required to keep vold happy.

Change-Id: Idf0611f74b56c1026c45742ca82e0c26e58828fe
2011-06-02 16:30:14 -07:00
Mike Lockwood
a4886f1f8e More fixes for internal FAT partitions:
Fix formatting partitions beyond the first partition.
Do not try to initialize the MBR when formatting only a single partition.

Change-Id: Ifbbd279b1c288b7b1b884a1a89248e3086ed735f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-21 13:59:31 -04:00
Mike Lockwood
2dfe297ec4 Fixes for devices with internal FAT file system:
Only share a single partition via UMS if a specific partition
is specified in vold.fstab (rather than "auto")

Do not fail to reformat if MBR cannot be found.

Change-Id: I544ca2ee325c308af656ab9f4732c788a964c156
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-17 18:50:51 -04:00
Kenny Root
da62e7c002 Revert "Prevent null pointer deref in DirectVolume"
This reverts commit a9f423dd7e.
2010-03-24 20:18:00 -07:00
Kenny Root
a9f423dd7e Prevent null pointer deref in DirectVolume
There's a possibility that if something were messed up a call to
NetlinkEvent::findParam could return a NULL. Passing NULL as the
argument into atoi() would cause a null pointer dereference.

Change-Id: Ib071afbbe2adc341108c245ffa596cc8730bd8fd
2010-03-24 15:39:08 -07:00
San Mehat
a2677e4ad0 vold2: Get mounting/unmounting/formatting/sharing working
Signed-off-by: San Mehat <san@google.com>
2009-12-19 09:54:42 -08:00
San Mehat
dd9b8e92aa vold2: Some more work on partitioning support
Signed-off-by: San Mehat <san@google.com>
2009-10-21 11:07:21 -07:00
San Mehat
49e2bce5b7 vold2: Wire up more of the mount function
Signed-off-by: San Mehat <san@android.com>
2009-10-12 16:29:01 -07:00
San Mehat
ae10b91044 vold2: Rename DeviceVolume -> DirectVolume
Signed-off-by: San Mehat <san@android.com>
2009-10-12 15:03:15 -07:00
Renamed from DeviceVolume.h (Browse further)