From a29d3921698a562492716d8f9f82fbd7249d0bbb Mon Sep 17 00:00:00 2001 From: Seungha Son Date: Wed, 28 Jul 2021 20:31:17 +0900 Subject: [PATCH 01/16] halapi: Delete unused code to make directory %{TZ_SYS_RO_ETC}/hal is not used directory then delete unused behavior to keep clean code. Change-Id: Icc7a1085ab42fc2018ab5deb5e29bd5e983a8fea Signed-off-by: Seungha Son --- packaging/hal-api-common.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index 332b249..55ad46f 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -89,11 +89,6 @@ rm -rf %{buildroot} /sbin/ldconfig chsmack -a "System" -t %{hal_rpmdb_checker_path} -if [ ! -d %{TZ_SYS_RO_ETC} ] -then - mkdir -p %{TZ_SYS_RO_ETC}/hal -fi - %postun /sbin/ldconfig -- 2.7.4 From 78cc3efa9d322471a9fb7389ec5350d4d12a61ac Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 19 Aug 2021 15:40:22 +0900 Subject: [PATCH 02/16] hal-rpmdb-checker: Add capability for /opt/etc/hal path hal-rpmdb-checker.service has used /opt/etc/hal path in order to create the files for both checking the platform booting is first booting and hal rpmdb version are matched or not. So that /opt/etc/hal patch should be set with the proper capability with UID/GID/Smack lable. Change-Id: I07bec1b2f824d8a0114659346bab09911f863e42 Signed-off-by: Chanwoo Choi --- CMakeLists.txt | 2 ++ packaging/hal-api-common.spec | 2 ++ packaging/hal-rpmdb-checker.conf | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 packaging/hal-rpmdb-checker.conf diff --git a/CMakeLists.txt b/CMakeLists.txt index cc86597..260849c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,5 +51,7 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ FILES_MATCHING PATTERN "*.h") INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/hal-rpmdb-checker.conf + DESTINATION /usr/lib/tmpfiles.d) ADD_SUBDIRECTORY(tests) diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index 55ad46f..c699c35 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -88,6 +88,7 @@ rm -rf %{buildroot} %post /sbin/ldconfig chsmack -a "System" -t %{hal_rpmdb_checker_path} +systemd-tmpfiles /usr/lib/tmpfiles.d/hal-rpmdb-checker.conf --create %postun /sbin/ldconfig @@ -118,3 +119,4 @@ chsmack -a "System" -t %{hal_rpmdb_checker_path} %{_unitdir}/sysinit.target.wants/hal-rpmdb-checker.service %{_unitdir}/hal-rpmdb-checker.service %{_bindir}/hal-rpmdb-checker +/usr/lib/tmpfiles.d/hal-rpmdb-checker.conf diff --git a/packaging/hal-rpmdb-checker.conf b/packaging/hal-rpmdb-checker.conf new file mode 100644 index 0000000..ce40897 --- /dev/null +++ b/packaging/hal-rpmdb-checker.conf @@ -0,0 +1,2 @@ +z /opt/etc/hal/* 0664 root system_fw - +t /opt/etc/hal/* - - - - security.SMACK64="System" -- 2.7.4 From d3ea592d1851e7114a1e0cfc8c88b654907e5acb Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 20 Aug 2021 12:40:40 +0900 Subject: [PATCH 03/16] halapi: Add ENABLE_DLOG build option Add ENABLE_DLOG build option to support the case of when DLOG should be disabled. Also, if don't require dlog, hal-api-common is not able to use tizen error value. So that change the error value to make it minimum package dependency. Change-Id: I52766750c3b8b547dbc9e2576e0e9a8b3d2b1232 Signed-off-by: Chanwoo Choi --- CMakeLists.txt | 12 ++++- packaging/hal-api-common.spec | 4 +- src/common.h | 10 +++- src/hal-api-common.c | 115 +++++++++++++++++++++--------------------- 4 files changed, 79 insertions(+), 62 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 260849c..9a318e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,12 +12,22 @@ SET(LIBDIR ${CMAKE_LIBDIR_PREFIX}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src) +if (${ENABLE_DLOG}) +ADD_DEFINITIONS("-DENABLE_DLOG=1") +ADD_DEFINITIONS("-DLOG_TAG=\"HALAPI_COMMON\"") SET(PKG_MODULES dlog gio-2.0 glib-2.0 json-c ) +else() +SET(PKG_MODULES + gio-2.0 + glib-2.0 + json-c +) +endif() INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED ${PKG_MODULES}) @@ -31,8 +41,6 @@ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functi SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -lrt") SET(CMAKE_EXE_LINKER_FLAGS "-pie") -ADD_DEFINITIONS("-DLOG_TAG=\"HALAPI_COMMON\"") - SET(SRCS src/hal-api-common.c src/hal-api-conf.c) diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index c699c35..4aeeb86 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -56,7 +56,9 @@ Haltests for hal-api-common %define hal_rpmdb_checker_path /opt/etc/hal -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_LIBDIR_PREFIX=%{_libdir} +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_LIBDIR_PREFIX=%{_libdir} \ + -DENABLE_DLOG=1 %build cp %{SOURCE1} . diff --git a/src/common.h b/src/common.h index b567f8b..4a89747 100644 --- a/src/common.h +++ b/src/common.h @@ -18,7 +18,6 @@ #define __COMMON_H__ #include -#include #include "hal-common.h" @@ -26,10 +25,19 @@ extern "C" { #endif +#ifdef ENABLE_DLOG +#include + #define _D(fmt, args...) SLOGD(fmt, ##args) #define _I(fmt, args...) SLOGI(fmt, ##args) #define _W(fmt, args...) SLOGW(fmt, ##args) #define _E(fmt, args...) SLOGE(fmt, ##args) +#else +#define _D(fmt, args...) do { } while(0) +#define _I(fmt, args...) do { } while(0) +#define _W(fmt, args...) do { } while(0) +#define _E(fmt, args...) do { } while(0) +#endif #define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0])) diff --git a/src/hal-api-common.c b/src/hal-api-common.c index c825c3f..22c50e8 100644 --- a/src/hal-api-common.c +++ b/src/hal-api-common.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #define _GNU_SOURCE @@ -51,36 +50,36 @@ int hal_common_get_backend_library_name(enum hal_module module, char *name, int /* Check parameter whether is valid or not */ if (module <= HAL_MODULE_UNKNOWN || module >= HAL_MODULE_END) { _E("Invalid parameter of HAL module (%d)\n", module); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } if (_hal_api_conf_init()) - return TIZEN_ERROR_UNKNOWN; + return -EINVAL; info = _hal_api_conf_get_module_info(module, NULL); if (info == NULL) { _E("Failed to get HAL module(%d) information\n", module); - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto out; } library_name = get_backend_library_name(info); if (!library_name) { _E("%s backend library name is NULL\n", info->module_name); - ret = TIZEN_ERROR_NONE; + ret = 0; goto out; } len_library_name = strlen(library_name); if (!name || (len_library_name + 1 > size)) { - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; name = NULL; goto out; } strncpy(name, library_name, len_library_name); name[len_library_name] = '\0'; - ret = TIZEN_ERROR_NONE; + ret = 0; out: _hal_api_conf_exit(); @@ -98,35 +97,35 @@ int hal_common_get_backend_symbol_name(enum hal_module module, char *name, int s /* Check parameter whether is valid or not */ if (module <= HAL_MODULE_UNKNOWN || module >= HAL_MODULE_END) { _E("Invalid paramer of HAL module (%d)\n", module); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } if (_hal_api_conf_init()) - return TIZEN_ERROR_UNKNOWN; + return -EINVAL; info = _hal_api_conf_get_module_info(module, NULL); if (info == NULL) { _E("Failed to get HAL module(%d) information\n", module); - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto out; } symbol_name = info->symbol_name; if (!symbol_name) { _E("%s backend symbol name is NULL\n", info->module_name); - ret = TIZEN_ERROR_NONE; + ret = 0; goto out; } len_symbol_name = strlen(symbol_name); if (!name || (len_symbol_name + 1 > size)) { - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; name = NULL; goto out; } strncpy(name, symbol_name, len_symbol_name); name[len_symbol_name] = '\0'; - ret = TIZEN_ERROR_NONE; + ret = 0; out: _hal_api_conf_exit(); @@ -145,14 +144,14 @@ static int __open_backend(struct __hal_module_info *info) if (!backend_library_name) { _E("%s: Failed to get backend library name\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err; } if (!info->symbol_name) { _E("%s: Failed to get backend symbol name\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err; } @@ -160,7 +159,7 @@ static int __open_backend(struct __hal_module_info *info) if (!info->handle) { _E("%s: Failed to load backend library (%s)\n", info->module_name, dlerror()); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err; } @@ -168,7 +167,7 @@ static int __open_backend(struct __hal_module_info *info) if (!info->backend) { _E("%s: Failed to find backend data (%s)\n", info->module_name, dlerror()); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err_dlclose; } @@ -212,12 +211,12 @@ static int __init_backend(struct __hal_module_info *info, void **data, if (!info->handle || !info->backend) { _I("%s: Has not yet dlopend backend\n", info->module_name); - return TIZEN_ERROR_NONE; + return 0; } if (!info->backend->init) { _E("%s: hal_backend->init() is NULL\n", info->module_name); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } /* Check HAL ABI Version */ @@ -225,7 +224,7 @@ static int __init_backend(struct __hal_module_info *info, void **data, info->backend->abi_version); if (ret < 0) { _E("%s: Failed to check ABI version\n", info->module_name); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } /* Initialize backend */ @@ -234,10 +233,10 @@ static int __init_backend(struct __hal_module_info *info, void **data, _E("%s: Failed to initialize backend: name(%s)/vendor(%s)\n", info->module_name, info->backend->name, info->backend->vendor); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } - return TIZEN_ERROR_NONE; + return 0; } static int __exit_backend(struct __hal_module_info *info, void *data, @@ -247,7 +246,7 @@ static int __exit_backend(struct __hal_module_info *info, void *data, if (!info->handle || !info->backend) { _I("%s: Has not yet dlopend backend\n", info->module_name); - return TIZEN_ERROR_NONE; + return 0; } /* Exit backend */ @@ -257,7 +256,7 @@ static int __exit_backend(struct __hal_module_info *info, void *data, _E("%s: Failed to exit backend: name(%s)/vendor(%s)\n", info->module_name, info->backend->name, info->backend->vendor); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } } @@ -272,12 +271,12 @@ static int __get_backend(enum hal_module module, void **data, if (module <= HAL_MODULE_UNKNOWN || module >= HAL_MODULE_END) { _E("Invalid parameter of HAL module (%d)\n", module); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } G_LOCK(hal_common_lock); if (_hal_api_conf_init()) { - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto err; } @@ -288,7 +287,7 @@ static int __get_backend(enum hal_module module, void **data, else _E("Failed to get HAL module(%d) information (%s)\n", module, library_name); - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto err; } @@ -296,7 +295,7 @@ static int __get_backend(enum hal_module module, void **data, if (ret < 0) { _E("%s: Failed to get the backend library by dlopen\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err; } @@ -304,7 +303,7 @@ static int __get_backend(enum hal_module module, void **data, if (ret < 0) { _E("%s: Failed to initialize the backend library\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err_dlclose; } @@ -316,7 +315,7 @@ static int __get_backend(enum hal_module module, void **data, program_invocation_name); G_UNLOCK(hal_common_lock); - return TIZEN_ERROR_NONE; + return 0; err_dlclose: _hal_api_conf_exit(); @@ -335,7 +334,7 @@ static int __put_backend(enum hal_module module, void *data, /* Check parameter whether is valid or not */ if (module <= HAL_MODULE_UNKNOWN || module >= HAL_MODULE_END) { _E("Invalid parameter of HAL module (%d)\n", module); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } G_LOCK(hal_common_lock); @@ -343,19 +342,19 @@ static int __put_backend(enum hal_module module, void *data, info = _hal_api_conf_get_module_info(module, library_name); if (info == NULL) { _E("Failed to get HAL module(%d) information\n", module); - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto out; } if (!info->handle || !info->backend) { _I("%s: Has not yet dlopend backend\n", info->module_name); - ret = TIZEN_ERROR_NONE; + ret = 0; goto out; } if (!info->usage_count) { _I("%s: Already fully put for HAL module\n", info->module_name); - ret = TIZEN_ERROR_NONE; + ret = 0; goto out; } @@ -363,7 +362,7 @@ static int __put_backend(enum hal_module module, void *data, if (ret < 0) { _E("%s: Failed to exit the backend library\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto out; } @@ -375,14 +374,14 @@ static int __put_backend(enum hal_module module, void *data, program_invocation_name); if (info->usage_count > 0) { - ret = TIZEN_ERROR_NONE; + ret = 0; goto out; } __close_backend(info); _hal_api_conf_exit(); - ret = TIZEN_ERROR_NONE; + ret = 0; out: G_UNLOCK(hal_common_lock); @@ -418,7 +417,7 @@ static int __get_backend_data(enum hal_module module, unsigned int *abi_version, if (ret < 0) { _E("%s: Failed to get the backend library by dlopen\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err_conf_exit; } @@ -432,7 +431,7 @@ static int __get_backend_data(enum hal_module module, unsigned int *abi_version, if (!info->backend->name || (len + 1 > name_size)) { _E("%s: Invalid size of name[] array\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err_conf_exit; } @@ -445,7 +444,7 @@ static int __get_backend_data(enum hal_module module, unsigned int *abi_version, if (!info->backend->vendor || (len + 1 > vendor_size)) { _E("%s: Invalid size of vendor[] array\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err_conf_exit; } @@ -453,10 +452,10 @@ static int __get_backend_data(enum hal_module module, unsigned int *abi_version, vendor[len] = '\0'; } else { _E("%s: Failed to get backend data\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err_conf_exit; } - ret = TIZEN_ERROR_NONE; + ret = 0; err_conf_exit: _hal_api_conf_exit(); @@ -502,30 +501,30 @@ int hal_common_check_backend_abi_version(enum hal_module module, /* Check parameter whether is valid or not */ if (module <= HAL_MODULE_UNKNOWN || module >= HAL_MODULE_END) { _E("Invalid paramer of HAL module(%d)\n", module); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } if (abi_version <= HAL_ABI_VERSION_UNKNOWN || abi_version >= HAL_ABI_VERSION_END) { _E("Invalid paramer of HAL ABI version(%d) for HAL module(%d)\n", abi_version, module); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } if (_hal_api_conf_init()) - return TIZEN_ERROR_UNKNOWN; + return -EINVAL; info = _hal_api_conf_get_module_info(module, NULL); if (info == NULL) { _E("Failed to get HAL module(%d) information\n", module); - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto out; } /* Check abi_version whether is supported or not */ if (!info->hal_api) { _E("%s: Doesn't support HAL API\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto out; } @@ -533,7 +532,7 @@ int hal_common_check_backend_abi_version(enum hal_module module, || !info->abi_versions) { _E("%s: Doesn't have the ABI version information\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto out; } @@ -549,13 +548,13 @@ int hal_common_check_backend_abi_version(enum hal_module module, data->backend_min_abi_version >= HAL_ABI_VERSION_END) { _E("%s: abi_versions[%d].backend_min_abi_version(%d) is invalid\n", info->module_name, i, data->backend_min_abi_version); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto out; } if (abi_version <= data->platform_abi_version && abi_version >= data->backend_min_abi_version) { - ret = TIZEN_ERROR_NONE; + ret = 0; goto out; } @@ -568,7 +567,7 @@ int hal_common_check_backend_abi_version(enum hal_module module, hal_abi_version_str[data->backend_min_abi_version], hal_abi_version_str[data->platform_abi_version]); } - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; out: _hal_api_conf_exit(); @@ -620,23 +619,23 @@ static int __get_backend_library_data(enum hal_module module, /* Check parameter whether is valid or not */ if (module <= HAL_MODULE_UNKNOWN || module >= HAL_MODULE_END) { _E("Invalid parameter of HAL module (%d)\n", module); - return TIZEN_ERROR_INVALID_PARAMETER; + return -EINVAL; } if (_hal_api_conf_init()) - return TIZEN_ERROR_UNKNOWN; + return -EINVAL; info = _hal_api_conf_get_module_info(module, NULL); if (info == NULL) { _E("Failed to get HAL module(%d) information\n", module); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err; } if (info->backend_module_name == NULL) { _E("Don't support HAL backend of HAL module(%s)\n", info->module_name); - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err; } backend_module_name = g_strdup_printf("libhal-backend-%s", @@ -644,7 +643,7 @@ static int __get_backend_library_data(enum hal_module module, if (!backend_module_name) { _E("Failed to allocate the backend_module_name of HAL module(%s)\n", info->module_name); - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto err; } @@ -653,7 +652,7 @@ static int __get_backend_library_data(enum hal_module module, if (!dir) { _E("Failed to find HAL backend path(%s) for HAL module(%s)\n", hal_backend_path, info->module_name); - ret = TIZEN_ERROR_UNKNOWN; + ret = -EINVAL; goto err_free_backend_module_name; } @@ -675,7 +674,7 @@ static int __get_backend_library_data(enum hal_module module, } if (lib_count > 0 && count != lib_count) { - ret = TIZEN_ERROR_INVALID_PARAMETER; + ret = -EINVAL; goto err_mismatch_count; } -- 2.7.4 From 4d7fe5bb76eb9b7ab06cba4572c49ef9b16234ea Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 15 Jul 2021 12:11:38 +0900 Subject: [PATCH 04/16] haltest: Remove common-haltests from hal-api-common-haltests.rpm The automatic haltests get the haltest binary by parsing the binary name with *haltests*' pattern. Actually, common-haltests doesn't need to be verified because it cannot verify any HAL backend library for hal.img. Change-Id: Ibe99e4c51a571931c50768f89e64c94481adc61c Signed-off-by: Chanwoo Choi --- packaging/hal-api-common.spec | 1 - tests/haltests/CMakeLists.txt | 2 -- 2 files changed, 3 deletions(-) diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index 4aeeb86..c45c497 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -114,7 +114,6 @@ systemd-tmpfiles /usr/lib/tmpfiles.d/hal-rpmdb-checker.conf --create %files -n %{test_name} %dir %{hal_rpmdb_checker_path} %attr(0755,system_fw,system_fw) %{hal_rpmdb_checker_path} -%{_bindir}/hal/common-haltests %{_unitdir}/haltest.target %{_bindir}/reboot-haltest %{_bindir}/reboot-normal diff --git a/tests/haltests/CMakeLists.txt b/tests/haltests/CMakeLists.txt index 0d4cbd4..f76d3e2 100644 --- a/tests/haltests/CMakeLists.txt +++ b/tests/haltests/CMakeLists.txt @@ -20,5 +20,3 @@ ENDFOREACH(flag) TARGET_LINK_LIBRARIES(${HAL_COMMON_HALTEST} ${common-haltests_pkgs_LDFLAGS} ${PROJECT_NAME}) SET_TARGET_PROPERTIES(${HAL_COMMON_HALTEST} PROPERTIES COMPILE_FLAGS "-fPIE -fvisibility=default") SET_TARGET_PROPERTIES(${HAL_COMMON_HALTEST} PROPERTIES LINK_FLAGS "-pie") - -INSTALL(TARGETS ${HAL_COMMON_HALTEST} DESTINATION ${EXEC_PREFIX}/hal/) -- 2.7.4 From 72cb48874d00f5ae02081e43ebd982410c730466 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Mon, 13 Sep 2021 17:11:21 +0900 Subject: [PATCH 05/16] haltest: Add net-config and connmand service for wifi-haltest wifi-haltests requires the net-config and connmand daemon. So that add two network daemon service. Change-Id: I12f3f155fb14e5aff24e70740a6fba5892f3f426 Signed-off-by: Chanwoo Choi --- packaging/haltest.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/haltest.target b/packaging/haltest.target index 0b35a53..d1d5a96 100644 --- a/packaging/haltest.target +++ b/packaging/haltest.target @@ -1,6 +1,6 @@ [Unit] Description=HALTEST Mode -Requires=basic.target ac.service deviced.service getty.target +Requires=basic.target ac.service deviced.service getty.target connman.service net-config.service Conflicts=rescue.service rescue.target After=basic.target rescue.service rescue.target ac.service deviced.service getty.target AllowIsolate=yes -- 2.7.4 From 77de046e3e26589959a0c7b87bc6da3a125581ee Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 2 Nov 2021 19:34:10 +0900 Subject: [PATCH 06/16] halapi: common: Add HAL_ABI_VERSION_TIZEN_7_0 Tizen version is updated to TIZEN_7.0. If there is some case not to support the backward compatible, it needs to check whether tizen_hal_abi_version is correct or not. Change-Id: Ie7a4949f0ec3855af6a1e12cd71334b65a7c1f54 Signed-off-by: Jaehoon Chung --- include/hal-common-interface.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hal-common-interface.h b/include/hal-common-interface.h index dab26cb..56734ce 100644 --- a/include/hal-common-interface.h +++ b/include/hal-common-interface.h @@ -26,12 +26,14 @@ extern "C" { enum hal_abi_version { HAL_ABI_VERSION_UNKNOWN = 0, HAL_ABI_VERSION_TIZEN_6_5, + HAL_ABI_VERSION_TIZEN_7_0, HAL_ABI_VERSION_END, }; static const char *const hal_abi_version_str[] = { [HAL_ABI_VERSION_UNKNOWN] = "Unknown HAL ABI Version", [HAL_ABI_VERSION_TIZEN_6_5] = "HAL_ABI_VERSION_TIZEN_6_5", + [HAL_ABI_VERSION_TIZEN_7_0] = "HAL_ABI_VERSION_TIZEN_7_0", }; typedef struct __hal_backend { -- 2.7.4 From 2bf62bbf6f24df736e3fc2360abbb70ce90eea6e Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 30 Nov 2021 15:18:54 +0900 Subject: [PATCH 07/16] packaging: Add some packages as Requires(post) There is a warning message during creating Image. Fix the below warning message with this patch. INFO: Installing: hal-api-common-0.0.1-1.armv7l.rpm /opt/etc/hal: No such file or directory /opt/etc/hal: No such file or directory /var/tmp/rpm-tmp.LHK8m3: line 3: systemd-tmpfiles: command not found warning: %post(hal-api-common-0.0.1-1.armv7l) scriptlet failed, exit status 127 WARNING: (hal-api-common-0.0.1-1.armv7l.rpm) Post script failed Change-Id: I1ed933f92f2614ae4ea1c4e1e5d07a932b6a558b Signed-off-by: Jaehoon Chung --- packaging/hal-api-common.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index c45c497..9889717 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -46,6 +46,10 @@ Requires: %{name} = %{version}-%{release} %package -n %{test_name} Summary: tests for hal-api-common Requires: hal-api-common = %{version} +Requires(post): /sbin/ldconfig +Requires(post): systemd +Requires(post): security-config +Requires(postun): /sbin/ldconfig %description -n %{test_name} Haltests for hal-api-common @@ -87,7 +91,7 @@ install -D -m 0755 %{SOURCE9} %{buildroot}%{_bindir}/hal-rpmdb-checker %clean rm -rf %{buildroot} -%post +%post -n %{test_name} /sbin/ldconfig chsmack -a "System" -t %{hal_rpmdb_checker_path} systemd-tmpfiles /usr/lib/tmpfiles.d/hal-rpmdb-checker.conf --create -- 2.7.4 From ba5af454cf4416c7b996a31159aa5e7b06f27fe0 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Wed, 26 Jan 2022 17:52:50 +0900 Subject: [PATCH 08/16] halapi: common: Remove json unused code Change-Id: I87aeb68c4af32542a3d3d91da360e89cfb851eb1 Signed-off-by: Chanwoo Choi --- include/hal-common.h | 55 -------------- src/hal-api-conf.c | 209 --------------------------------------------------- 2 files changed, 264 deletions(-) diff --git a/include/hal-common.h b/include/hal-common.h index 1b0e328..4c197fe 100644 --- a/include/hal-common.h +++ b/include/hal-common.h @@ -83,61 +83,6 @@ enum hal_module { HAL_MODULE_END, }; -#ifdef HAL_API_CONF_JSON -static const char *const hal_module_string[] = { - [HAL_MODULE_UNKNOWN] = "HAL_MODULE_UNKNOWN", - - /* HAL_GROUP_GRAPHICS */ - [HAL_MODULE_TBM] = "HAL_MODULE_TBM", - [HAL_MODULE_TDM] = "HAL_MODULE_TDM", - [HAL_MODULE_COREGL] = "HAL_MODULE_COREGL", - [HAL_MODULE_INPUT] = "HAL_MODULE_INPUT", - - /* HAL_GROUP_MULTIMEDIA */ - [HAL_MODULE_AUDIO] = "HAL_MODULE_AUDIO", - [HAL_MODULE_CAMERA] = "HAL_MODULE_CAMERA", - [HAL_MODULE_RADIO] = "HAL_MODULE_RADIO", - [HAL_MODULE_CODEC] = "HAL_MODULE_CODEC", - [HAL_MODULE_USB_AUDIO] = "HAL_MODULE_USB_AUDIO", - [HAL_MODULE_ALSAUCM] = "HAL_MODULE_ALSAUCM", - - /* HAL_GROUP_CONNECTIVITY */ - [HAL_MODULE_BLUETOOTH] = "HAL_MODULE_BLUETOOTH", - [HAL_MODULE_WIFI] = "HAL_MODULE_WIFI", - [HAL_MODULE_NAN] = "HAL_MODULE_NAN", - [HAL_MODULE_NFC] = "HAL_MODULE_NFC", - [HAL_MODULE_ZIGBEE] = "HAL_MODULE_ZIGBEE", - [HAL_MODULE_UWB] = "HAL_MODULE_UWB", - [HAL_MODULE_MTP] = "HAL_MODULE_MTP", - - /* HAL_GROUP_TELEPHONY */ - [HAL_MODULE_TELEPHONY] = "HAL_MODULE_TELEPHONY", - - /* HAL_GROUP_LOCATION */ - [HAL_MODULE_LOCATION] = "HAL_MODULE_LOCATION", - - /* HAL_GROUP_SYSTEM */ - [HAL_MODULE_COMMON] = "HAL_MODULE_COMMON", - [HAL_MODULE_POWER] = "HAL_MODULE_POWER", - [HAL_MODULE_SENSOR] = "HAL_MODULE_SENSOR", - [HAL_MODULE_PERIPHERAL] = "HAL_MODULE_PERIPHERAL", - [HAL_MODULE_DEVICE_BATTERY] = "HAL_MODULE_DEVICE_BATTERY", - [HAL_MODULE_DEVICE_BEZEL] = "HAL_MODULE_DEVICE_BEZEL", - [HAL_MODULE_DEVICE_DISPLAY] = "HAL_MODULE_DEVICE_DISPLAY", - [HAL_MODULE_DEVICE_IR] = "HAL_MODULE_DEVICE_IR", - [HAL_MODULE_DEVICE_TOUCHSCREEN] = "HAL_MODULE_DEVICE_TOUCHSCREEN", - [HAL_MODULE_DEVICE_LED] = "HAL_MODULE_DEVICE_LED", - [HAL_MODULE_DEVICE_BOARD] = "HAL_MODULE_DEVICE_BOARD", - [HAL_MODULE_DEVICE_EXTERNAL_CONNECTION] = "HAL_MODULE_DEVICE_EXTERNAL_CONNECTION", - [HAL_MODULE_DEVICE_THERMAL] = "HAL_MODULE_DEVICE_THERMAL", - [HAL_MODULE_DEVICE_USB_GADGET] = "HAL_MODULE_DEVICE_USB_GADGET", - [HAL_MODULE_DEVICE_HAPTIC] = "HAL_MODULE_DEVICE_HAPTIC", - [HAL_MODULE_DEVICE_MEMORY] = "HAL_MODULE_DEVICE_MEMORY", - - [HAL_MODULE_END] = "HAL_MODULE_END", -}; -#endif - /** * @brief Get the backend library name according to the type of HAL module * @param[in] HAL module id among enum hal_moudle diff --git a/src/hal-api-conf.c b/src/hal-api-conf.c index d511354..d86f03a 100644 --- a/src/hal-api-conf.c +++ b/src/hal-api-conf.c @@ -29,12 +29,6 @@ #include "hal-api-conf.h" #include "hal-api-list.h" -#ifdef HAL_API_CONF_JSON -static enum hal_abi_version _platform_abi_version = HAL_ABI_VERSION_END; - -static json_object *_json_file_object = NULL; -#endif - static GHashTable *_module_hash = NULL; static int _usage_count = 0; @@ -63,159 +57,10 @@ do { \ } } -#ifdef HAL_API_CONF_JSON -static enum hal_abi_version __convert_abi_version_str_to_enum(const char *abi_version) { - int version; - for (version = HAL_ABI_VERSION_UNKNOWN + 1; version < HAL_ABI_VERSION_END; version++){ - if (g_strcmp0(abi_version, hal_abi_version_str[version]) == 0) - return (enum hal_abi_version)version; - } - - return HAL_ABI_VERSION_UNKNOWN; -} - -static const char *__convert_module_to_string(enum hal_module module) -{ - return hal_module_string[module]; -} - -static enum hal_group __convert_group_str_to_enum(const char * group) -{ - enum hal_group group_idx; - - for (group_idx = HAL_GROUP_UNKNOWN + 1; group_idx < HAL_GROUP_END; group_idx++) { - if (g_strcmp0(group, hal_group_string[group_idx]) == 0) - return group_idx; - } - - return HAL_GROUP_UNKNOWN; -} - -static enum hal_license __convert_license_str_to_enum(const char *license) -{ - if (g_strcmp0(license, "APACHE_2_0") == 0) - return HAL_LICENSE_APACHE_2_0; - - if (g_strcmp0(license, "FLORA") == 0) - return HAL_LICENSE_FLORA; - - if (g_strcmp0(license, "MIT") == 0) - return HAL_LICENSE_MIT; - - return HAL_LICENSE_UNKNOWN; -} - -static const char * __get_json_object_string(json_object *object, const char *key) -{ - json_object *temp_object = NULL; - - json_object_object_get_ex(object, key, &temp_object); - return json_object_get_string(temp_object); -} - -static struct __hal_module_info *__create_hal_module_info(enum hal_module module, json_object *object) -{ - struct __hal_module_info *info; - GList *abi_list = NULL; - GList *iter_list = NULL; - int list_index = 0; - json_object *abi_versions_array; - json_object *tmp_object; - const char *tmp; - - info = (struct __hal_module_info *)calloc(1, sizeof(struct __hal_module_info)); - if (info == NULL) { - _E("Out of Memory\n"); - return NULL; - } - - info->module = module; - info->module_name = g_strdup(__convert_module_to_string(module)); - info->backend_module_name = g_strdup(__convert_module_to_string(backend_module)); - - tmp = __get_json_object_string(object, "group"); - info->group = __convert_group_str_to_enum(tmp); - - tmp = __get_json_object_string(object, "license"); - info->license = __convert_license_str_to_enum(tmp); - - info->library_name = g_strdup(__get_json_object_string(object, "library_name")); - info->library_name_64bit = g_strdup(__get_json_object_string(object, "library_name_64bit")); - info->symbol_name = g_strdup(__get_json_object_string(object, "symbol_name")); - - if (info->library_name && info->library_name_64bit && info->symbol_name) - info->hal_api = true; - - json_object_object_get_ex(object, "abi_versions", &abi_versions_array); - if (json_object_get_type(abi_versions_array) != json_type_array) - return info; - - info->num_abi_versions = json_object_array_length(abi_versions_array); - if (info->num_abi_versions > 0) { - info->abi_versions = (struct hal_abi_version_match*)calloc(info->num_abi_versions, - sizeof(struct hal_abi_version_match)); - if (info->abi_versions == NULL) { - _E("Out of Memory\n"); - _destroy_module_info(info); - return NULL; - } - - for (int i = 0; i < info->num_abi_versions; i++) { - json_object *abi_object = json_object_array_get_idx(abi_versions_array, i); - - tmp = __get_json_object_string(abi_object, "platform_abi_version"); - info->abi_versions[list_index].platform_abi_version = - __convert_abi_version_str_to_enum(tmp); - - tmp = __get_json_object_string(abi_object, "backend_min_abi_version"); - info->abi_versions[list_index].backend_min_abi_version = - __convert_abi_version_str_to_enum(tmp); - list_index++; - } - } - - return info; -} - -static struct __hal_module_info* _get_module_info(enum hal_module module) -{ - struct __hal_module_info *info = NULL; - json_object *module_array_object = NULL; - const char *group_name = NULL; - const char *module_name = NULL; - int i; - - if (!_json_file_object || !_module_hash) - return NULL; - - info = (struct __hal_module_info*)g_hash_table_lookup(_module_hash, GINT_TO_POINTER(module)); - if (info != NULL) - return info; - - json_object_object_get_ex(_json_file_object, "MODULE_INFO", &module_array_object); - module_name = __convert_module_to_string(module); - - for (i = 0; i < json_object_array_length(module_array_object); i++) { - json_object *temp_object = json_object_array_get_idx(module_array_object, i); - const char *value = __get_json_object_string(temp_object, "module"); - if (g_strcmp0(value, module_name) == 0) { - info = __create_hal_module_info(module, temp_object); - if (info == NULL) - _E("Failed to create hal module info\n"); - else - g_hash_table_insert(_module_hash, GINT_TO_POINTER(module), info); - break; - } - } - - return info; -} -#else static struct __hal_module_info* _get_module_info(enum hal_module module) { return &g_hal_module_info[module]; } -#endif static struct __hal_module_info* _get_module_info_with_library_name(enum hal_module module, const char *library_name) @@ -227,11 +72,6 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod char *library_name_prefix = NULL; int ret; -#ifdef HAL_API_CONF_JSON - if (!_json_file_object) - return NULL; -#endif - if (!_module_hash | !library_name) return NULL; @@ -306,11 +146,6 @@ __attribute__ ((visibility("default"))) struct __hal_module_info* _hal_api_conf_get_module_info(enum hal_module module, const char *library_name) { -#ifdef HAL_API_CONF_JSON - if (!_json_file_object) - return NULL; -#endif - if (!_module_hash) return NULL; @@ -323,24 +158,7 @@ struct __hal_module_info* _hal_api_conf_get_module_info(enum hal_module module, enum hal_abi_version _hal_api_conf_get_platform_abi_version(void) { -#ifdef HAL_API_CONF_JSON - const char *abi_version = NULL; - bool ret_initialized; - json_object *platform_obj = NULL; - - if (_platform_abi_version != HAL_ABI_VERSION_END) - return _platform_abi_version; - - if (!_json_file_object || !_module_hash) - return HAL_ABI_VERSION_UNKNOWN; - - abi_version = __get_json_object_string(_json_file_object, "PLATFORM_ABI_VERSION"); - _platform_abi_version = __convert_abi_version_str_to_enum(abi_version); - - return _platform_abi_version; -#else return g_platform_curr_abi_version; -#endif } __attribute__ ((visibility("default"))) @@ -349,29 +167,9 @@ int _hal_api_conf_init(void) if (_usage_count++ > 0) return 0; -#ifdef HAL_API_CONF_JSON - _json_file_object = json_object_from_file(HAL_CONFIGURATION_PATH); - if (_json_file_object == NULL) { - _E("Failed to parsing json configuration file : %s\n", json_util_get_last_err()); - goto err; - } -#endif - _module_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, _destroy_module_info); return 0; - -#ifdef HAL_API_CONF_JSON -err: - _usage_count--; - - if (_module_hash) { - g_hash_table_remove_all(_module_hash); - g_hash_table_unref(_module_hash); - } - - return -EINVAL; -#endif } __attribute__ ((visibility("default"))) @@ -381,13 +179,6 @@ void _hal_api_conf_exit(void) if (_usage_count != 0) return; -#ifdef HAL_API_CONF_JSON - if (_json_file_object) { - json_object_put(_json_file_object); - _json_file_object = NULL; - } -#endif - if (_module_hash) { g_hash_table_remove_all(_module_hash); g_hash_table_unref(_module_hash); -- 2.7.4 From 016a64a268856f3aa5e4a49e915012d389445b68 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 27 Jan 2022 10:21:42 +0900 Subject: [PATCH 09/16] halapi: common: Fix wrong operation Reported-by: Seung-Woo Kim sw0312.kim@samsung.com Change-Id: I9a33513c00f772ce7f431331817199440181d83e Signed-off-by: Chanwoo Choi --- src/hal-api-conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hal-api-conf.c b/src/hal-api-conf.c index d86f03a..7bc5d55 100644 --- a/src/hal-api-conf.c +++ b/src/hal-api-conf.c @@ -72,7 +72,7 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod char *library_name_prefix = NULL; int ret; - if (!_module_hash | !library_name) + if (!_module_hash || !library_name) return NULL; tmp_info = _get_module_info(module); -- 2.7.4 From 50cafbd7a3b6e0b8c34cd998bd4e93adb56c2aac Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Wed, 26 Jan 2022 17:53:46 +0900 Subject: [PATCH 10/16] halapi: common: Fix unneeded free operation Remove the unneeded free operation because don't allocate the dynamic memory to 'info->abi_versions'. Change-Id: I2fc146b7e2ddd03be4c390a832c5a1e0de786b3a Suggested-by: Taemin Yeom Signed-off-by: Chanwoo Choi --- src/hal-api-conf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hal-api-conf.c b/src/hal-api-conf.c index 7bc5d55..c79e7de 100644 --- a/src/hal-api-conf.c +++ b/src/hal-api-conf.c @@ -52,7 +52,6 @@ do { \ SAFE_FREE_AND_NULL(info->library_name); SAFE_FREE_AND_NULL(info->library_name_64bit); SAFE_FREE_AND_NULL(info->symbol_name); - SAFE_FREE_AND_NULL(info->abi_versions); SAFE_FREE_AND_NULL(info); } } -- 2.7.4 From d54144d59f16886671630c50426dc1d8388cf299 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Wed, 16 Feb 2022 18:22:38 +0900 Subject: [PATCH 11/16] hal-api: common: Update current ABI verion by HAL_ABI_VERSION_TIZEN_7_0 Update current ABI verion by HAL_ABI_VERSION_TIZEN_7_0 I expect the all modules will be compatible with between HAL_ABI_VERSION_TIZEN_6_5 and HAL_ABI_VERSION_TIZEN_7_0. If not compatible between HAL_ABI_VERSION_TIZEN_6_5 and HAL_ABI_VERSION_TIZEN_7_0, it should be edited by module owner. Change-Id: I03f47ad66895f1311d60760fb1833c2dfd4b2e70 Reported-by: Taemin Yeom Signed-off-by: Chanwoo Choi --- src/hal-api-list.h | 56 +++++++++++++++++++++++----------------------- tests/unittest/test_hal.cc | 54 ++++++++++++++++++++++---------------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/hal-api-list.h b/src/hal-api-list.h index f86b50f..967caaa 100644 --- a/src/hal-api-list.h +++ b/src/hal-api-list.h @@ -23,21 +23,21 @@ #define HAL_ABI_VERSION_MAX 10 -enum hal_abi_version g_platform_curr_abi_version = HAL_ABI_VERSION_TIZEN_6_5; +enum hal_abi_version g_platform_curr_abi_version = HAL_ABI_VERSION_TIZEN_7_0; static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_ABI_VERSION_MAX] = { /* HAL_GROUP_GRAPHICS */ [HAL_MODULE_TBM] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_TDM] = { /* FIXME: Need to be filled from configuration file. */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, @@ -58,21 +58,21 @@ static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_A [HAL_MODULE_AUDIO] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_CAMERA] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_RADIO] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, @@ -99,14 +99,14 @@ static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_A [HAL_MODULE_BLUETOOTH] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_WIFI] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, @@ -115,21 +115,21 @@ static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_A [HAL_MODULE_NFC] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_ZIGBEE] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_UWB] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, @@ -144,7 +144,7 @@ static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_A [HAL_MODULE_TELEPHONY] = { /* FIXME: Need to be determined whehter support HAL API or not. */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, @@ -153,7 +153,7 @@ static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_A [HAL_MODULE_LOCATION] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, @@ -164,21 +164,21 @@ static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_A [HAL_MODULE_POWER] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_SENSOR] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_PERIPHERAL] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, @@ -186,84 +186,84 @@ static struct hal_abi_version_match abi_version_match_data[HAL_MODULE_END][HAL_A [HAL_MODULE_DEVICE_BATTERY] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_BEZEL] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_DISPLAY] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_IR] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_TOUCHSCREEN] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_LED] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_BOARD] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_EXTERNAL_CONNECTION] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_THERMAL] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_USB_GADGET] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_HAPTIC] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, [HAL_MODULE_DEVICE_MEMORY] = { /* FIXME: Need to be initialized by configuration file like xml */ [0] = { - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5, }, }, diff --git a/tests/unittest/test_hal.cc b/tests/unittest/test_hal.cc index f893c09..639ced4 100644 --- a/tests/unittest/test_hal.cc +++ b/tests/unittest/test_hal.cc @@ -55,10 +55,10 @@ TEST(CommonHaltest, test_symbol_name_invalid_module) { TEST(CommonHaltest, test_check_backend_abi_version_invalid_parameter) { int ret; - ret = hal_common_check_backend_abi_version(HAL_MODULE_UNKNOWN, HAL_ABI_VERSION_TIZEN_6_5); + ret = hal_common_check_backend_abi_version(HAL_MODULE_UNKNOWN, HAL_ABI_VERSION_TIZEN_7_0); EXPECT_EQ(ret, TIZEN_ERROR_INVALID_PARAMETER); - ret = hal_common_check_backend_abi_version(HAL_MODULE_END, HAL_ABI_VERSION_TIZEN_6_5); + ret = hal_common_check_backend_abi_version(HAL_MODULE_END, HAL_ABI_VERSION_TIZEN_7_0); EXPECT_EQ(ret, TIZEN_ERROR_INVALID_PARAMETER); ret = hal_common_check_backend_abi_version(HAL_MODULE_TBM, HAL_ABI_VERSION_UNKNOWN); @@ -103,7 +103,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_TBM", "/hal/lib/libhal-backend-tbm.so", "/hal/lib64/libhal-backend-tbm.so", "hal_backend_tbm_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -112,7 +112,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_TDM", "/hal/lib/libhal-backend-tdm.so", "/hal/lib64/libhal-backend-tdm.so", "hal_backend_tdm_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -127,7 +127,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_AUDIO", "/hal/lib/libhal-backend-audio.so", "/hal/lib64/libhal-backend-audio.so", "hal_backend_audio_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -136,7 +136,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_CAMERA", "/hal/lib/libhal-backend-camera.so", "/hal/lib64/libhal-backend-camera.so", "hal_backend_camera_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -145,7 +145,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_RADIO", "/hal/lib/libhal-backend-radio.so", "/hal/lib64/libhal-backend-radio.so", "hal_backend_radio_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -163,7 +163,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_BLUETOOTH", "/hal/lib/libhal-backend-bluetooth.so", "/hal/lib64/libhal-backend-bluetooth.so", "hal_backend_bluetooth_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -172,7 +172,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_WIFI", "/hal/lib/libhal-backend-wifi.so", "/hal/lib64/libhal-backend-wifi.so", "hal_backend_wifi_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -184,7 +184,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_NFC", "/hal/lib/libhal-backend-nfc.so", "/hal/lib64/libhal-backend-nfc.so", "hal_backend_nfc_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -193,7 +193,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_ZIGBEE", "/hal/lib/libhal-backend-zigbee.so", "/hal/lib64/libhal-backend-zigbee.so", "hal_backend_zigbee_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -202,7 +202,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_UWB", "/hal/lib/libhal-backend-uwb.so", "/hal/lib64/libhal-backend-uwb.so", "hal_backend_uwb_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -217,7 +217,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_LOCATION", "/hal/lib/libhal-backend-location.so", "/hal/lib64/libhal-backend-location.so", "hal_backend_location_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -229,7 +229,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_POWER", "/hal/lib/libhal-backend-power.so", "/hal/lib64/libhal-backend-power.so", "hal_backend_power_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -238,7 +238,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_SENSOR", "/hal/lib/libhal-backend-sensor.so", "/hal/lib64/libhal-backend-sensor.so", "hal_backend_sensor_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -250,7 +250,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_BATTERY", "/hal/lib/libhal-backend-device-battery.so", "/hal/lib64/libhal-backend-device-battery.so", "hal_backend_device_battery_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -259,7 +259,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_BEZEL", "/hal/lib/libhal-backend-device-bezel.so", "/hal/lib64/libhal-backend-device-bezel.so", "hal_backend_device_bezel_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -268,7 +268,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_DISPLAY", "/hal/lib/libhal-backend-device-display.so", "/hal/lib64/libhal-backend-device-display.so", "hal_backend_device_display_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -277,7 +277,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_IR", "/hal/lib/libhal-backend-device-ir.so", "/hal/lib64/libhal-backend-device-ir.so", "hal_backend_device_ir_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -286,7 +286,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_TOUCHSCREEN", "/hal/lib/libhal-backend-device-touchscreen.so", "/hal/lib64/libhal-backend-device-touchscreen.so", "hal_backend_device_touchscreen_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -295,7 +295,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_LED", "/hal/lib/libhal-backend-device-led.so", "/hal/lib64/libhal-backend-device-led.so", "hal_backend_device_led_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -304,7 +304,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_BOARD", "/hal/lib/libhal-backend-device-board.so", "/hal/lib64/libhal-backend-device-board.so", "hal_backend_device_board_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -313,7 +313,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_EXTERNAL_CONNECTION", "/hal/lib/libhal-backend-device-external-connection.so", "/hal/lib64/libhal-backend-device-external-connection.so", "hal_backend_device_external_connection_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -322,7 +322,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_THERMAL", "/hal/lib/libhal-backend-device-thermal.so", "/hal/lib64/libhal-backend-device-thermal.so", "hal_backend_device_thermal_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -331,7 +331,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_USB_GADGET", "/hal/lib/libhal-backend-device-usb-gadget.so", "/hal/lib64/libhal-backend-device-usb-gadget.so", "hal_backend_device_usb_gadget_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -340,7 +340,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_HAPTIC", "/hal/lib/libhal-backend-device-haptic.so", "/hal/lib64/libhal-backend-device-haptic.so", "hal_backend_device_haptic_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ), @@ -349,7 +349,7 @@ INSTANTIATE_TEST_CASE_P(CommonHaltest, "HAL_MODULE_DEVICE_MEMORY", "/hal/lib/libhal-backend-device-memory.so", "/hal/lib64/libhal-backend-device-memory.so", "hal_backend_device_memory_data", vector{{ - .platform_abi_version = HAL_ABI_VERSION_TIZEN_6_5, + .platform_abi_version = HAL_ABI_VERSION_TIZEN_7_0, .backend_min_abi_version = HAL_ABI_VERSION_TIZEN_6_5 }} ) -- 2.7.4 From 8d2c5927106bcb469028b40b50b45470e3fee352 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Tue, 22 Mar 2022 20:02:55 +0900 Subject: [PATCH 12/16] halapi: common: Remove unused json-c dependency Change-Id: I38a9f5d183e46f2ebee8504d5b2f06f98d79f8b1 Signed-off-by: Chanwoo Choi --- CMakeLists.txt | 2 - packaging/hal-api-common.spec | 1 - packaging/hal-api.json | 484 ------------------------------------------ src/hal-api-conf.c | 4 - src/hal-api-conf.h | 2 - 5 files changed, 493 deletions(-) delete mode 100644 packaging/hal-api.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a318e9..5979e5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,13 +19,11 @@ SET(PKG_MODULES dlog gio-2.0 glib-2.0 - json-c ) else() SET(PKG_MODULES gio-2.0 glib-2.0 - json-c ) endif() diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index 9889717..0163bc4 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -26,7 +26,6 @@ BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(glib-2.0) -BuildRequires: pkgconfig(json-c) BuildRequires: pkgconfig(gmock) BuildRequires: pkgconfig(systemd) diff --git a/packaging/hal-api.json b/packaging/hal-api.json deleted file mode 100644 index fe30ac6..0000000 --- a/packaging/hal-api.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "PLATFORM_ABI_VERSION" :"HAL_ABI_VERSION_TIZEN_6_5", - "MODULE_INFO" : - [ - { - "group" :"HAL_GROUP_GRAPHICS", - "module" :"HAL_MODULE_TBM", - "backend_module" :"tbm", - "license" :"MIT", - "library_name" :"/hal/lib/libhal-backend-tbm.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-tbm.so", - "symbol_name" :"hal_backend_tbm_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_GRAPHICS", - "module" :"HAL_MODULE_TDM", - "backend_module" :"tdm", - "license" :"MIT", - "library_name" :"/hal/lib/libhal-backend-tdm.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-tdm.so", - "symbol_name" :"hal_backend_tdm_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_GRAPHICS", - "module" :"HAL_MODULE_COREGL", - "backend_module" :null, - "license" :"UNKNOWN", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_GRAPHICS", - "module" :"HAL_MODULE_INPUT", - "backend_module" :null, - "license" :"MIT", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - - }, - { - "group" :"HAL_GROUP_MULTIMEDIA", - "module" :"HAL_MODULE_AUDIO", - "backend_module" :"audio", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-audio.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-audio.so", - "symbol_name" :"hal_backend_audio_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_MULTIMEDIA", - "module" :"HAL_MODULE_CAMERA", - "backend_module" :"camera", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-camera.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-camera.so", - "symbol_name" :"hal_backend_camera_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_MULTIMEDIA", - "module" :"HAL_MODULE_RADIO", - "backend_module" :"radio", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-radio.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-radio.so", - "symbol_name" :"hal_backend_radio_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_MULTIMEDIA", - "module" :"HAL_MODULE_CODEC", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_MULTIMEDIA", - "module" :"HAL_MODULE_USB_AUDIO", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_MULTIMEDIA", - "module" :"HAL_MODULE_ALSAUCM", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_CONNECTIVITY", - "module" :"HAL_MODULE_BLUETOOTH", - "backend_module" :"bluetooth", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-bluetooth.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-bluetooth.so", - "symbol_name" :"hal_backend_bluetooth_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_CONNECTIVITY", - "module" :"HAL_MODULE_WIFI", - "backend_module" :"wifi", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-wifi.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-wifi.so", - "symbol_name" :"hal_backend_wifi_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_CONNECTIVITY", - "module" :"HAL_MODULE_NAN", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_CONNECTIVITY", - "module" :"HAL_MODULE_NFC", - "backend_module" :"nfc", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-nfc.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-nfc.so", - "symbol_name" :"hal_backend_nfc_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_CONNECTIVITY", - "module" :"HAL_MODULE_ZIGBEE", - "backend_module" :"zigbee", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-zigbee.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-zigbee.so", - "symbol_name" :"hal_backend_zigbee_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - - }, - { - "group" :"HAL_GROUP_CONNECTIVITY", - "module" :"HAL_MODULE_UWB", - "backend_module" :"uwb", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-uwb.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-uwb.so", - "symbol_name" :"hal_backend_uwb_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_CONNECTIVITY", - "module" :"HAL_MODULE_MTP", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - - { - "group" :"HAL_GROUP_TELEPHONY", - "module" :"HAL_MODULE_TELEPHONY", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_LOCATION", - "module" :"HAL_MODULE_LOCATION", - "backend_module" :"location", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-location.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-location.so", - "symbol_name" :"hal_backend_location_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_COMMON", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_POWER", - "backend_module" :"power", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-power.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-power.so", - "symbol_name" :"hal_backend_power_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_SENSOR", - "backend_module" :"sensor", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-sensor.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-sensor.so", - "symbol_name" :"hal_backend_sensor_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_PERIPHERAL", - "backend_module" :null, - "license" :"APACHE_2_0", - "library_name" :null, - "library_name_64bit" :null, - "symbol_name" :null, - "abi_versions" :null - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_BATTERY", - "backend_module" :"device-battery", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-battery.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-battery.so", - "symbol_name" :"hal_backend_device_battery_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_BEZEL", - "backend_module" :"device-bezel", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-bezel.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-bezel.so", - "symbol_name" :"hal_backend_device_bezel_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_DISPLAY", - "backend_module" :"device-display", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-display.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-display.so", - "symbol_name" :"hal_backend_device_display_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_IR", - "backend_module" :"device-ir", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-ir.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-ir.so", - "symbol_name" :"hal_backend_device_ir_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_TOUCHSCREEN", - "backend_module" :"device-touchscreen", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-touchscreen.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-touchscreen.so", - "symbol_name" :"hal_backend_device_touchscreen_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_LED", - "backend_module" :"device-led", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-led.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-led.so", - "symbol_name" :"hal_backend_device_led_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_BOARD", - "backend_module" :"device-board", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-board.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-board.so", - "symbol_name" :"hal_backend_device_board_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_EXTERNAL_CONNECTION", - "backend_module" :"device-external-connection", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-external-connection.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-external-connection.so", - "symbol_name" :"hal_backend_device_external_connection_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_THERMAL", - "backend_module" :"device-thermal", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-thermal.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-thermal.so", - "symbol_name" :"hal_backend_device_thermal_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_USB_GADGET", - "backend_module" :"device-usb-gadget", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-usb-gadget.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-usb-gadget.so", - "symbol_name" :"hal_backend_device_usb_gadget_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_HAPTIC", - "backend_module" :"device-haptic", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-haptic.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-haptic.so", - "symbol_name" :"hal_backend_device_haptic_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - }, - { - "group" :"HAL_GROUP_SYSTEM", - "module" :"HAL_MODULE_DEVICE_MEMORY", - "backend_module" :"device-memory", - "license" :"APACHE_2_0", - "library_name" :"/hal/lib/libhal-backend-device-memory.so", - "library_name_64bit" :"/hal/lib64/libhal-backend-device-memory.so", - "symbol_name" :"hal_backend_device_memory_data", - "abi_versions" :[ - { - "platform_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5", - "backend_min_abi_version" :"HAL_ABI_VERSION_TIZEN_6_5" - } - ] - } - ] -} diff --git a/src/hal-api-conf.c b/src/hal-api-conf.c index c79e7de..a3c6c25 100644 --- a/src/hal-api-conf.c +++ b/src/hal-api-conf.c @@ -19,9 +19,6 @@ #include #include -#include -#include - #include "hal-common.h" #include "hal-common-interface.h" @@ -65,7 +62,6 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod const char *library_name) { struct __hal_module_info *info = NULL, *new_info = NULL, *tmp_info = NULL; - json_object *module_array_object = NULL; const char *group_name = NULL; const char *module_name = NULL; char *library_name_prefix = NULL; diff --git a/src/hal-api-conf.h b/src/hal-api-conf.h index a87f76a..e77edc0 100644 --- a/src/hal-api-conf.h +++ b/src/hal-api-conf.h @@ -26,8 +26,6 @@ extern "C" { #endif -#define HAL_CONFIGURATION_PATH "/etc/hal/hal-api.json" - int _hal_api_conf_init(void); void _hal_api_conf_exit(void); -- 2.7.4 From 4194c83be909f84971eed6dc5b18b7f0871563ff Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Wed, 20 Apr 2022 20:16:11 +0900 Subject: [PATCH 13/16] hal-api: common: Add support of __x86_64__ architecture If architecture type is __x86_64__, use /hal/lib64 path. Change-Id: Ifee4aebb8a86a4f3ecfe2053b027d20288008067 Reported-by: Sungguk Na Signed-off-by: Chanwoo Choi --- src/common.h | 2 +- src/hal-api-common.c | 2 +- src/hal-api-conf.c | 2 +- tests/unittest/test_hal.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common.h b/src/common.h index 4a89747..93f7090 100644 --- a/src/common.h +++ b/src/common.h @@ -118,7 +118,7 @@ static inline const char* get_backend_library_name(struct __hal_module_info *inf if (!info) return NULL; -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__x86_64__) return info->library_name_64bit; #else return info->library_name; diff --git a/src/hal-api-common.c b/src/hal-api-common.c index 22c50e8..db73891 100644 --- a/src/hal-api-common.c +++ b/src/hal-api-common.c @@ -610,7 +610,7 @@ static int __get_backend_library_data(enum hal_module module, DIR *dir; char *backend_module_name = NULL; int count, i, ret, len; -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__x86_64__) const char hal_backend_path[] = "/hal/lib64"; #else const char hal_backend_path[] = "/hal/lib"; diff --git a/src/hal-api-conf.c b/src/hal-api-conf.c index a3c6c25..9495d3b 100644 --- a/src/hal-api-conf.c +++ b/src/hal-api-conf.c @@ -118,7 +118,7 @@ static struct __hal_module_info* _get_module_info_with_library_name(enum hal_mod new_info->module = info->module; new_info->license = info->license; new_info->module_name = g_strdup(info->module_name); -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__x86_64__) new_info->library_name_64bit = g_strdup_printf("/hal/lib64/%s", library_name); #else new_info->library_name = g_strdup_printf("/hal/lib/%s", library_name); diff --git a/tests/unittest/test_hal.cc b/tests/unittest/test_hal.cc index 639ced4..7d2a583 100644 --- a/tests/unittest/test_hal.cc +++ b/tests/unittest/test_hal.cc @@ -362,7 +362,7 @@ TEST_P(HalInfoMatchedTest, get_backend_library_name) { ret = hal_common_get_backend_library_name(info.module_, ret_library_name, MAX_BUFF); EXPECT_TRUE(ret == TIZEN_ERROR_NONE); -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__x86_64__) EXPECT_STREQ(info.library_name_64bit_, ret_library_name) << "module name is " << info.module_name_; #else EXPECT_STREQ(info.library_name_, ret_library_name) << "module name is " << info.module_name_; -- 2.7.4 From 6a021caf4d70242b6430fa30262f8151e1408735 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 21 Apr 2022 17:01:07 +0900 Subject: [PATCH 14/16] hal-api: common: Check value validation for current platform HAL ABI version Change-Id: I0b6cf1627f992acc47532553b3588342f58990b6 Signed-off-by: Chanwoo Choi --- src/hal-api-common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hal-api-common.c b/src/hal-api-common.c index db73891..8273b72 100644 --- a/src/hal-api-common.c +++ b/src/hal-api-common.c @@ -537,6 +537,15 @@ int hal_common_check_backend_abi_version(enum hal_module module, } g_platform_curr_abi_version = _hal_api_conf_get_platform_abi_version(); + + if (g_platform_curr_abi_version <= HAL_ABI_VERSION_UNKNOWN + || g_platform_curr_abi_version >= HAL_ABI_VERSION_END) { + _E("Invalid paramer of current HAL ABI version(%d)(%d)\n", + g_platform_curr_abi_version, module); + ret = -EINVAL; + goto out; + } + for (i = 0; i < info->num_abi_versions; i++) { struct hal_abi_version_match *data = &info->abi_versions[i]; -- 2.7.4 From 175382cccc42c2a81d4ada13f873a672199760e3 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 3 Jun 2022 14:06:04 +0900 Subject: [PATCH 15/16] hal-rpmdb-checker: Fix comment about hal info file The hal info file path is /hal/etc/hal-info.ini. Fix the file path from comment. Change-Id: I8c8eabefe666872056e1de2b9d87a1976651367e Signed-off-by: Seung-Woo Kim --- packaging/hal-rpmdb-checker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/hal-rpmdb-checker b/packaging/hal-rpmdb-checker index ed11f83..a4cd400 100755 --- a/packaging/hal-rpmdb-checker +++ b/packaging/hal-rpmdb-checker @@ -98,7 +98,7 @@ get_hal_img_version() { return fi - # Get hal_img_version from /hal/etc/info.ini + # Get hal_img_version from /hal/etc/hal-info.ini tmp=`cat $HAL_IMG_INFO_FILE_PATH | grep Build=` hal_img_version=`echo ${tmp:6}` -- 2.7.4 From 13205503e73b487a5578ff19631bd8d17eff0feb Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Wed, 15 Jun 2022 13:25:37 +0900 Subject: [PATCH 16/16] hal-api: common: Do not treat "No such file or directory" as error log There might be an environment that naturally has no hal backend. For the environment, changed log level to info so that not to be confused as an error. Change-Id: Ia458d7ec6c5bc89cbe58a35df0f7d6343bceae66 Signed-off-by: Youngjae Cho --- src/hal-api-common.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/hal-api-common.c b/src/hal-api-common.c index 8273b72..d11226b 100644 --- a/src/hal-api-common.c +++ b/src/hal-api-common.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -146,6 +147,11 @@ static int __open_backend(struct __hal_module_info *info) info->module_name); ret = -EINVAL; goto err; + } else if (access(backend_library_name, F_OK) == -1) { + _I("%s: There is no backend library\n", + info->module_name); + ret = -ENOENT; + goto err; } if (!info->symbol_name) { @@ -292,12 +298,8 @@ static int __get_backend(enum hal_module module, void **data, } ret = __open_backend(info); - if (ret < 0) { - _E("%s: Failed to get the backend library by dlopen\n", - info->module_name); - ret = -EINVAL; + if (ret < 0) goto err; - } ret = __init_backend(info, data, NULL); if (ret < 0) { @@ -414,12 +416,8 @@ static int __get_backend_data(enum hal_module module, unsigned int *abi_version, } ret = __open_backend(info); - if (ret < 0) { - _E("%s: Failed to get the backend library by dlopen\n", - info->module_name); - ret = -EINVAL; + if (ret < 0) goto err_conf_exit; - } /* Return abi_verion of hal_backend structure */ if (!name_size && !vendor_size) { -- 2.7.4