[Pkg/Cuse] Apply smack rules in the post script
authorDongju Chae <dongju.chae@samsung.com>
Mon, 27 Sep 2021 01:47:21 +0000 (10:47 +0900)
committer채동주/On-Device Lab(SR)/Staff Engineer/삼성전자 <dongju.chae@samsung.com>
Mon, 27 Sep 2021 05:31:21 +0000 (14:31 +0900)
This patch applies cuse-driver related smack rules in
the post script.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
packaging/npu-engine.spec

index 7edc286..a4e4fc7 100644 (file)
@@ -81,6 +81,17 @@ ninja -C build %{?_smp_mflags}
 # Install Core (NPU-Engine)
 DESTDIR=%{buildroot} ninja install -C build %{?_smp_mflags}
 
+# Add access permission to temp files for the CUSE driver
+%if 0%{?npu_cuse}
+%post
+touch /tmp/npu-engine-pid.txt
+touch /tmp/npu-engine.log
+chmod 666 /tmp/npu-engine-pid.txt
+chmod 666 /tmp/npu-engine.log
+chsmack -a "User::App::Shared" /tmp/npu-engine-pid.txt
+chsmack -a "User::App::Shared" /tmp/npu-engine.log
+%endif
+
 %files
 %manifest npu-engine.manifest
 %defattr(-,root,root,-)