summaryrefslogtreecommitdiffstats
path: root/fs_mgr
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-09-21 18:51:15 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-09-21 18:51:15 +0000
commitb616ea40686c279690a6a4093c7a68f20a7dd15d (patch)
tree799d8fe7476d92181ab152f7380fdb329d5f3973 /fs_mgr
parent33b23ae8b282493126a5c2081163c22d2ade6c23 (diff)
parentaea4f28852f7a9f10027b080e909893af3dfd2e0 (diff)
downloadsystem_core-b616ea40686c279690a6a4093c7a68f20a7dd15d.tar.gz
system_core-b616ea40686c279690a6a4093c7a68f20a7dd15d.tar.bz2
system_core-b616ea40686c279690a6a4093c7a68f20a7dd15d.zip
Merge "Revert "Remove comments and code about ro.boot.slot"" am: eb00b1f3aa am: 0ff5f16f7b
am: aea4f28852 Change-Id: Ia2959362f8a48e1d3638a76e9c72f04d276cd5bc
Diffstat (limited to 'fs_mgr')
-rw-r--r--fs_mgr/fs_mgr_slotselect.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs_mgr/fs_mgr_slotselect.cpp b/fs_mgr/fs_mgr_slotselect.cpp
index 33fd56240..9ca15e237 100644
--- a/fs_mgr/fs_mgr_slotselect.cpp
+++ b/fs_mgr/fs_mgr_slotselect.cpp
@@ -21,12 +21,19 @@
#include "fs_mgr.h"
#include "fs_mgr_priv.h"
-// Returns "_a" or "_b" based on androidboot.slot_suffix in kernel cmdline, or an empty string
-// if that parameter does not exist.
+// Returns "_a" or "_b" based on two possible values in kernel cmdline:
+// - androidboot.slot = a or b OR
+// - androidboot.slot_suffix = _a or _b
+// TODO: remove slot_suffix once it's deprecated.
std::string fs_mgr_get_slot_suffix() {
+ std::string slot;
std::string ab_suffix;
- fs_mgr_get_boot_config("slot_suffix", &ab_suffix);
+ if (fs_mgr_get_boot_config("slot", &slot)) {
+ ab_suffix = "_" + slot;
+ } else if (!fs_mgr_get_boot_config("slot_suffix", &ab_suffix)) {
+ ab_suffix = "";
+ }
return ab_suffix;
}