Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5828b77a authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

adb: enable/disable verity expected overlayfs errors.

Expect EBUSY for overlayfs teardown, and ENOENT for setup.

Test: adb-remount-test.sh
Bug: 131614849
Change-Id: I0fb351d6d5fe758021c9e9043f57863c7a194c12
parent 3c0d7e8d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -111,8 +111,11 @@ static bool set_verity_enabled_state(int fd, const char* block_device, const cha
            WriteFdFmt(fd, "%s overlayfs for %s\n", enable ? "disabling" : "using", mount_point);
        }
    } else if (errno) {
        WriteFdFmt(fd, "Overlayfs %s for %s failed with error %s\n", enable ? "teardown" : "setup",
                   mount_point, strerror(errno));
        int expected_errno = enable ? EBUSY : ENOENT;
        if (errno != expected_errno) {
            WriteFdFmt(fd, "Overlayfs %s for %s failed with error %s\n",
                       enable ? "teardown" : "setup", mount_point, strerror(errno));
        }
    }
    WriteFdFmt(fd, "Verity %s on %s\n", enable ? "enabled" : "disabled", mount_point);
    return true;