Merge "Workaround perdev_minors path change in Linux"
This commit is contained in:
commit
d3870c5167
1 changed files with 4 additions and 2 deletions
6
Disk.cpp
6
Disk.cpp
|
@ -49,7 +49,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;
|
||||
|
@ -559,7 +560,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