OSDN Git Service

vold: wildcard support for device path matching
authorOctavian Purdila <octavian.purdila@intel.com>
Mon, 5 May 2014 12:13:12 +0000 (15:13 +0300)
committerOctavian Purdila <octavian.purdila@intel.com>
Mon, 5 May 2014 15:23:27 +0000 (18:23 +0300)
commit46c301c03e03ddae5df3b91b73e20d1d5f9999ae
tree8f216ea3906195121f016663c5e62d57629d0aab
parent470f0b3ff46493b4a46b3599db33a29e94615d30
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>
DirectVolume.cpp
DirectVolume.h