pass-hal: tm2: Add pass-hal.conf to change the permission of sysfs nodes 33/134233/4
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 15 Jun 2017 09:57:04 +0000 (18:57 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 16 Jun 2017 08:37:54 +0000 (17:37 +0900)
The pass-hal-tm2 package handles the many sysfs nodes in order
to change the state of h/w resources. All sysfs node should
be required to change the permission from root to system_fw
because PASS daemon has the system_fw permission.

So, this patch adds new pass-hal.conf which contains
the permission information for the required sysfs nodes.

Change-Id: Iab55cdc120e3283e35f2d97b4f3e887400a2fcfd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
CMakeLists.txt
packaging/pass-hal-tm2.spec
scripts/pass-hal.conf [new file with mode: 0644]

index 35033cc..edef99c 100644 (file)
@@ -25,3 +25,4 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource1.conf DESTINATIO
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource2.conf DESTINATION /etc/pass)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource3.conf DESTINATION /etc/pass)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource4.conf DESTINATION /etc/pass)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-hal.conf DESTINATION ${LIB_INSTALL_DIR}/tmpfiles.d)
index c5bed67..fe46ef7 100644 (file)
@@ -36,13 +36,16 @@ rm -rf %{buildroot}
 
 %make_install
 
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+systemd-tmpfiles /usr/lib/tmpfiles.d/pass-hal.conf --create
 
 %postun -p /sbin/ldconfig
 
 %files
 %manifest %{name}.manifest
 %{_libdir}/pass/*.so
+%{_libdir}/tmpfiles.d/pass-hal.conf
 
 %config %{_sysconfdir}/pass/pass.conf
 %config %{_sysconfdir}/pass/pass-resource0.conf
diff --git a/scripts/pass-hal.conf b/scripts/pass-hal.conf
new file mode 100644 (file)
index 0000000..5d823db
--- /dev/null
@@ -0,0 +1,30 @@
+z      /sys/devices/system/cpu/*/online        0660    root    system_fw       -
+t      /sys/devices/system/cpu/*/online        -       -       -       -       security.SMACK64="System"
+z      /sys/devices/system/cpu/*/cpufreq/scaling_available_governors   0440    root    system_fw       -
+t      /sys/devices/system/cpu/*/cpufreq/scaling_available_governors   -       -       -       -       security.SMACK64="System"
+z      /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq      0440    root    system_fw       -
+t      /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq      -       -       -       -       security.SMACK64="System"
+z      /sys/devices/system/cpu/*/cpufreq/scaling_governor      0660    root    system_fw       -
+t      /sys/devices/system/cpu/*/cpufreq/scaling_governor      -       -       -       -       security.SMACK64="System"
+z      /sys/devices/system/cpu/*/cpufreq/scaling_min_freq      0660    root    system_fw       -
+t      /sys/devices/system/cpu/*/cpufreq/scaling_min_freq      -       -       -       -       security.SMACK64="System"
+z      /sys/devices/system/cpu/*/cpufreq/scaling_max_freq      0660    root    system_fw       -
+t      /sys/devices/system/cpu/*/cpufreq/scaling_max_freq      -       -       -       -       security.SMACK64="System"
+z      /sys/devices/system/cpu/*/cpufreq/ondemand/up_threshold 0660    root    system_fw       -
+t      /sys/devices/system/cpu/*/cpufreq/ondemand/up_threshold -       -       -       -       security.SMACK64="System"
+z      /sys/class/thermal/*/temp       0440    root    system_fw       -
+t      /sys/class/thermal/*/temp       -       -       -       -       security.SMACK64="System"
+z      /sys/class/thermal/*/policy     0440    root    system_fw       -
+t      /sys/class/thermal/*/policy     -       -       -       -       security.SMACK64="System"
+z      /sys/kernel/debug/cpufreq/*/load_table  0440    root    system_fw       -
+t      /sys/kernel/debug/cpufreq/*/load_table  -       -       -       -       security.SMACK64="System"
+z      /sys/kernel/debug/cpufreq/*/load_table  0440    root    system_fw       -
+t      /sys/kernel/debug/cpufreq/*/load_table  -       -       -       -       security.SMACK64="System"
+z      /sys/devices/platform/soc/*/devfreq/*/cur_freq  0440    root    system_fw       -
+t      /sys/devices/platform/soc/*/devfreq/*/cur_freq  -       -       -       -       security.SMACK64="System"
+z      /sys/devices/platform/soc/*/devfreq/*/governor  0440    root    system_fw       -
+t      /sys/devices/platform/soc/*/devfreq/*/governor  -       -       -       -       security.SMACK64="System"
+z      /sys/devices/platform/soc/*/devfreq/*/min_freq  0660    root    system_fw       -
+t      /sys/devices/platform/soc/*/devfreq/*/min_freq  -       -       -       -       security.SMACK64="System"
+z      /sys/devices/platform/soc/*/devfreq/*/max_freq  0660    root    system_fw       -
+t      /sys/devices/platform/soc/*/devfreq/*/max_freq  -       -       -       -       security.SMACK64="System"