diff options
author | Alex Ray <aray@google.com> | 2014-03-19 15:47:58 -0700 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2014-03-19 15:57:40 -0700 |
commit | 17ab45450104c18155ae43440a9dda6f89840847 (patch) | |
tree | e4a3f60de0efa0f0add7af039a33e08a926c7934 /fastbootd/trigger.c | |
parent | 3fcd9ed6e3c8f68c59d290f70c09dfb91e167328 (diff) | |
download | core-17ab45450104c18155ae43440a9dda6f89840847.tar.gz core-17ab45450104c18155ae43440a9dda6f89840847.tar.bz2 core-17ab45450104c18155ae43440a9dda6f89840847.zip |
fastbootd: build static binary instead of dynamic
This removes the requirement to hunt down dynamic libs for building an image,
and switches the normal vendor_trigger HAL to a static HAL.
Change-Id: Ifb603f1ee91fbbbff04ddbe66a1bf38a3c22be9e
Diffstat (limited to 'fastbootd/trigger.c')
-rw-r--r-- | fastbootd/trigger.c | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/fastbootd/trigger.c b/fastbootd/trigger.c index e63e64d7c..df0f89571 100644 --- a/fastbootd/trigger.c +++ b/fastbootd/trigger.c @@ -39,52 +39,19 @@ static const int version = 1; -static struct vendor_trigger_t *triggers = NULL; - int load_trigger() { - int err; - hw_module_t* module; - hw_device_t* device; int libversion; - err = hw_get_module(TRIGGER_MODULE_ID, (hw_module_t const**)&module); - - if (err == 0) { - err = module->methods->open(module, NULL, &device); - - if (err == 0) { - triggers = (struct vendor_trigger_t *) device; - } else { - D(WARN, "Libvendor load error"); - return 1; - } - } - else { - D(WARN, "Libvendor not load: %s", strerror(-err)); - return 0; + if (trigger_init() != 0) { + D(ERR, "libvendortrigger failed to initialize"); + return 1; } - if (triggers->check_version != NULL && - triggers->check_version(version, &libversion)) { - - triggers = NULL; + if (trigger_check_version(version, &libversion)) { D(ERR, "Library report incompability"); return 1; } - D(INFO, "libvendortrigger loaded"); + D(INFO, "libvendortrigger loaded"); return 0; } - -int trigger_oem_cmd(const char *arg, const char **response) { - if (triggers != NULL && triggers->oem_cmd != NULL) - return triggers->oem_cmd(arg, response); - return 0; -} - -int trigger_gpt_layout(struct GPT_content *table) { - if (triggers != NULL && triggers->gpt_layout != NULL) - return triggers->gpt_layout(table); - return 0; -} - |