pass-hal: standard: Add pass-hal.conf to change the permission of sysfs nodes
authorDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 9 Aug 2017 07:02:36 +0000 (16:02 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 14 Aug 2017 01:33:38 +0000 (10:33 +0900)
The standard HAL package handles the many sysfs nodes to change the
state of h/w resources. Therefore, the proper permission for all
sysfs node to system_fw because PASS daemon has the system_fw
permission. To do this, this patch adds pass-hal.conf which contains
the permission information for the required sysfs nodes.

Change-Id: Ica5bfc55f2cc7e0ac1e9e914b25d8237daaacdcd
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
CMakeLists.txt
packaging/pass-hal-standard.spec
scripts/pass-hal.conf [new file with mode: 0644]

index 2abf5dd46c8e2f9037db4317ae89bcb2f704b623..e77331a36db64c2f0c05ee3a41da0e065fb95de1 100644 (file)
@@ -18,3 +18,5 @@ SET(DEST_DIR ${LIB_INSTALL_DIR}/pass)
 ADD_SUBDIRECTORY(src/cpu)
 ADD_SUBDIRECTORY(src/bus)
 ADD_SUBDIRECTORY(src/gpu)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-hal.conf DESTINATION /usr/lib/tmpfiles.d)
index 746f0cb424f9d37b9baed89fc5f319fc7c8454a6..58d84134cc795b4587ddb64e868481c916b2f85a 100644 (file)
@@ -38,6 +38,7 @@ rm -rf %{buildroot}
 
 %post
 /sbin/ldconfig
+systemd-tmpfiles /usr/lib/tmpfiles.d/pass-hal.conf --create
 if [ -f %{_unitdir}/pass.service ]; then
        systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
 fi
@@ -50,4 +51,5 @@ fi
 
 %files
 %manifest %{name}.manifest
+/usr/lib/tmpfiles.d/pass-hal.conf
 %{_libdir}/pass/*.so
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"