Loading adb/set_verity_enable_state_service.cpp +1 −13 Original line number Original line Diff line number Diff line Loading @@ -93,21 +93,9 @@ static bool set_verity_enabled_state(int fd, const char* block_device, const cha /* Helper function to get A/B suffix, if any. If the device isn't /* Helper function to get A/B suffix, if any. If the device isn't * using A/B the empty string is returned. Otherwise either "_a", * using A/B the empty string is returned. Otherwise either "_a", * "_b", ... is returned. * "_b", ... is returned. * * Note that since sometime in O androidboot.slot_suffix is deprecated * and androidboot.slot should be used instead. Since bootloaders may * be out of sync with the OS, we check both and for extra safety * prepend a leading underscore if there isn't one already. */ */ static std::string get_ab_suffix() { static std::string get_ab_suffix() { std::string ab_suffix = android::base::GetProperty("ro.boot.slot_suffix", ""); return android::base::GetProperty("ro.boot.slot_suffix", ""); if (ab_suffix == "") { ab_suffix = android::base::GetProperty("ro.boot.slot", ""); } if (ab_suffix.size() > 0 && ab_suffix[0] != '_') { ab_suffix = std::string("_") + ab_suffix; } return ab_suffix; } } /* Use AVB to turn verity on/off */ /* Use AVB to turn verity on/off */ Loading fs_mgr/fs_mgr_slotselect.cpp +3 −10 Original line number Original line Diff line number Diff line Loading @@ -21,19 +21,12 @@ #include "fs_mgr.h" #include "fs_mgr.h" #include "fs_mgr_priv.h" #include "fs_mgr_priv.h" // Returns "_a" or "_b" based on two possible values in kernel cmdline: // Returns "_a" or "_b" based on androidboot.slot_suffix in kernel cmdline, or an empty string // - androidboot.slot = a or b OR // if that parameter does not exist. // - androidboot.slot_suffix = _a or _b // TODO: remove slot_suffix once it's deprecated. std::string fs_mgr_get_slot_suffix() { std::string fs_mgr_get_slot_suffix() { std::string slot; std::string ab_suffix; std::string ab_suffix; if (fs_mgr_get_boot_config("slot", &slot)) { fs_mgr_get_boot_config("slot_suffix", &ab_suffix); ab_suffix = "_" + slot; } else if (!fs_mgr_get_boot_config("slot_suffix", &ab_suffix)) { ab_suffix = ""; } return ab_suffix; return ab_suffix; } } Loading Loading
adb/set_verity_enable_state_service.cpp +1 −13 Original line number Original line Diff line number Diff line Loading @@ -93,21 +93,9 @@ static bool set_verity_enabled_state(int fd, const char* block_device, const cha /* Helper function to get A/B suffix, if any. If the device isn't /* Helper function to get A/B suffix, if any. If the device isn't * using A/B the empty string is returned. Otherwise either "_a", * using A/B the empty string is returned. Otherwise either "_a", * "_b", ... is returned. * "_b", ... is returned. * * Note that since sometime in O androidboot.slot_suffix is deprecated * and androidboot.slot should be used instead. Since bootloaders may * be out of sync with the OS, we check both and for extra safety * prepend a leading underscore if there isn't one already. */ */ static std::string get_ab_suffix() { static std::string get_ab_suffix() { std::string ab_suffix = android::base::GetProperty("ro.boot.slot_suffix", ""); return android::base::GetProperty("ro.boot.slot_suffix", ""); if (ab_suffix == "") { ab_suffix = android::base::GetProperty("ro.boot.slot", ""); } if (ab_suffix.size() > 0 && ab_suffix[0] != '_') { ab_suffix = std::string("_") + ab_suffix; } return ab_suffix; } } /* Use AVB to turn verity on/off */ /* Use AVB to turn verity on/off */ Loading
fs_mgr/fs_mgr_slotselect.cpp +3 −10 Original line number Original line Diff line number Diff line Loading @@ -21,19 +21,12 @@ #include "fs_mgr.h" #include "fs_mgr.h" #include "fs_mgr_priv.h" #include "fs_mgr_priv.h" // Returns "_a" or "_b" based on two possible values in kernel cmdline: // Returns "_a" or "_b" based on androidboot.slot_suffix in kernel cmdline, or an empty string // - androidboot.slot = a or b OR // if that parameter does not exist. // - androidboot.slot_suffix = _a or _b // TODO: remove slot_suffix once it's deprecated. std::string fs_mgr_get_slot_suffix() { std::string fs_mgr_get_slot_suffix() { std::string slot; std::string ab_suffix; std::string ab_suffix; if (fs_mgr_get_boot_config("slot", &slot)) { fs_mgr_get_boot_config("slot_suffix", &ab_suffix); ab_suffix = "_" + slot; } else if (!fs_mgr_get_boot_config("slot_suffix", &ab_suffix)) { ab_suffix = ""; } return ab_suffix; return ab_suffix; } } Loading