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

Commit 5ca85a05 authored by Yo Chiang's avatar Yo Chiang Committed by Gerrit Code Review
Browse files

Merge "Improve ImageManager error message"

parents 36a21704 93c78c24
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -640,16 +640,22 @@ bool ImageManager::Validate() {
        return false;
    }

    bool ok = true;
    for (const auto& partition : metadata->partitions) {
        auto name = GetPartitionName(partition);
        auto image_path = GetImageHeaderPath(name);
        auto fiemap = SplitFiemap::Open(image_path);
        if (!fiemap || !fiemap->HasPinnedExtents()) {
            LOG(ERROR) << "Image is missing or was moved: " << image_path;
            return false;
        if (fiemap == nullptr) {
            LOG(ERROR) << "SplitFiemap::Open(\"" << image_path << "\") failed";
            ok = false;
            continue;
        }
        if (!fiemap->HasPinnedExtents()) {
            LOG(ERROR) << "Image doesn't have pinned extents: " << image_path;
            ok = false;
        }
    return true;
    }
    return ok;
}

bool ImageManager::DisableImage(const std::string& name) {