Fix a typo when comparing the verity mode

The veritymode string used by the bootloader should be lowercase 'eio'
instead of 'EIO'. Fix the typo and change to strcasecmp.

Bug: 27175949
Change-Id: I376dacc70eef7364e2b9931a7c940adedcdb1929
This commit is contained in:
Tianjie Xu 2016-07-14 16:00:36 -07:00
parent 13f44939b1
commit 4bbe0c93c8

View file

@ -160,9 +160,9 @@ int main(int argc, char** argv) {
if (property_get("ro.boot.veritymode", verity_mode, "") == -1) {
SLOGE("Failed to get dm-verity mode");
return -1;
} else if (strcmp(verity_mode, "EIO") == 0) {
} else if (strcasecmp(verity_mode, "eio") == 0) {
// We shouldn't see verity in EIO mode if the current slot hasn't booted
// successfully before. Therefore, fail the verification when veirtymode=EIO.
// successfully before. Therefore, fail the verification when veritymode=eio.
SLOGE("Found dm-verity in EIO mode, skip verification.");
return -1;
} else if (strcmp(verity_mode, "enforcing") != 0) {