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

Commit 16f94816 authored by Pechetty Sravani (xWF)'s avatar Pechetty Sravani (xWF) Committed by Matt Gilbride
Browse files

Revert "Support vendor partition in non-debuggable pVMs"

Revert submission 3236797-b/340506965

Reason for revert: DroidMonitor created revert due to b/366178299.

Reverted changes: /q/submissionid:3236797-b/340506965

Tracking bug: b/369390218

Change-Id: I0ec7fe89a7a0ca3a9981cd80222d03a785e9b28f
parent 9ac82420
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -156,13 +156,6 @@ static Result<Fstab> ReadFirstStageFstabAndroid() {
    return fstab;
}

static bool IsRequestingMicrodroidVendorPartition(const std::string& cmdline) {
    if (virtualization::IsEnableTpuAssignableDeviceFlagEnabled()) {
        return access("/proc/device-tree/avf/vendor_hashtree_descriptor_root_digest", F_OK) == 0;
    }
    return cmdline.find("androidboot.microdroid.mount_vendor=1") != std::string::npos;
}

// Note: this is a temporary solution to avoid blocking devs that depend on /vendor partition in
// Microdroid. For the proper solution the /vendor fstab should probably be defined in the DT.
// TODO(b/285855430): refactor this
@@ -173,7 +166,7 @@ static Result<Fstab> ReadFirstStageFstabMicrodroid(const std::string& cmdline) {
    if (!ReadDefaultFstab(&fstab)) {
        return Error() << "failed to read fstab";
    }
    if (!IsRequestingMicrodroidVendorPartition(cmdline)) {
    if (cmdline.find("androidboot.microdroid.mount_vendor=1") == std::string::npos) {
        // We weren't asked to mount /vendor partition, filter it out from the fstab.
        auto predicate = [](const auto& entry) { return entry.mount_point == "/vendor"; };
        fstab.erase(std::remove_if(fstab.begin(), fstab.end(), predicate), fstab.end());