Loading fs_mgr/libsnapshot/scratch_super.cpp +17 −7 Original line number Diff line number Diff line Loading @@ -25,6 +25,13 @@ #include <sys/vfs.h> #include <unistd.h> #include <algorithm> #include <filesystem> #include <memory> #include <optional> #include <string> #include <vector> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/macros.h> Loading @@ -41,12 +48,6 @@ #include <fstab/fstab.h> #include <liblp/builder.h> #include <storage_literals/storage_literals.h> #include <algorithm> #include <filesystem> #include <memory> #include <optional> #include <string> #include <vector> #include "device_info.h" #include "scratch_super.h" Loading @@ -60,9 +61,18 @@ namespace android { namespace snapshot { static bool UmountScratch() { Fstab fstab; if (!ReadFstabFromProcMounts(&fstab)) { LOG(ERROR) << "Cannot read /proc/mounts"; return false; } if (GetEntryForMountPoint(&fstab, kOtaMetadataMount) == nullptr) { return true; } auto ota_dir = std::string(kOtaMetadataMount) + "/" + "ota"; std::error_code ec; std::error_code ec; if (std::filesystem::remove_all(ota_dir, ec) == static_cast<std::uintmax_t>(-1)) { LOG(ERROR) << "Failed to remove OTA directory: " << ec.message(); return false; Loading fs_mgr/libsnapshot/snapshot_test.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -1345,6 +1345,7 @@ class SnapshotUpdateTest : public SnapshotTest { TEST_F(SnapshotUpdateTest, SuperOtaMetadataTest) { auto info = new TestDeviceInfo(fake_super); ASSERT_TRUE(CleanupScratchOtaMetadataIfPresent(info)); ASSERT_TRUE(CreateScratchOtaMetadataOnSuper(info)); std::string scratch_device = GetScratchOtaMetadataPartition(); ASSERT_NE(scratch_device, ""); Loading Loading
fs_mgr/libsnapshot/scratch_super.cpp +17 −7 Original line number Diff line number Diff line Loading @@ -25,6 +25,13 @@ #include <sys/vfs.h> #include <unistd.h> #include <algorithm> #include <filesystem> #include <memory> #include <optional> #include <string> #include <vector> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/macros.h> Loading @@ -41,12 +48,6 @@ #include <fstab/fstab.h> #include <liblp/builder.h> #include <storage_literals/storage_literals.h> #include <algorithm> #include <filesystem> #include <memory> #include <optional> #include <string> #include <vector> #include "device_info.h" #include "scratch_super.h" Loading @@ -60,9 +61,18 @@ namespace android { namespace snapshot { static bool UmountScratch() { Fstab fstab; if (!ReadFstabFromProcMounts(&fstab)) { LOG(ERROR) << "Cannot read /proc/mounts"; return false; } if (GetEntryForMountPoint(&fstab, kOtaMetadataMount) == nullptr) { return true; } auto ota_dir = std::string(kOtaMetadataMount) + "/" + "ota"; std::error_code ec; std::error_code ec; if (std::filesystem::remove_all(ota_dir, ec) == static_cast<std::uintmax_t>(-1)) { LOG(ERROR) << "Failed to remove OTA directory: " << ec.message(); return false; Loading
fs_mgr/libsnapshot/snapshot_test.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -1345,6 +1345,7 @@ class SnapshotUpdateTest : public SnapshotTest { TEST_F(SnapshotUpdateTest, SuperOtaMetadataTest) { auto info = new TestDeviceInfo(fake_super); ASSERT_TRUE(CleanupScratchOtaMetadataIfPresent(info)); ASSERT_TRUE(CreateScratchOtaMetadataOnSuper(info)); std::string scratch_device = GetScratchOtaMetadataPartition(); ASSERT_NE(scratch_device, ""); Loading