diff options
author | Yo Chiang <yochiang@google.com> | 2020-12-31 03:51:41 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-12-31 03:51:41 +0000 |
commit | fce7f2636c8612a9a892bbf82766e06a1f4fe263 (patch) | |
tree | 6845b973204f4c0b13fabe464bb6338d445d0063 | |
parent | 5e16e7a07b143c75566e90926f16ca40296f0f15 (diff) | |
parent | f9f5dbb8970ca9d882b1279c71485c2dc76c56ec (diff) | |
download | gsid-fce7f2636c8612a9a892bbf82766e06a1f4fe263.tar.gz |
gsi_tool: check closePartition() after installation am: f9f5dbb897
Original change: https://android-review.googlesource.com/c/platform/system/gsid/+/1536724
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I0a41122909060664185d1b1b155ab4e3c4ef2997
-rw-r--r-- | gsi_tool.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gsi_tool.cpp b/gsi_tool.cpp index 56d6de1..c6057a2 100644 --- a/gsi_tool.cpp +++ b/gsi_tool.cpp @@ -278,6 +278,12 @@ static int Install(sp<IGsiService> gsid, int argc, char** argv) { << "\n"; return EX_SOFTWARE; } + status = gsid->closePartition(&error); + if (!status.isOk() || error != IGsiService::INSTALL_OK) { + std::cerr << "Could not closePartition(userdata): " << ErrorMessage(status, error) + << std::endl; + return EX_SOFTWARE; + } } status = gsid->createPartition(partition, gsiSize, true, &error); @@ -295,6 +301,13 @@ static int Install(sp<IGsiService> gsid, int argc, char** argv) { return EX_SOFTWARE; } + status = gsid->closePartition(&error); + if (!status.isOk() || error != IGsiService::INSTALL_OK) { + std::cerr << "Could not closePartition(" << partition + << "): " << ErrorMessage(status, error) << std::endl; + return EX_SOFTWARE; + } + status = gsid->closeInstall(&error); if (!status.isOk() || error != IGsiService::INSTALL_OK) { std::cerr << "Could not close DSU installation: " << ErrorMessage(status, error) << "\n"; @@ -417,6 +430,12 @@ static int CreatePartition(sp<IGsiService> gsid, int argc, char** argv) { } } + status = gsid->closePartition(&error); + if (!status.isOk() || error != IGsiService::INSTALL_OK) { + std::cerr << "Could not close DSU partition:" << ErrorMessage(status, error) << std::endl; + return EX_SOFTWARE; + } + status = gsid->closeInstall(&error); if (!status.isOk() || error != IGsiService::INSTALL_OK) { std::cerr << "Could not close DSU installation: " << ErrorMessage(status, error) |