summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor O'Brien <connoro@google.com>2017-11-01 21:43:17 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-11-01 21:43:17 +0000
commit23ab93d117a60ecd427458e57344316814ae5218 (patch)
treecf68156dca7977ce20d646e60cf0578e57fb2326
parent93a61da1e6caf7ed7c6ba935ead48f4f7fde4382 (diff)
parent8d5e2b337916fd8df3175f39e7b56e146a1f8ba3 (diff)
downloadandroid_hardware_qcom_bootctrl-23ab93d117a60ecd427458e57344316814ae5218.tar.gz
android_hardware_qcom_bootctrl-23ab93d117a60ecd427458e57344316814ae5218.tar.bz2
android_hardware_qcom_bootctrl-23ab93d117a60ecd427458e57344316814ae5218.zip
bootcontrol: count slots correctly
am: 8d5e2b3379 Change-Id: I2b9ee751dcb3ce25e0db3531e4d550f45fe5d23a
-rw-r--r--boot_control.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/boot_control.cpp b/boot_control.cpp
index 539c52c..912e382 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++;