SangYoun Kwak [Tue, 22 Apr 2025 06:20:20 +0000 (15:20 +0900)]
[WIP]test
Change-Id: Id54a3f9984e180c580d17fc14dbdefe3b0f623f4
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Youngjae Cho [Thu, 20 Mar 2025 04:19:19 +0000 (13:19 +0900)]
lshal: Print backend transport information
To show backend transport information, added function
hal_common_get_backend_transport(). The function has been exported to
be accessed by lshal, but not included in hal-common.h. It was becase
for users might confuse it with hal_common_get_transport() and might
lead to incorrect usage.
Change-Id: I625ca465d6f62740642c8836e23527a29ad35073
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 19 Mar 2025 07:40:16 +0000 (16:40 +0900)]
common: halcc: Introduce backend transport configuration
The platform manifest has changed to specify which mode the platform
would supports. On top of this, now a backend have to choice one of
the transports provided by the platform manifest. To this end, the hal
image would have its configuration about transport at the predefined
location, /hal/etc/hal-backend-config.xml.
- It would be like this:
| <hal-backend>
| <manifest>
| <hal-module>
| <name>HAL_MODULE_AUDIO</name>
| <transport><!--empty implies passthrough--></transport>
| </hal-module>
| <hal-module>
| <name>HAL_MODULE_CODEC</name>
| <transport>passthrough</transport>
| </hal-module>
| <hal-module>
| <name>HAL_MODULE_CAMERA</name>
| <transport>ipc</transport>
| </hal-module>
| </manifest>
| </hal-backend>
It is similar to the platform manifest excpet the <transport> is tag,
not the property of <version>. And only one transport, ipc or passthrough,
can be specified as a <transport> value.
If a backend chose transport that is not supported by platform, the
behavior is same as incompatible version, that is, it won't working.
This affects behavior of existing function, hal_common_get_transport().
But, on this patch, handle such case not an error but a success, working
passthrough. To fully operational, it needs time for deploying file,
hal-backend-config.xml, to every profile.
Change-Id: I08ee8faf465fe6fb27f9474c3ddcf51906b36b0e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Mar 2025 08:57:19 +0000 (17:57 +0900)]
common: Support multi-transport on platform manifest
It has changed to specify more than one transport on hal manifest if
necessary. To support this, changed 'enum hal_common_transort' to be
bitmap. Note that the actual values are same as before, 0, 1, and 2.
The property //hal/version/@transport can now have more than two transport
seperated by comma. And when it comes to an invalid transport string, it
applies passthrough as a default transport.
• As-is: Only one transport could be specified
<version transport="ipc">...</version>
• To-be: All the belows are possible
<version>...</version>
<version transport="transport">...</version>
<version transport="ipc">...</version>
<version transport="transport,ipc">...</version>
<version transport="ipc,transport">...</version>
Change-Id: I8a1eefe8350ee8df3e2b0f5321920df83eefc7c5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 31 Mar 2025 05:43:50 +0000 (14:43 +0900)]
hal-backend-service: Add device-external_connection to hal-backend-service-config
The device-external_connection can now work in ipc mode, so added
device-external_connection to hal-backend-service config to be fully
operational on the hal-backend-service.
Change-Id: Icadfd6eb5635c842941aa52414ca0e2655a0ccbf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Mar 2025 07:39:32 +0000 (16:39 +0900)]
hal-backend-service: Add device-bezel to hal-backend-service-config
The device-bezel can now work in ipc mode, so added device-bezel
to hal-backend-service config to be fully operational on the
hal-backend-service.
Change-Id: I6b6cd0d2c447a8342eba2a186b071a17f37f351d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 31 Mar 2025 06:32:20 +0000 (15:32 +0900)]
common: Fix incorrect backend service library name and symbol name
Fixed library namd and symbol name for backend service to a correct one
that match to the each module.
Change-Id: Id4c865d142fe8ba3c454ef8b4dc21209df7d8552
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 1 Apr 2025 11:22:47 +0000 (20:22 +0900)]
halcc: Fix assert on fd to pass for the case 'fd == 0'
The fd could be 0, so add the case to the assertion.
Change-Id: I29225092682e6cc07b016f824891bb11013bb0b7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 26 Mar 2025 03:35:48 +0000 (12:35 +0900)]
halcc: Return -ENOENT on backend loading failure when getting transport
It has changed that the hal_common_get_transport() now distinguishes
those two case below using return value.
1. Failure due to version mismatch or not supported transport
-> Return value: -ELIBBAD
2. Failure due to error related to loading backend library
-> Return value: -ENOENT
The first one is the case that it succeeded to load backend library,
but version of the library wasn't matched to the platform manifest.
On the other hand, the second case fails to load backend library itself,
for example, there is no installed backend library for a module.
Change-Id: I4b96da46625abe72365ab2c58533780bdfac8452
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
SangYoun Kwak [Wed, 26 Mar 2025 01:37:35 +0000 (10:37 +0900)]
hal-backend-service: Add device modules to da config
For the DA build profile, device modules should be added since these
modules are used by DA profile.
Change-Id: Ia03615aa334637bacf4454ccc9d21819d8a7db78
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Chanwoo Choi [Fri, 21 Mar 2025 08:42:12 +0000 (17:42 +0900)]
hal-backend-service: Add EnvironmentFile=/run/xdg-root-env to use libtbm
Add EnvironmentFile=/run/xdg-root-envto hal-backend-service process
because hal-backend-service plugin might want to use libtbm (Tizen Buffer Manager)
for handling buffer such as graphics, camera, codec buffers.
Require the XDG_RUNTIME_DIR environment variable if hal-backend-service
plugin uses libtbm library. But, XDG_RUNTIME_DIR environment variable
is not added to /run/tizen-system-env or global exported environment
data. Instead, enlightenment exports XDG_RUNTIME_DIR environment variable
to /run/xdg-root-env file.
Change-Id: I1ebf726ae1bf3e3d9a0bbe83cf28f3b5efb798e4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 21 Mar 2025 08:17:22 +0000 (17:17 +0900)]
hal-backend-service: Move install path to /usr/bin/hal to use dlconf
Move install path of hal-backend-service from /usr/bin to /usr/bin/hal
to use DLConf(Dynamic Loader Configuration) feature which support to
load multi-version library under /hal. When executing process
under /usr/bin/hal or /hal/bin, DLConf is applied.
Change-Id: I621dfc45580e6ca367c2287f9d0940c82bf48fea
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 21 Mar 2025 07:54:41 +0000 (16:54 +0900)]
hal-backend-service: Add missing Restart propety to .service
When fail of hal-backend-service process, hal-backend-service process
have to be restarted. Add missing Restart related properties.
Change-Id: I1869d37a81c577d239e3ee88a7e55996a4950417
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 20 Mar 2025 12:53:27 +0000 (21:53 +0900)]
hal-backend-service: Add tizen-system-env/sytemd-tmpfiles-setup.service dependency
hal-backend-service plugin communicate with the kernel interface to
handle the h/w. Complete to configure the kernel interface
before starting hal-backend-service*.service. Add tizen-system-env.service
and sytemd-tmpfiles-setup.service dependency.
And remove unneeded Before=basic.target dependency because
hal-backend-service.servcie is already installed in basic.target.
[Description of systemd service]
- tizen-system-env.service
: Create tizen-specific environment variable under /run/tizen-system-env
- systemd-tmpfiles-setup.service
: Configure files under /usr/lib/tmpfiles.d for setting permission
like smack, uid/gid, DAC (Discretionary access control) and so on.
: Target file is such as kernel device node.
Change-Id: Idaf157eac45955808a609776bfa3db4f04cdb6be
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dariusz Michaluk [Thu, 13 Feb 2025 14:23:06 +0000 (15:23 +0100)]
[HALACR-27] Add new HAL_MODULE_SECURITY_KEYS module
[Role of HAL_MODULE_SECURITY_KEYS]
Security Keys module provides secure cryptographic operations
and secure repository for keys, certificates, and sensitive data.
[Detailed description of newly added HAL_MODULE_SECURITY_KEYS module]
- group = HAL_GROUP_SECURITY,
- module = HAL_MODULE_SECURITY_KEYS,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_SECURITY_KEYS",
- backend_module_name = "security-keys",
- library_name = "/hal/lib/libhal-backend-security-keys.so",
- library_name_64bit = "/hal/lib64/libhal-backend-security-keys.so",
- symbol_name = "hal_backend_security_keys_data",
- manifest = "/etc/hal/hal-api-security-manifest.xml",
- hal_api = true,
- backend_service_library_name = "/usr/lib/hal/libhal-backend-service-security-keys.so",
- backend_service_library_name_64bit = "/usr/lib64/hal/libhal-backend-service-security-keys.so",
- backend_service_symbol_name = "hal_backend_service_security_keys_data",
Change-Id: Id3e4fbef5400bbf4a1d81411cd40dc722197db83
SangYoun Kwak [Wed, 19 Mar 2025 08:26:57 +0000 (17:26 +0900)]
hal-backend-service: Change config for DA profile to have codec service
Since the codec is used for DA profile, a codec service is added to the
config json file "hal-backend-service-config-da.json"
Change-Id: I4e0b1c9228a6d71c5f2f9ac3646a336cf9f557a7
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Wed, 19 Mar 2025 07:29:41 +0000 (16:29 +0900)]
hal-backend-service: Change service name for public profile
In public, there would be a service: hal-backend-service
To accomplish this, service is renamed from hal-backend-service-device
to hal-backend-service.
Accordingly, the generator script and building scripts are modified to
check the prefix of service name to be "hal-backend-service", since the
checking prefix was "hal-backend-service-" which does not allow the
service name to be "hal-backend-service".
Change-Id: Iaa8a5707cee3a164d7b5e5c139a7d5d356999dad
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Wed, 19 Mar 2025 05:03:16 +0000 (14:03 +0900)]
Release version 2.0
Changes from version 1.0:
- Add the hal-backend-service to support hal-backends can be accessed
through IPC using TIDL in hal-apis.
- The hal-backend-service uses plugins corresponding to each hal
module, and these plugins are provided by hal-api.
- For each hal backend module, it can be set to run in the thread or in
the process.
- Each process is executed as one independent systemd service, and the
thread operates in the form of a tizen-core task within the service
process.
- Since these hal-backend-services can be configured in various ways,
service files and socket files must be configured dynamically.
Therefore, the configuration of the hal-backend-service is set to
json format, and it is dynamically generated by reading it in the
hal-backend-service-generator.py script.
Change-Id: Id91e69e52358f9afd90e58c3a8562e4791fe8fbe
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Wed, 12 Mar 2025 02:22:48 +0000 (11:22 +0900)]
hal-backend-service: Add json configs for various build profiles
To support various build profiles, json config files are added for
profiles. Also, 'if statement' is added to the spec file to use
appropriate json config file by the build profile.
Change-Id: I3989207849471031d98df8438841d3fb1b1cef75
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Wed, 12 Mar 2025 05:13:10 +0000 (14:13 +0900)]
Add build profile flags to clarify which profile is used
Since the ways to identify the build profile are different from each
other, it is better to define flags for them for the readability and
maintainability.
* WITH_DA: 1 if profile is DA, else 0
* WITH_VD: 1 if profile is VD, else 0
* WITH_VD_MV: 1 if profile is movable, else 0
Change-Id: Ibcd052a87b9aa8017f0dcc1415d6f09c8f61d7e7
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Mon, 10 Mar 2025 07:58:47 +0000 (16:58 +0900)]
hal-backend-service: Change to create socket, service and header dynamically using json config file
Services/sockets, stub proc names can be vary, so they should be changed
easily. To accomplish this, script and template file(ends with .in) are
added to create socket, service and header file dynamically, by the
information in the json config file.
hal-backend-service-config.json file contains service informations,
thread informations. Service information contains service_name(which
will be service name and stub proc name), thread informations. Thread
information contains hal module names to be used.
Below is an example of json config file:
{
"process": [
{
"type": "systemd",
"property": {
"name": "hal-backend-service-1"
},
"thread": [
{ "hal_module_name": [ "device_display", "device_led" ] },
{ "hal_module_name": [ "abc" ] }
]
},
{
"type": "systemd",
"property": {
"name": "hal-backend-service-2"
},
"thread": [
{ "hal_module_name": [ "codec" ] }
]
}
]
}
Based on the parsed information from the json file, service and socket
files are created. Also, a header file which maps hal module(enum) to
the stub proc name. To get the stub proc name form the proxy, a function
is added to get them.
Please be notified that name in the property section does not have to be
same with stub_proc_name. name is used to define stub_proc_name since it
is unique. stub_proc_name can be other value if it is unique.
Change-Id: I13b03196f3cd64b3404cd2946d540e67fd6afeec
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Tue, 4 Mar 2025 09:25:00 +0000 (18:25 +0900)]
hal-backend-service: Change to use proc_name from the commandline argument
The proc_name for rpc communication should be unique through the whole
system. Also, proc_name should be shared with proxy process, so it
should be come from out of the process.
To accomplish this, hal-backend-service is changed to get commandline
argument with option --stub-proc-name and use it as a proc_name.
Usage: hal-backend-service --stub-proc-name <proc_name> <modules> [ <modules> ... ]
Change-Id: If39d1e57b7f43e0c83e6143cbe7e3854821bc8aa
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Haesu Gwon [Fri, 14 Mar 2025 03:44:21 +0000 (12:44 +0900)]
[HALACR-19] Add new HAL_MODULE_DRM module
[Role of HAL_MODULE_DRM]
DRM(Digital Rights Management) requires hardware support to achieve high security level and it's implemented by vendor or product team.
DRM HAL APIs provide an common interface to access such security hardware and its related software assets.
[Details description of newly added HAL_MODULE_DRM module]
- group = HAL_GROUP_MULTIMEDIA,
- module = HAL_MODULE_DRM,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_DRM",
- backend_module_name = "drm",
- library_name = "/hal/lib/libhal-backend-drm.so",
- library_name_64bit = "/hal/lib64/libhal-backend-drm.so",
- symbol_name = "hal_backend_drm_data",
- manifest = "/etc/hal/hal-api-drm-manifest.xml",
- hal_api = true,
Change-Id: I1dd4fb49dbc0493b6408713f9c50fce97f781723
SangYoun Kwak [Fri, 14 Mar 2025 05:05:49 +0000 (14:05 +0900)]
hal-backend-service: Fix to safely convert value from int to gpointer
To capture signal during gmainloop is running, signal handler should be
registered using "g_unix_signal_add" function. It gets handler callback
as GSourceFunc type function and its definition is below:
gboolean (* GSourceFunc) (gpointer user_data);
It gets gpointer as a parameter and there is no way to know which signal
is caught in the callback function, the signal number should be provided
through the user_data.
Signal number is a integer type and user_data is gpointer type, so it
should be passed as a integer pointer but it is inconvenient and
unnecessarily complicated. To simplify it, the signal number can be
converted as gpointer, but this will make compiler produce warnings.
To resolve this, there are a pair of macro functions: GINT_TO_POINTER
and GPOINTER_TO_INT. This macros can remove warnings about
int-to-pointer conversion.(Also this macro is designed for this kind of
works)
Change-Id: I5f9f1df879a5325ac8f1166ba81c2a7bfc4079d0
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Fri, 14 Mar 2025 02:15:49 +0000 (11:15 +0900)]
hal-backend-service: Fix the usage of free functions of GString
Previously, a glib function g_string_free to free GString object was
used like below:
(task_name is a GString object)
1. Assign task_name->str into another char * type variable manually.
2. Free task_name as g_string_free(task_name, FALSE);
This will free GString object without its buffer.
Buffer is provided as a return value but this buffer is already
assigned to another variable, it is ignored.
3. If error occurs, g_string_free(task_name, FALSE) is called.
This may cause memory leak in the error situation and even in the
non-error situation, ignoring the return value of a function call might
cause problem during maintainance.
Thus, it is fixed to get buffer from the return value of
g_string_free_and_steal, which frees GString object and returns buffer.
(It is equivalent to "g_string_free(task_name, FALSE)")
In the error situation, GString object is freed completely with its
buffer.
Change-Id: Idc1f0667819e67fa51823bfc37da523993a1b120
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Youngjae Cho [Thu, 13 Mar 2025 10:20:42 +0000 (19:20 +0900)]
hal-backend-service: Add device-battery hal-backend-service-plugin
Add device-battery plugin to support HAL_MODULE_DEVICE_BATTERY ipc mode.
Change-Id: I049e35691c2177b3d727dbe308986f17950d50de
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Dongik Lee [Tue, 25 Feb 2025 07:56:23 +0000 (16:56 +0900)]
[HALACR-21] Add new HAL_MODULE_SECURITY_AUTH module
[Role of HAL_MODULE_SECURITY_AUTH]
Auth framework requires password manager to access secure element modules such as TMP, HSM, etc.
accordingly, auth hal interface provides a common interface to access its related software assets
[Detailed description of newly added HAL_MODULE_SECURITY_AUTH module]
- group = HAL_GROUP_SECURITY,
- module = HAL_MODULE_SECURITY_AUTH,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_SECURITY_AUTH",
- backend_module_name = "security-auth",
- library_name = "/hal/lib/libhal-backend-security-auth.so",
- library_name_64bit = "/hal/lib64/libhal-backend-security-auth.so",
- symbol_name = "hal_backend_security_auth_data",
- manifest = "/etc/hal/hal-api-security-manifest.xml",
- hal_api = true,
- backend_service_library_name = "/usr/lib/hal/libhal-backend-service-security-auth.so",
- backend_service_library_name_64bit = "/usr/lib64/hal/libhal-backend-service-security-auth.so",
- backend_service_symbol_name = "hal_backend_service_security_auth_data",
Change-Id: Ia8951cad3aada7f8c2ab3cc943fd8610089711a9
SangYoun Kwak [Tue, 11 Mar 2025 09:06:10 +0000 (18:06 +0900)]
hal-backend-service: Remove unused sockets and fix socket names
Since there are unused sockets, they are removed.
Also, socket name was started with .d::HalBackendStub but it should be
started with .d::HalBackendService so they are fixed.
Change-Id: Ieadc716b0e1ffc440dfa488c7766e5472e718f09
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Tue, 11 Mar 2025 09:16:55 +0000 (18:16 +0900)]
hal-backend-service: Change to return 0 when no available module
Previously, if there is no module that can be loaded, service is exited
with return code 1. This will cause the service hal-backend-service be
failed, but it is not desirable for the hal-backend-service scenario.
To fix this, hal-backend-service is modified to return 0 when there is
no available module.
Change-Id: Id239133c09ba7f1e5663d724dae6899dbf8d2bbd
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Youngjae Cho [Tue, 18 Feb 2025 06:59:56 +0000 (15:59 +0900)]
common: Fix __open/close_backend() to control usage_count exclusively
Let the usage_count be encapsulated within the __open_backend() and
__close_backend(). On calling those functions, the usage_count will
be calculated, and operations will be or won't be taken based on the
usage_count. Nothing will be necessary to manage the usage_count
outside of __open_backend() or __close_backend().
Change-Id: If4c3253be8e830f727b8b7741a3b946a1bc6e3fa
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Fri, 7 Mar 2025 08:06:20 +0000 (17:06 +0900)]
halapi: Fix wrong hal-backend-service symbol name of HAL_MODULE_AUDIO
Change-Id: Iace31cad6fd2dc8d50b826ab4bc48c1753c92052
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yongjoo Ahn [Mon, 13 Jan 2025 04:07:42 +0000 (13:07 +0900)]
[HALACR-20] hal-common: Add new module HAL_MODULE_ML
Adds a hal module `HAL_MODULE_ML` for Tizen ML API.
ML APIs which are using certain SoC/vendor specific framework/device
should use this hal api.
Also adds a hal_group `HAL_GROUP_MACHINE_LEARNING`
Change-Id: Ib69d34ef6eaa314c51324d9be480b95d5a38a384
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
Youngjae Cho [Tue, 4 Mar 2025 08:48:22 +0000 (17:48 +0900)]
tools: lshal: Add --reset option to reset cache file
The lshal option --reset removes single file,
/opt/etc/hal/.hal-backend-compatibility-loaded. By that way, an access
to the /opt/etc/hal/.hal-backend-compatibility will truncate the file.
Any following call for the cache file will update it to the latest data,
and then recreate .hal-backend-compatibility-loaded to seal the updated
data.
Plus, to reset the cache for every rpm installation, the 'lshal --reset'
is added to %post script.
Change-Id: Id0a9a1390af3dcf1708028b4ad731f43f822d449
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
SangYoun Kwak [Tue, 4 Mar 2025 06:17:09 +0000 (15:17 +0900)]
hal-backend-service: Fix to check return value of rpc_port_register_proc_info
For the reliability, the return value of rpc_port_register_proc_info()
should be checked.
Change-Id: I420b894c50b4c532c79eaa22e74d82bba3c9b003
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Fri, 28 Feb 2025 09:08:32 +0000 (18:08 +0900)]
hal-backend-service: Change to use modules only specified by arguments
To limit the modules assigned to the task, it is modified to create
tasks only for the modules received through the command line argument.
The command line argument can be provided by the following rules:
1. Modules combiled with ','(comma) will be assigned to one task.
ex) hal-backend-service device-display,device-led
In this case, device-display and device-led will be assigned to
one task.
2. Modules separated with ' '(space) will be assigned to different
threads.
ex) hal-backend-service device-display device-led
In this case, two modules will be assigned to two different
tasks.
3. It is possible to combine spaces and commas.
ex) hal-backend-service device-display,device-led codec
In this case, device-display and device-led will be assignet to
the same task, while codec is assigned to another task.
If no module is provided or there is no available module,
hal-backend-service will be exited.
Change-Id: I54e15cde4b9418fd7fabe3c98511a985f944ab25
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
SangYoun Kwak [Thu, 27 Feb 2025 12:35:00 +0000 (21:35 +0900)]
hal-backend-service: Replace thread to tizen-core
Previously, thread is used to run modules separately but the
comminucation was occured on gmainloop and there is only one gmainloop,
all comminucations were occured on one thread.
To fix this issue, tizen-core is used to run modules separately since it
supports separated gmainloop.
Change-Id: Ice506b1ad0bccf77b4790a6383f9f2e4ce554f90
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Chanwoo Choi [Thu, 27 Feb 2025 02:50:20 +0000 (11:50 +0900)]
halapi: Fix wrong hal-backend-service library path of HAL_MODULE_DEVICE_POWER
Change-Id: I577dcd2af51f18cc6a2822043c40e370832d6f35
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 26 Feb 2025 11:22:58 +0000 (20:22 +0900)]
hal-backend-service: Add socket data for all supported hal-api
Add socket data for all supported hal-api by using hal module name.
Change-Id: Iae9736c2b027391bede0ed37b14b4ef771d297de
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 26 Feb 2025 07:56:05 +0000 (16:56 +0900)]
halapi: Disable to load hal-backend-service plugin of hal-api-common
Edit hal-api filed value of hal-api-common as false
to diisable to load hal-backend-service plugin of hal-api-common.
Change-Id: I0c96954682f65680f76992d3ff5c873f411a7ae0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
SangYoun Kwak [Wed, 26 Feb 2025 02:39:33 +0000 (11:39 +0900)]
hal-backend-service: Disable when profile is TV
To disable hal-backend-service when the profile is TV, a flag is added
to the .spec file named 'enable_hal_backend_service'. If this flag is 0,
then hal-backend-service is excluded from build and install process.
Change-Id: I1e94a6745cc2f1f4fa10441cb646b95a5409d676
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
Chanwoo Choi [Wed, 19 Feb 2025 03:57:55 +0000 (12:57 +0900)]
Add hal-backend-service plugin data
Each hal-api has the their own hal-bakend-service plugin data to be
loaded by hal-backend-service.service.
[Detailed description of newly added fileds for hal-backend-service plugin]
- Add new fields to load hal-backend-service plugin and get symbol
.backend_service_library_name : 32bit file path of hal-backend-service plugin
.backend_service_library_name_64bit : 64bit file path of hal-backend-service plugin
.backend_service_symbol_name : Symbol name loaded by dlsym
- Example of hal-backend-service-tbm plugin,
.backend_service_library_name = "/usr/lib/hal/libhal-backend-service-tdm.so",
.backend_service_library_name_64bit = "/usr/lib64/hal/libhal-backend-service-tdm.so",
.backend_service_symbol_name = "hal_backend_service_tdm_data",
Change-Id: Iac7e385f92b8ec9727f78a9e7d83817acdf0a3fb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 19 Feb 2025 03:25:14 +0000 (12:25 +0900)]
Add hal-backend-service
Support IPC based HAL communication between hal-api and hal-backend.
hal-backend-service is composed with hal-backend-service and
hal-backend-service-[module] plugin to separate the common code from
specific hal-api TIDL stub (service) code.
[Sequence of hal-backend-service execution and
hal-backend-service-[module] plugin loading]
1. Tizen booting
2. hal-backend-service.socket is ready on earl booting stage
3. hal-backend-service.service has dependency with hal-backend-service.socket.
After executing hal-backend-service.socket,
hal-backend-service.service is executed before tizen system services.
4. hal-backend-service initializes IPC server(stub)
and loads hal-backend-service-[module] plugin for all HAL modules.
5. hal-backend-service-[module] loads hal-backend under /hal
6. When hal-backend-service receives IPC from hal-ipc-[module]'s proxy,
invoke loaded hal-backend function via hal-backend-service-[module]
plugin.
[Detailed description of hal-backend-service and
hal-backend-service-[module] plugin]
- hal-backend-service
: Provide common code to load hal-backend-service-[module] plugin
and create thread for each hal-backend-service-[module] service
- hal-backend-servcie-[module] plugin
: Implement TIDL stub (server) to communicate hal-api-[module]'s
proxy (client) which is executed by hal-[module].h on platform side
[Relationship between hal-ipc and hal-backend-service]
------------------------------------------
System Service (Process)
| (Function call)
hal-ipc (shared library)
|
| (IPC)
|
hal-backend-service (Process)
| (Function Call)
hal-backend-service plugin (shared library)
| [Platform]
==========================================
| (Function call) [HAL]
hal-backend (shared library)
------------------------------------------
kernel (Kernel)
Change-Id: Ida817700898957bb20abf7b04b2dd459ea7a9cc7
Signed-off-by: Sangyoun Kwak <sy.kwak@samsung.com>
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Mon, 17 Feb 2025 10:04:45 +0000 (19:04 +0900)]
common: Add hal_common_get_transport()
The getter gets matching transport to the backend version, for example,
if a module manifest has specified transport like below
<hal>
<name>HAL_MODULE_FOO</name>
<version transport="ipc">1.0</version>
<version transport="passthrough">2.1</version>
</hal>
and the version of installed backend module is 2.0, then the API returns
HAL_COMMON_TRANSPORT_PASSTHROUGH.
If the module has specified multiple different transports througout the
platform-version, then the latest platform-version will be returned.
For example, if a module manifest has specified transport like below
<manifest platform-version="9.0">
<hal>
<name>HAL_MODULE_BAR</name>
<version transport="passthrough">3.0</version>
</hal>
</manifest>
<manifest platform-version="10.0">
<hal>
<name>HAL_MODULE_BAR</name>
<version transport="ipc">3.0</version>
</hal>
</manifest>
then, the API returns HAL_COMMON_TRANSPORT_IPC as the transport
of latest platform-version is "ipc".
Change-Id: Iae7d46746f631634bbc461406eda8418139c2dc2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Feb 2025 03:57:09 +0000 (12:57 +0900)]
common: halcc: Change transport to be a property of version
It is necessary to distinguish transport by version. So change the xml
tag 'transport' to be property of 'version' instead of child of 'hal'.
• As-is: //hal/transport
<hal>
<version>...</version>
<transport>...</transport>
</hal>
• To-be: //hal/version/@transport
<hal>
<version transport="...">...</version>
</hal>
As the transport is now bound to the version, the existing API
hal_common_get_supported_interface_version() has changed to also
return transports that are associated with each version.
Additionally, lshal has changed to print transport information as well.
Change-Id: I1497d97d306f78d58477e40907ba1b570348ae47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Feb 2025 04:41:57 +0000 (13:41 +0900)]
common: halcc: Remove <interface> xml tag
It was orignally designed for specifying instances that could
come as an instantiated backend with designated name and id. However,
this scheme has been abandoned and now backend cannot specify its name
and id. Therefore, removed <interface> and its related operations.
Change-Id: I1516670feaaa88d7e24fd51b961e638073093911
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Feb 2025 08:12:52 +0000 (17:12 +0900)]
common: halcc: Set info initialized even when it fails to get backend version
If it once fails to get backend version, then all the following
calls for the backend version will fail as well, leaving it
uninitialized. Due to this, the hal-api-common repeatedly try to
initialize it for every call for accessing the backend, which is truely
inefficiet. This is because this kind of failure cannot be recovered
during runtime. Therefore, it is enough to set it as initialized even
when it fails and let the following calls not to take same routine
repeatedly but just immediately return if it has once failed.
Change-Id: I81f6abbadaad9f0cb44849d04135f009127e4dc7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 14 Feb 2025 04:31:45 +0000 (13:31 +0900)]
spec: Remove unnecessary BuidRequires to dlog-redirection-stdout
The dlog-redirection-stdout code has been removed from
hal-compatibility-checker but the BuildRequires for it hasn't. So
remove the unnecessary dependency.
Change-Id: I3365b2556d80955bec35deb34276b992956c9867
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 13 Feb 2025 06:43:22 +0000 (15:43 +0900)]
common: halcc: Fix to correctly update g_compatibility_info
Fix the memcpy() destination correctly to the matching index.
Change-Id: Icd2c1e9f99554ca20cc3c7c608bf7250c81d2cab
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 5 Dec 2024 08:33:50 +0000 (17:33 +0900)]
common: Change compatibility error to a real error instead of warning
The compatibility check needed time to be operational properly
because there were hal modules that hadn't declared their hal manifest.
And this is why the compatibility check failure was treated as a
warning and ignored.
But as of now, we make the error be treated as an effective error
instead of warning. Therefore, the functions below can now fail due to
compatibility check failure.
- hal_common_get_backend()
- hal_common_get_backend_with_library_name()
- hal_common_get_backend_v2()
- hal_common_get_backend_with_library_name_v2()
Existing unittest needs to be reworked to be operational with proper
manifest file. Therefore, added manifest files.
Change-Id: I4bdb56f3e2f7a9c955884ae88f99dee243330881
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 12 Feb 2025 07:40:13 +0000 (16:40 +0900)]
common: Use default library name if the given one matches the default
The hal_common_get_backend_with_library() can give a library name
that is totally the same as the default one. If then, use the default
one and do not make hashtable entry for the same given one.
Change-Id: I0ba489ec815167b03f12ad2fb6eab3cf4bf8f0ca
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Tue, 11 Feb 2025 15:28:38 +0000 (00:28 +0900)]
hal-common: Add hal_common_transport enumeration
As support hal-ipc communication,
to define hal-api <-> hal-backend communication way,
new enumeration is added.
- enum hal_common_transport
-> This indicates hal-api communication way.
Change-Id: I89a4ac7f5929a5e12e89cff1b6ddb62d9561f09b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Tue, 4 Feb 2025 11:03:51 +0000 (20:03 +0900)]
halcc: Fix open_result_file() to receive access mode
The result file is created with permission system_fw:system_fw:0755.
It means the previous access mode, which was unconditionally set to
O_RDWR, results in permission error if uid is other than system_fw
(have no permission to write). But it must be accessible if the caller
doesn't intend to write but just read. Therefore, add a parameter so
the function opens the file with the given parameter as a flag.
Change-Id: I97f3af9ebedb69e75f7e24b057c4a8dfb1a4904d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 3 Feb 2025 04:46:11 +0000 (13:46 +0900)]
halcc: Add assertion that open_result_file() always returns valid fd on success
Logically, the file descriptor received from open_result_file() cannot
be invalid(negative) if open_result_file() returned 0.
Change-Id: I1b3180fb6c046bf5e4094b010d98970c513d00ae
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 3 Feb 2025 04:57:39 +0000 (13:57 +0900)]
doc: Fix to correctly add anchor of function
In case of function, anchor can be generated with function name
followed by parenthesis instead of # prefix.
• #hal_common_get_backend -> hal_common_get_backend()
• #hal_common_put_backend -> hal_common_put_backend()
Change-Id: I0e65df750c661c13b4472429a668a9936ace013d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Jan Wojtkowski [Fri, 31 Jan 2025 09:47:47 +0000 (10:47 +0100)]
[HALACR-18] Add new HAL_MODULE_SECURITY_CERTS module
[Role of HAL_MODULE_SECURITY_CERTS]
Security Certs module provides cryptography services (digital certificates)
for authentication and secure communication with another system.
[Detailed description of newly added HAL_MODULE_SECURITY_CERTS module]
- group = HAL_GROUP_SECURITY,
- module = HAL_MODULE_SECURITY_CERTS,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_SECURITY_CERTS",
- backend_module_name = "security-certs",
- library_name = "/hal/lib/libhal-backend-security-certs.so",
- library_name_64bit = "/hal/lib64/libhal-backend-security-certs.so",
- symbol_name = "hal_backend_security_certs_data",
- manifest = "/etc/hal/hal-api-security-manifest.xml",
- hal_api = true,
Change-Id: I113705aee91b4191656e4c2443fd3eebd84b495e
Youngjae Cho [Wed, 15 Jan 2025 02:03:12 +0000 (11:03 +0900)]
Initialize ACR docs and elaborate descriptions
Add documentation for ACR and added description.
Change-Id: I25ebd6e3de41866551c64078de1f67f3ce8e9235
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Thu, 16 Jan 2025 05:58:08 +0000 (14:58 +0900)]
[HALACR-16] Add new HAL_MODULE_CODEC module
[Role of HAL_MODULE_CODEC]
Previously, the GStreamer element was used for codec HAL.
But, the element has a dependency of GStreamer which is included in Platform image.
and it should be rebuilt if the GStreamer is upgraded by Platform update.
We can avoid this situation by adding Tizen codec HAL interfaces.
The reference GStreamer element which uses Tizen codec HAL interfaces
will be included in Platform image and no need to rebuild codec HAL backend
in HAL image although the Platform is updated.
[Details description of newly added HAL_MODULE_CODEC module]
- group = HAL_GROUP_MULTIMEDIA,
- module = HAL_MODULE_CODEC,
- license = HAL_LICENSE_APACHE_2_0,
- gbm_group = HAL_GBM_GROUP_PUBLIC,
- module_name = "HAL_MODULE_CODEC",
- backend_module_name = "codec",
- library_name = "/hal/lib/libhal-backend-codec.so",
- library_name_64bit = "/hal/lib64/libhal-backend-codec.so",
- symbol_name = "hal_backend_codec_data",
- manifest = "/etc/hal/hal-api-codec-manifest.xml",
- hal_api = true,
Change-Id: Ic9d3d6ffdefe7902badc8d968818d6b9faa07954
Link: https://jira.sec.samsung.net/browse/HALACR-16
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Yongjoo Ahn [Fri, 10 Jan 2025 07:32:43 +0000 (16:32 +0900)]
common: Fix argument of `hal_common_get_backend_with_library_name_v2`
Let the function take a void pointer to `hal_backend_[module]_funcs`
(NOT a double pointer for it).
Change-Id: Ic1e2c6d4b9b11423e147a541486269363835285b
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
Chanwoo Choi [Wed, 15 Jan 2025 02:22:04 +0000 (11:22 +0900)]
Revert "Revert "halapi: common: Remove deprecated global variable and abi_version in hal_backend""
This reverts commit
d2766e216b95a0e4fa7e2cab94ad408548ab9fbd.
The variables related to 'abi_version' has not used anymore.
Remove deprecated global variable and abi_version in hal_backend
structure.
Change-Id: I0ccf04a627feb859d50166e7562425a22ac360fd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 14 Jan 2025 05:55:26 +0000 (14:55 +0900)]
Revert "halapi: common: Remove deprecated global variable and abi_version in hal_backend"
This reverts commit
293201e2d65c5a44a830bcb2d9953e3057c3e60e.
Change-Id: I4e44a47f1acb3b97b2ba5fc316250a9b1d11eefc
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Wed, 18 Dec 2024 08:46:58 +0000 (17:46 +0900)]
packaging: Disable halcc on movable project
Make the movable project an exception to the previous patch that treats
compatibility error as an real error. Therefore the project is not
affected by compatibility error as before.
Change-Id: I12c5b592f3aa5c76614023329090691c57c5cabe
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 5 Dec 2024 06:57:23 +0000 (15:57 +0900)]
common: Fix module_hash hash operations from direct to string
It matters when it comes to unittest. The unittest code below may
cause an unintended result.
> char *library_name = g_strdup_printf("libhal-backend-%s-user-specific.so",
> info.backend_module_name_);
> int ret = hal_common_get_backend_with_library_name(info.module_,
(void **)&backend_module_data,
library_name);
Over the instantiated testcases, the g_strdup_printf() sometimes returns
same address containing different string. In this case, if the hash and
equal function are g_direct_hash() and g_direct_equal(), then it tests
those different string as equal because both strings are held by the
same address. Therefore, it is not enough to compare the starting
address but needs to compare the entire string.
Change-Id: Ifecbac1db3d03d61137e31b74e356ba0370c345d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Thu, 9 Jan 2025 12:39:57 +0000 (21:39 +0900)]
[DAPR-74] halapi: Add new HAL_MODULE_DA_ESE module
[Role of HAL_MODULE_DA_ESE module]
- Provide APIs to access certificate and key data stored in the eSE,
and to read/write in the hardware secure storage provided by eSE.
Currently a few system services and apps use these APIs
and there are two different hardware vendors whose eSE is used in our products,
so this abstraction is needed to move the hardware specific code and
vendor libraries into HAL layer.
- ESE (Embedded Secure Element)
[Details description of newly added HAL_MODULE_DA_ESE module]
- group : HAL_GROUP_SYSTEM,
- module : HAL_MODULE_DA_ESE,
- license : HAL_LICENSE_APACHE_2_0,
- gbm_group : HAL_GBM_GROUP_DA,
- module_name : "HAL_MODULE_DA_ESE",
- backend_module_name : "da-ese",
- library_name : "/hal/lib/libhal-backend-da-ese.so",
- library_name_64bit : "/hal/lib64/libhal-backend-da-ese.so",
- symbol_name : "hal_backend_da_ese_data",
- manifest : "/etc/hal/hal-api-da-ese-manifest.xml",
- hal_api : true,
Change-Id: I1d7862c4a03caa768d65b9900ee9e37d9d91903d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Tue, 7 Jan 2025 02:33:17 +0000 (11:33 +0900)]
halapi: common: Change .hal-backend-compatibility smack label to '_' from 'System'
To allow access from unprivileged process, changed the smack label of
/opt/etc/hal/.hal-backend-compatibility to '_'.
• Jan 07 10:09:01 localhost audit[9954]: AVC lsm=SMACK fn=smack_inode_permission
action=denied subject="User" object="System" requested=r pid=9954
comm="launchpad-loade" name=".hal-backend-compatibility" dev="vda2" ino=128002
To set the file smack label to '_', several options were considered
below, and we selected the 3rd option.
1) Set the file smack label '_' using setxattr()
: The setxattr() for changing smack label requires capability
CAP_MAC_ADMIN. However, the capability is being strictly managed
and granted exceptionally to those who need to manipulate security
policy, for example, processes that launching application. Our
issue is not such case.
2) Create the directory /opt/etc/hal in advance with smack label '_'
with transmute flag
: Instead of granting CAP_MAC_ADMIN to hal-compatibility-checker.service,
make /opt/etc/hal directory with smack label '_' plus transmute
flag in advance (by post install script or else). Transmute flag on
a directory makes a file created on that directory inherit directory's
smack label instead of a process' smack label that created the file.
However it additionaly requires smack rule "System _ rwxat" to be
effective. The trailing 't' must be appended to the current smack
rule, but security team reviewed and concluded that it might cause
side effect so it was rejected.
3) Create the file /opt/etc/hal/.hal-backend-compatibility
as well as the directory /opt/etc/hal in advance with smack label '_'.
And introduce additional file that denotes whether it requires update.
: Create all directory and file in advance with smack label '_'.
If a file has been created with a specific smack label, the
smack label of a file is retained while being written by other smack
labeled process. As the .hal-backend-compatibility file has changed
to be persistent (we use systemd-tmpfiles to create it so it always
exists), we need additional information whether it needs to be
updated. So introduced empty file .hal-backend-compatibility-loaded.
The file will be created after creating .hal-backend-compatibility.
If the file exists, hal-compatibility-checker.service won't be processed.
Change-Id: I985675457f40f89a28c9a05cd032e10c6220f8de
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 8 Jan 2025 08:47:32 +0000 (17:47 +0900)]
halapi: common: Add missing function prefix 'hal_api_cc_'
The functions that are used by unittest was missing prefix.
Added 'hal_api_cc_' to them to be consistent with other functions.
Change-Id: I997fc7360926871e4c5b29fd9fc295534e2146da
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yongjoo Ahn [Mon, 6 Jan 2025 09:41:09 +0000 (18:41 +0900)]
halapi: Fix memleak of hal_module_info->manifest
Let the module_info hashtable's destroy functions release manifest
string allocated by `g_strdup`.
Change-Id: I354644978bc23f912a6434c886a967c3e6cb63ac
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
Chanwoo Choi [Mon, 16 Dec 2024 04:20:41 +0000 (13:20 +0900)]
halapi: common: Remove deprecated global variable and abi_version in hal_backend
The variables related to 'abi_version' has not used anymore.
Remove deprecated global variable and abi_version in hal_backend
structure.
Change-Id: I1a40fb01cd18d8b3fbbb45f712df3a4b8c786734
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 16 Dec 2024 07:50:26 +0000 (16:50 +0900)]
halapi: common: Add debug log for init/exit/dlopen/dlclose
Add debug log for each init/exit/dlopen/dlclose step to catch the
latency issue.
[Details description of newly added log]
(snip) __get_backend(361) > HAL_MODULE_TBM: Prepare to open HAL backend: (snip)
-> Execute dlopen() and dlsym()
(snip) __get_backend(369) > HAL_MODULE_TBM: Open and Prepare to get HAL backend: (snip)
-> Execute 'init' function on hal-backend
(snip) __get_backend(384) > HAL_MODULE_TBM: Get HAL backend: (snip)
(snip) __put_backend(435) > HAL_MODULE_TBM: Prepare to exit HAL backend: (snip)
-> Execute 'exit' function on hal-backend
(snip) __put_backend(450) > HAL_MODULE_TBM: Exit and prepare to put HAL backend: (snip)
-> Execute dlclose()
(snip) __put_backend(462) > HAL_MODULE_TBM: Put HAL backend: (snip)
Change-Id: I91bfab7317bbe4f4600f5bba0475f85219261c21
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Jihoon Jung [Mon, 9 Dec 2024 04:06:43 +0000 (13:06 +0900)]
Remove Zigbee/Uwb hal layer
- Related to TRE-3221 and TRE-3222
Change-Id: Ice48b8a44ac501d21becdcd33f31597551695e9f
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Chanwoo Choi [Thu, 5 Dec 2024 11:49:14 +0000 (20:49 +0900)]
halcc: parser: Use small letter of 'ipc' transport method
The 'transport' property is able to have either 'passthrough' or 'ipc'.
In order to keep the consistent small letter style, replace 'IPC' with 'ipc'.
Change-Id: I2212337e1af49b04c2e23f92825bed602a4ca473
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 29 Nov 2024 04:17:05 +0000 (13:17 +0900)]
packaging: Increase release version-up on Tizen 10.0
When Tizen major version is up, will increase release version-up of
package. So that increase release version-up on Tizen 10.0.
Change-Id: I57edef9b19c0c22b54e308e494a777acea4452f8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 29 Nov 2024 03:58:32 +0000 (12:58 +0900)]
[DAPR-68] halapi: Add new HAL_MODULE_DA_AB_UPDATE module
[Role of HAL_MODULE_DA_AB_UPDATE module]
- Support A/B Partition Update
[Details description of newly added HAL_MODULE_DA_AB_UPDATE module]
- group : HAL_GROUP_SYSTEM,
- module : HAL_MODULE_DA_AB_UPDATE,
- license : HAL_LICENSE_APACHE_2_0,
- gbm_group : HAL_GBM_GROUP_DA,
- module_name : "HAL_MODULE_DA_AB_UPDATE",
- backend_module_name : "da-ab-update",
- library_name : "/hal/lib/libhal-backend-da-ab-update.so",
- library_name_64bit : "/hal/lib64/libhal-backend-da-ab-update.so",
- symbol_name : "hal_backend_da_ab_update_data",
- manifest : "/etc/hal/hal-api-da-ab-update-manifest.xml",
- hal_api : true,
Change-Id: I512ac51429625423c882fc16dfc29298155c14f1
Link: https://jira.sec.samsung.net/browse/DAPR-68
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 25 Nov 2024 09:29:18 +0000 (18:29 +0900)]
hal-common: Add new HAL_MODULE_DA_WOW module
HAL_MODULE_DA_WOW is supporting WOW (Wake On Wlan) functionality with Wifi Chip.
For using HAL_MODULE_DA_WOW, wifi chip have to support the keepalive
featuer on CPU suspend status and then Wifi chip should filter the
specific packet according to hal-api-wow user request. When receiving
the specific packet, Wifi chip will make the event to wakup CPU from
suspend and then hal-api-wow get the raised the kind of event.
[Details description of newly added HAL_MODULE_DA_WOW module]
- hal module : HAL_MODULE_DA_WOW
- group : HAL_GROUP_SYSTEM,
- module : HAL_MODULE_DA_WOW,
- license : HAL_LICENSE_APACHE_2_0,
- gbm_group : HAL_GBM_GROUP_DA,
- module_name : "HAL_MODULE_DA_WOW",
- backend_module_name : "da-wow",
- library_name : "/hal/lib/libhal-backend-da-wow.so",
- library_name_64bit : "/hal/lib64/libhal-backend-da-wow.so",
- symbol_name : "hal_backend_da_wow_data",
- manifest : "/etc/hal/hal-api-da-wow-manifest.xml",
- hal_api : true,
Change-Id: Iac845235eef4c2871f560016b900c7328babf7d6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 25 Nov 2024 09:03:45 +0000 (18:03 +0900)]
common: Add new enum hal_gbm_group to indicate owned GBM information
Need to add new HAL-API for each GBM. Each HAL-API need to include
the GBM information. So that add new enum hal_gbm_group to indicate
owned GBM information.
[Detailed of newly added enum hal_gbm_group]
- enum name : enum hal_gbm_group
- Indication of each hal_gbm_group enumeration
: HAL_GBM_GROUP_PUBLIC indicates Public Tizen.
: HAL_GBM_GROUP_DA indicates DA (Digital Appliance) Tizen.
Change-Id: I9fa55b3cc99f6f3c33dafb1c7fe25d2e596e2b15
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Sat, 16 Nov 2024 23:47:01 +0000 (08:47 +0900)]
packaging: Version 1.0.0
Changes:
- Add new hal_common_get/put_backend_v2()
- Add new HALCC (HAL Compatibility Checker)
- Add data migration script for HALCC
Change-Id: Ia929ed2e12360fce8c7f20d5aead10afe961792c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Wed, 23 Oct 2024 02:49:44 +0000 (11:49 +0900)]
halcc: Add %enable_halcc to enable/disable the feature selectively
There could be some environment that the hal-comaptibility-checker would
not be necessary. For example, a platform image that always accompanies
hal image when building will never worry about ABI compatibility between
them. In such case, the hal-compatibility-checker is pointless and no more
than a thing that degrades booting performance. For such reason,
%enable_halcc has been introduced on the .spec file and can be used to
exclude total halcc feature.
Change-Id: I26510db0374602303874265c2e99cb97c3c71fdc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 21 Oct 2024 02:48:21 +0000 (11:48 +0900)]
halcc: Move execution of halcc from generator to sysinit.target
systemd generator is executed in serialized order, not in parallel
like systemd services. So the time consumed by a program run by
systemd generator will throughly added up to the overall booting time.
Therefore, convert hal-compatibility-checker into a systemd service
and make it be pulled in by sysinit.target so it can run in parallel,
improving booting time. On top of this, as the service has change to
run as system_fw/system_fw (uid/gid), the permission of directory
/opt/etc/hal created by the service has changed to 0755 to make it
be able to write a file on that directory.
Change-Id: Ia56b8c2ed845c3321db0d9304a0cb182134f0e75
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 14 Oct 2024 07:42:32 +0000 (16:42 +0900)]
Add dependency to capi-base-common
It is required for the header tizen.h and enums such as TIZEN_ERROR_*
defined at the header. Those are accessible by the dependency to the
capi-base-common, which is currently pulled in by the dlog. However,
some build environment lack of such indirect dependency would blame
this. Therefore explicitly state the dependency.
Change-Id: I215b2eb2b16bbb931e7565d0d1adb436a425a6d0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 14 Oct 2024 07:41:30 +0000 (16:41 +0900)]
Revert "tests: Remove unnecessary header <tizen.h>"
This reverts commit
a6e22bdbc0245ddfe066154ac58d8dcf83f26a6e.
Change-Id: I54fae1421d436e19db7ca768b5e0b3259cd7e7b3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 26 Sep 2024 06:57:28 +0000 (15:57 +0900)]
tests: Remove unnecessary header <tizen.h>
Change-Id: I92cbc7872c9a0062bd58244f2463754c580373cf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 18 Jul 2024 06:51:42 +0000 (15:51 +0900)]
halcc: Remove checking SYSTEMD_SCOPE environment variable
The environment variable is used for testing whether the execution
context is systemd system generator. And for this, getenv() had been
utilized. However, there was a blame that the getenv() is vulnerable
as the environment variable could be controlled externally. Therefore,
removed using SYSTEMD_SCOPE environment variable.
Due to this, it has become that someone can create compatibility result
file, /opt/etc/hal/.hal-backend-compatibility, outside of systemd system
generator context. Nevertheless, we can screen out the worst case that
unprivileged process generates the file because the directory /opt/etc
has attribute of {root,system_share,0775}.
Change-Id: I89fd5abc5c2445ce827371f61244bbc9e388d438
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Wed, 10 Jul 2024 02:18:43 +0000 (11:18 +0900)]
packaging: Add data migration script to remove /opt/etc/hal/.hal-backend-compatibility
Remove /opt/etc/hal/.hal-backend-compatibility for data migration of OS
Upgarde to remove the invalid result of hal backend compatibility.
/opt/etc/hal/.hal-backend-compatibility should be created on first
booting by comparing the supported HAL interface version in HAL manifest
with hal-backend version.
Change-Id: Id6980ced56f7f8c2fee0f7b178e6534ad168b1cb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 1 Jul 2024 09:26:32 +0000 (18:26 +0900)]
halapi: common: Fix typo to hal_module
Change-Id: I56e70c0676381dde7b5b3dbaf368468a836b14a4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 27 Jun 2024 12:56:46 +0000 (21:56 +0900)]
halapi: common: Add hal_common_get/put_backend_v2 to support ABI compatibility
Add hal_common_get_backend_v2 and put_backend_v2 to support ABI
compatibility between HAL interface and HAL backend.
In order to suport HAL ABI compatibility, need to allocate the memory of
hal interface structure instead of hal bakcend.
So that hal_common_get/put_backend_v2 functions requires the init/exit_backend
function pointer of which initialize and deinitialze the
hal_backend_[module]_funcs instance like allocation/free memory.
[Newly added function to get/put backend]
int hal_common_get_backend_v2(enum hal_module module,
void **data, void *user_data,
int (*init_backend)(void **data, void *user_data));
int hal_common_put_backend_v2(enum hal_module module,
void *data, void *user_data,
int (*exit_backend)(void *data, void *user_data));
int hal_common_get_backend_with_library_name_v2(enum hal_module module,
void **data, void *user_data,
int (*init_backend)(void **data, void *user_data),
const char *library_name);
int hal_common_put_backend_with_library_name_v2(enum hal_module module,
void **data, void *user_data,
int (*exit_backend)(void *data, void *user_data),
const char *library_name);
Change-Id: I71de896383162032bc5b03348888dd97dedb5f52
Suggested-by: Jeongmo Yang <jm80.yang@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Wed, 26 Jun 2024 06:31:09 +0000 (15:31 +0900)]
halcc: Fix default compatibility to HAL_COMMON_BACKEND_COMPATIBLITY_UNKNOWN
It makes difference when there is no installed backend. Previously it
was regarded as HAL_COMMON_BACKEND_COMPATIBILITY_INCOMPATIBLE, but
it has changed to as HAL_COMMON_BACKEND_COMPATIBILITY_UNKNOWN. This
mainly affects lshal to print 'Compatibility' column empty if there
is no installed backend, which previously printed 'Incompatible' on
that column.
Change-Id: I00d87c66c76b22a35af8f8da87cdb3f75937225a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 26 Jun 2024 03:40:59 +0000 (12:40 +0900)]
halcc: Remove unused code
Change-Id: I08ed786774a6d0e7f25c1a232d688dd4f71ddac7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 26 Jun 2024 03:26:04 +0000 (12:26 +0900)]
tests: Separate functions exclusively used for testing
Change-Id: Ib3f1c089e1d1cfdbf1aafa4ab95e6cdc05acccf5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 09:53:03 +0000 (18:53 +0900)]
halcc: Add cache not to open() file multiple times on a same module
Change-Id: I623b0a7fd0fb223750aa24ea1737a2c7c2fe0a66
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 04:05:40 +0000 (13:05 +0900)]
tool: lshal: Replace 'Backend Verification' with 'Compatibility'
------------------------------------------------------------------
| ... | |
HAL Module Name | ... | Compatibility |
------------------------------------------------------------------
HAL_MODULE_TBM | ... | |
HAL_MODULE_TDM | ... | |
...
HAL_MODULE_POWER | ... | Compatible |
HAL_MODULE_SENSOR | ... | Incompatible |
The column 'Backend Verification' has been removed and replaced with
'Compatibility'.
Change-Id: I4f364b0d64b24c326101666b0685f2abf4963563
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 24 Jun 2024 10:03:10 +0000 (19:03 +0900)]
tool: lshal: Print interface and backend version
The last 2 columns have been added. For example
--------------------------------------------------------------------
| ... | Interface | Backend |
HAL Module Name | ... | Versions | Version |
--------------------------------------------------------------------
... | | | |
--------------------------------------------------------------------
HAL_MODULE_DEVICE_DISPLAY | ... | 1.0, 2.3, 3.2, 4.1 | 1.0 |
--------------------------------------------------------------------
... | | | |
- Interface Versions
: Versions specified at the manifest file,
/etc/hal/hal-api-{module}-manifest.xml. Can be more than one
if it has specified multiple supporting versions.
- Backend Version
: Version that an actual backend has been implemented with.
Change-Id: I035617f86396a7b730d26e7e6312d0dd20c86429
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 24 Jun 2024 08:32:09 +0000 (17:32 +0900)]
halcc: Add hal_common_get_supported_interface_versions()
It gets versions specified at manifest file.
Change-Id: Icdaa1e8c4615fa2aa046c1a6cd698f8061905a00
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 02:31:08 +0000 (11:31 +0900)]
halcc: Add module name info to error log
Change-Id: Ic1c1992dfc913f205f651c40005240700f9f6c07
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 01:38:37 +0000 (10:38 +0900)]
halcc: Fix errno not to be overwritten before returning
Change-Id: Iddc5f3e1abd43c6a9881fdde55ae354c47850b6a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 25 Jun 2024 01:34:15 +0000 (10:34 +0900)]
halcc: Fix file descriptor leak
Change-Id: I5cc2d7f628686d65513a740d4df15ca92cddca3b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 07:17:54 +0000 (16:17 +0900)]
systemd-hal-compatibility-checker-generator: Remove lost option --redirect-all
It has changed to have no choice but to emit log to dlog.
Change-Id: Ic15e4c8d47f199ec0410ee8ac19ff9ef78c0ec48
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 05:26:54 +0000 (14:26 +0900)]
halcc: Fix not to ask for HAL_MODULE_UNKNOWN to prevent error log spam
Change-Id: Icf874c346b00684960452c2023746bdbb67b4efb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 03:55:32 +0000 (12:55 +0900)]
tool: hal-compatibility-checker: Fix --skip-if-result-exist to work
To prevent checking repeatedly for every booting, the option skips
checking if there was result file.
Change-Id: If55a3a59c12765591e33c5c2899028af86452907
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 03:47:56 +0000 (12:47 +0900)]
halcc: Fix error log to dlog instead of stdout
It was printf() because it should work before dlog daemon start up.
However, it can be written to dlog even without dlog daemon. Therefore
replace printf() with dlog function. And by this, it becomes
unnecessary for tool hal-compatibility-checker that redirecting outputs.
Thus removed related options and operations.
Change-Id: I0e3a81f666b22b6f9ae909c81f7d62ea7431cc47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 19 Jun 2024 12:37:59 +0000 (21:37 +0900)]
halcc: Check only explicitly specified manifest file
halcc has changed to work only on top of manifest file specified in
hal-api-list.h instead of entire xml files at a directory.
Due to above, it becomes necessary that calling parsing function for
every single files, every requested hal module. To make it work,
fixed related function to operates on each single manifest file.
Change-Id: I67e48afb4d0248be37144b127d7068d9dff3452f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 20 Jun 2024 01:52:27 +0000 (10:52 +0900)]
tool: hal-compatibility-checker: Fix file path used by --reset
Change-Id: I3cd0a7b7d303e6c8d0d1aead41ed1f5cf49f5c8d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>