summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 7f4a0dd66..3f8bc8f3a 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1742,6 +1742,14 @@ int main(int argc, char **argv)
} else if(!strcmp(*argv, "set_active")) {
require(2);
std::string slot = verify_slot(transport, std::string(argv[1]), false);
+ // Legacy support: verify_slot() removes leading underscores, we need to put them back
+ // in for old bootloaders. Legacy bootloaders do not have the slot-count variable but
+ // do have slot-suffixes.
+ std::string var;
+ if (!fb_getvar(transport, "slot-count", &var) &&
+ fb_getvar(transport, "slot-suffixes", &var)) {
+ slot = "_" + slot;
+ }
fb_set_active(slot.c_str());
skip(2);
} else if(!strcmp(*argv, "oem")) {