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

Commit 46f88817 authored by David Anderson's avatar David Anderson Committed by Automerger Merge Worker
Browse files

Merge "fs_mgr: Allow commas in boot device paths." am: f9459a45 am: e64cc297

Change-Id: Id18c6ebb4b2856d270b1a1652d589864e69a1935
parents 2b5ac84d e64cc297
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -829,6 +829,20 @@ std::set<std::string> GetBootDevices() {
        return std::set<std::string>(boot_devices.begin(), boot_devices.end());
    }

    std::string cmdline;
    if (android::base::ReadFileToString("/proc/cmdline", &cmdline)) {
        std::set<std::string> boot_devices;
        const std::string cmdline_key = "androidboot.boot_device";
        for (const auto& [key, value] : fs_mgr_parse_boot_config(cmdline)) {
            if (key == cmdline_key) {
                boot_devices.emplace(value);
            }
        }
        if (!boot_devices.empty()) {
            return boot_devices;
        }
    }

    // Fallback to extract boot devices from fstab.
    Fstab fstab;
    if (!ReadDefaultFstab(&fstab)) {