Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "update bootctrl with kernelflinger" #13

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 18 additions & 33 deletions boot_control_avb.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#include <string.h>

#include <cutils/properties.h>
#include <hardware/boot_control.h>
#include <hardware/hardware.h>

#include <libavb_ab/libavb_ab.h>
#include <libavb_user/libavb_user.h>

#include "boot_control_avb.h"

static AvbOps* ops = NULL;

static void module_init(boot_control_module_t* module) {
Expand Down Expand Up @@ -115,9 +115,9 @@ static int module_isSlotBootable(struct boot_control_module* module,
return -EIO;
}

is_bootable = (ab_data.slot_info[slot].priority > 0) &&
(ab_data.slot_info[slot].successful_boot ||
(ab_data.slot_info[slot].tries_remaining > 0));
is_bootable = (ab_data.slots[slot].priority > 0) &&
(ab_data.slots[slot].successful_boot ||
(ab_data.slots[slot].tries_remaining > 0));

return is_bootable ? 1 : 0;
}
Expand All @@ -135,7 +135,7 @@ static int module_isSlotMarkedSuccessful(struct boot_control_module* module,
return -EIO;
}

is_marked_successful = ab_data.slot_info[slot].successful_boot;
is_marked_successful = ab_data.slots[slot].successful_boot;

return is_marked_successful ? 1 : 0;
}
Expand All @@ -149,24 +149,12 @@ static const char* module_getSuffix(boot_control_module_t* module,
return suffix[slot];
}

static bool module_setSnapshotMergeStatus(uint8_t status) {
if (avb_ab_set_snapshot_merge_status(ops->ab_ops, status) == AVB_IO_RESULT_OK)
return true;
else
return false;
}

static uint8_t module_getSnapshotMergeStatus(void) {
return avb_ab_get_snapshot_merge_status(ops->ab_ops);
}

static struct hw_module_methods_t module_methods = {
.open = NULL,
};

private_boot_control_t HAL_MODULE_INFO_SYM = {
.base = {
.common =
boot_control_module_t HAL_MODULE_INFO_SYM = {
.common =
{
.tag = HARDWARE_MODULE_TAG,
.module_api_version = BOOT_CONTROL_MODULE_API_VERSION_0_1,
Expand All @@ -176,17 +164,14 @@ private_boot_control_t HAL_MODULE_INFO_SYM = {
.author = "The Android Open Source Project",
.methods = &module_methods,
},
.init = module_init,
.getNumberSlots = module_getNumberSlots,
.getCurrentSlot = module_getCurrentSlot,
.markBootSuccessful = module_markBootSuccessful,
.setActiveBootSlot = module_setActiveBootSlot,
.setSlotAsUnbootable = module_setSlotAsUnbootable,
.isSlotBootable = module_isSlotBootable,
.getSuffix = module_getSuffix,
.isSlotMarkedSuccessful = module_isSlotMarkedSuccessful,
.getActiveBootSlot = module_getActiveBootSlot,
},
.SetSnapshotMergeStatus = module_setSnapshotMergeStatus,
.GetSnapshotMergeStatus = module_getSnapshotMergeStatus,
.init = module_init,
.getNumberSlots = module_getNumberSlots,
.getCurrentSlot = module_getCurrentSlot,
.markBootSuccessful = module_markBootSuccessful,
.setActiveBootSlot = module_setActiveBootSlot,
.setSlotAsUnbootable = module_setSlotAsUnbootable,
.isSlotBootable = module_isSlotBootable,
.getSuffix = module_getSuffix,
.isSlotMarkedSuccessful = module_isSlotMarkedSuccessful,
.getActiveBootSlot = module_getActiveBootSlot,
};
38 changes: 0 additions & 38 deletions boot_control_avb.h

This file was deleted.

Loading