systemd: Add /hal/lib/firmware directory to kernel firmware path 57/253357/6 accepted/tizen/unified/20210217.030900 submit/tizen/20210216.032529 submit/tizen/20210216.094530
authorINSUN PYO <insun.pyo@samsung.com>
Tue, 9 Feb 2021 06:29:06 +0000 (15:29 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Tue, 16 Feb 2021 02:45:46 +0000 (11:45 +0900)
Before systemd starts any services, execute this command to add /hal/lib/firmware path.
 - echo "/hal/lib/firmware" > /sys/module/firmware_class/parameters/path

Change-Id: I972c0add7709975f595220bb6c108d509e005048
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
packaging/hal-api-common.spec
packaging/systemd-hal-firmware-generator [new file with mode: 0644]

index 8ef3a81..87a46cd 100644 (file)
@@ -12,6 +12,7 @@ License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 Source2:    libhal-api.conf
+Source3:    systemd-hal-firmware-generator
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -22,6 +23,8 @@ BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(json-glib-1.0)
 BuildRequires: pkgconfig(gmock)
 BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(systemd)
+
 %description
 %{name} interface
 
@@ -59,9 +62,9 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d/
 mkdir -p %{buildroot}/hal
-install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ld.so.conf.d/
+install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/ld.so.conf.d/libhal-api.conf
+install -D -m 0755 %{SOURCE3} %{buildroot}%{_systemdgeneratordir}/systemd-hal-firmware-generator
 
 %clean
 rm -rf %{buildroot}
@@ -82,9 +85,10 @@ fi
 %license LICENSE
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
+%dir /hal
 %{_libdir}/hal/*.so*
 %{_sysconfdir}/ld.so.conf.d/libhal-api.conf
-/hal/
+%{_systemdgeneratordir}/systemd-hal-firmware-generator
 %attr(644,root,root) %{TZ_SYS_RO_ETC}/hal/hal-api.json
 
 %files -n %{devel_name}
diff --git a/packaging/systemd-hal-firmware-generator b/packaging/systemd-hal-firmware-generator
new file mode 100644 (file)
index 0000000..b8f3dd7
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+echo "/hal/lib/firmware" > /sys/module/firmware_class/parameters/path