summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor O'Brien <connoro@google.com>2017-11-01 21:55:17 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-11-01 21:55:17 +0000
commit287524db3f7710958b1d45dcdfe27455c7082930 (patch)
tree11e056bb3d72d766f16136e04a48afd77c52bf59
parentd794cadaa862d4074e9a2778e92acf7b3dd02515 (diff)
parentae402134df65bb89beada945dfa0aba0c09b989e (diff)
downloadandroid_hardware_qcom_bootctrl-287524db3f7710958b1d45dcdfe27455c7082930.tar.gz
android_hardware_qcom_bootctrl-287524db3f7710958b1d45dcdfe27455c7082930.tar.bz2
android_hardware_qcom_bootctrl-287524db3f7710958b1d45dcdfe27455c7082930.zip
bootcontrol: count slots correctly am: 8d5e2b3379 am: 23ab93d117
am: ae402134df Change-Id: I812c1939254ad3a3f56073d58dfe734b12116744
-rw-r--r--boot_control.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/boot_control.cpp b/boot_control.cpp
index 435ea2f..947e0d5 100644
--- a/boot_control.cpp
+++ b/boot_control.cpp
@@ -49,7 +49,7 @@ extern "C" {
#include "gpt-utils.h"
#define BOOTDEV_DIR "/dev/block/bootdevice/by-name"
-#define BOOT_IMG_PTN_NAME "boot"
+#define BOOT_IMG_PTN_NAME "boot_"
#define LUN_NAME_END_LOC 14
#define BOOT_SLOT_PROP "ro.boot.slot_suffix"
@@ -266,6 +266,8 @@ unsigned get_number_slots(struct boot_control_module *module)
while ((de = readdir(dir_bootdev))) {
if (de->d_name[0] == '.')
continue;
+ static_assert(AB_SLOT_A_SUFFIX[0] == '_', "Breaking change to slot A suffix");
+ static_assert(AB_SLOT_B_SUFFIX[0] == '_', "Breaking change to slot B suffix");
if (!strncmp(de->d_name, BOOT_IMG_PTN_NAME,
strlen(BOOT_IMG_PTN_NAME)))
slot_count++;