summaryrefslogtreecommitdiff
path: root/fastboot/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fastboot/engine.cpp')
-rw-r--r--fastboot/engine.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/fastboot/engine.cpp b/fastboot/engine.cpp
index d80bc0624..a43e7a6bb 100644
--- a/fastboot/engine.cpp
+++ b/fastboot/engine.cpp
@@ -136,69 +136,6 @@ void fb_resize_partition(const std::string& partition, const std::string& size)
RUN_COMMAND(fb->RawCommand(FB_CMD_RESIZE_PARTITION ":" + partition + ":" + size));
}
-static int match(const char* str, const char** value, unsigned count) {
- unsigned n;
-
- for (n = 0; n < count; n++) {
- const char *val = value[n];
- int len = strlen(val);
- int match;
-
- if ((len > 1) && (val[len-1] == '*')) {
- len--;
- match = !strncmp(val, str, len);
- } else {
- match = !strcmp(val, str);
- }
-
- if (match) return 1;
- }
-
- return 0;
-}
-
-void fb_require(const std::string& product, const std::string& var, bool invert, size_t count,
- const char** values) {
- Status("Checking '" + var + "'");
-
- double start = now();
-
- std::string var_value;
- auto status = fb->GetVar(var, &var_value);
-
- if (status) {
- fprintf(stderr, "getvar:%s FAILED (%s)\n", var.c_str(), fb->Error().c_str());
- die("requirements not met!");
- }
-
- if (!product.empty()) {
- if (product != cur_product) {
- double split = now();
- fprintf(stderr, "IGNORE, product is %s required only for %s [%7.3fs]\n", cur_product,
- product.c_str(), (split - start));
- return;
- }
- }
-
- int yes = match(var_value.c_str(), values, count);
- if (invert) yes = !yes;
-
- if (yes) {
- double split = now();
- fprintf(stderr, "OKAY [%7.3fs]\n", (split - start));
- return;
- }
-
- fprintf(stderr, "FAILED\n\n");
- fprintf(stderr, "Device %s is '%s'.\n", var.c_str(), var_value.c_str());
- fprintf(stderr, "Update %s '%s'", invert ? "rejects" : "requires", values[0]);
- for (size_t n = 1; n < count; n++) {
- fprintf(stderr, " or '%s'", values[n]);
- }
- fprintf(stderr, ".\n\n");
- die("requirements not met!");
-}
-
void fb_display(const std::string& label, const std::string& var) {
std::string value;
auto status = fb->GetVar(var, &value);
@@ -210,18 +147,6 @@ void fb_display(const std::string& label, const std::string& var) {
fprintf(stderr, "%s: %s\n", label.c_str(), value.c_str());
}
-void fb_query_save(const std::string& var, char* dest, uint32_t dest_size) {
- std::string value;
- auto status = fb->GetVar(var, &value);
-
- if (status) {
- fprintf(stderr, "getvar:%s FAILED (%s)\n", var.c_str(), fb->Error().c_str());
- return;
- }
-
- strncpy(dest, value.c_str(), dest_size);
-}
-
void fb_reboot() {
fprintf(stderr, "Rebooting");
fb->Reboot();