Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Last active January 26, 2017 17:13
Show Gist options
  • Save invisiblek/06b64d2df94bdaf237acd63d822d8f11 to your computer and use it in GitHub Desktop.
Save invisiblek/06b64d2df94bdaf237acd63d822d8f11 to your computer and use it in GitHub Desktop.
commit 4dacee69ddac259bc50ac3f353acc11ab273c8c5 (HEAD)
Author: Dan Pasanen <[email protected]>
Date: Thu Jan 26 11:01:59 2017 -0600
bootctl: set a prop for next boot slot
Change-Id: I640f8eeadcc0f3dd0dd70625c9b782f61c20ece6
diff --git a/boot_control.cpp b/boot_control.cpp
index 539c52c..ef2e120 100644
--- a/boot_control.cpp
+++ b/boot_control.cpp
@@ -52,6 +52,7 @@ extern "C" {
#define BOOT_IMG_PTN_NAME "boot"
#define LUN_NAME_END_LOC 14
#define BOOT_SLOT_PROP "ro.boot.slot_suffix"
+#define BOOT_SLOT_PROP_NEXT "boot.slot_suffix.next"
#define SLOT_ACTIVE 1
#define SLOT_INACTIVE 2
@@ -567,10 +568,12 @@ int set_active_boot_slot(struct boot_control_module *module, unsigned slot)
strlen(AB_SLOT_A_SUFFIX))){
//Set xbl_a as the boot lun
rc = gpt_utils_set_xbl_boot_partition(NORMAL_BOOT);
+ property_set(BOOT_SLOT_PROP_NEXT, "_a");
} else if (!strncmp(slot_suffix_arr[slot], AB_SLOT_B_SUFFIX,
strlen(AB_SLOT_B_SUFFIX))){
//Set xbl_b as the boot lun
rc = gpt_utils_set_xbl_boot_partition(BACKUP_BOOT);
+ property_set(BOOT_SLOT_PROP_NEXT, "_b");
} else {
//Something has gone terribly terribly wrong
ALOGE("%s: Unknown slot suffix!", __func__);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment