Merge "snapshotctl: Build few commands only for userdebug/eng builds" into main
diff --git a/fs_mgr/libsnapshot/snapshotctl.cpp b/fs_mgr/libsnapshot/snapshotctl.cpp
index 5d3f96c..192e1d6 100644
--- a/fs_mgr/libsnapshot/snapshotctl.cpp
+++ b/fs_mgr/libsnapshot/snapshotctl.cpp
@@ -47,7 +47,9 @@
#include "partition_cow_creator.h"
+#ifdef SNAPSHOTCTL_USERDEBUG_OR_ENG
#include <BootControlClient.h>
+#endif
using namespace std::chrono_literals;
using namespace std::string_literals;
@@ -92,6 +94,7 @@
namespace android {
namespace snapshot {
+#ifdef SNAPSHOTCTL_USERDEBUG_OR_ENG
class MapSnapshots {
public:
MapSnapshots(std::string path = "");
@@ -462,6 +465,7 @@
}
return true;
}
+#endif
bool DumpCmdHandler(int /*argc*/, char** argv) {
android::base::InitLogging(argv, TeeLogger(LogdLogger(), &StderrLogger));
@@ -485,6 +489,7 @@
return false;
}
+#ifdef SNAPSHOTCTL_USERDEBUG_OR_ENG
bool GetVerityPartitions(std::vector<std::string>& partitions) {
auto& dm = android::dm::DeviceMapper::Instance();
auto dm_block_devices = dm.FindDmPartitions();
@@ -637,7 +642,6 @@
return cow.FinishSnapshotWrites();
}
-#ifdef SNAPSHOTCTL_USERDEBUG_OR_ENG
bool CreateTestUpdate(SnapshotManager* sm) {
chromeos_update_engine::DeltaArchiveManifest manifest;
@@ -761,13 +765,13 @@
{"map", MapCmdHandler},
#ifdef SNAPSHOTCTL_USERDEBUG_OR_ENG
{"test-blank-ota", TestOtaHandler},
-#endif
- {"unmap", UnmapCmdHandler},
{"apply-update", ApplyUpdate},
{"map-snapshots", MapPrecreatedSnapshots},
{"unmap-snapshots", UnMapPrecreatedSnapshots},
{"delete-snapshots", DeletePrecreatedSnapshots},
{"revert-snapshots", RemovePrecreatedSnapshots},
+#endif
+ {"unmap", UnmapCmdHandler},
// clang-format on
};