Merge "Workaround perdev_minors path change in Linux"
am: d3870c5167
Change-Id: Ia7ec03a566f8c122dff05bcc3d996c05cf2b7771
This commit is contained in:
commit
5687befd86
1 changed files with 4 additions and 2 deletions
6
Disk.cpp
6
Disk.cpp
|
@ -50,7 +50,8 @@ static const char* kSgdiskPath = "/system/bin/sgdisk";
|
|||
static const char* kSgdiskToken = " \t\n";
|
||||
|
||||
static const char* kSysfsLoopMaxMinors = "/sys/module/loop/parameters/max_part";
|
||||
static const char* kSysfsMmcMaxMinors = "/sys/module/mmcblk/parameters/perdev_minors";
|
||||
static const char* kSysfsMmcMaxMinorsDeprecated = "/sys/module/mmcblk/parameters/perdev_minors";
|
||||
static const char* kSysfsMmcMaxMinors = "/sys/module/mmc_block/parameters/perdev_minors";
|
||||
|
||||
static const unsigned int kMajorBlockLoop = 7;
|
||||
static const unsigned int kMajorBlockScsiA = 8;
|
||||
|
@ -566,7 +567,8 @@ int Disk::getMaxMinors() {
|
|||
case kMajorBlockMmc: {
|
||||
// Per Documentation/devices.txt this is dynamic
|
||||
std::string tmp;
|
||||
if (!ReadFileToString(kSysfsMmcMaxMinors, &tmp)) {
|
||||
if (!ReadFileToString(kSysfsMmcMaxMinors, &tmp) &&
|
||||
!ReadFileToString(kSysfsMmcMaxMinorsDeprecated, &tmp)) {
|
||||
LOG(ERROR) << "Failed to read max minors";
|
||||
return -errno;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue