commit bdfd79682c65c45fc33fa251da5deaea33c77252
Author: Benjamin Berg <bberg(a)redhat.com>
Date: Sat Jun 8 14:22:57 2019 +0200
Package dptfxtract (#5268)
.gitignore | 1 +
dptfxtract.service | 42 +++++++++++++++++++++++++++++++++++
dptfxtract.spec | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
4 files changed, 108 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..85f32fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/v1.3.tar.gz
diff --git a/dptfxtract.service b/dptfxtract.service
new file mode 100644
index 0000000..8e0a68f
--- /dev/null
+++ b/dptfxtract.service
@@ -0,0 +1,42 @@
+[Unit]
+Description=Create thermald configuration using dptfxtract
+
+PropagatesReloadTo=thermald.service
+Before=thermald.service
+
+# Ensure the target directory exists
+ConditionPathExists=/var/run/thermald/
+# The file in /etc is prefered when it exists, so don't extract data in that case
+ConditionPathExists=!/etc/thermald/thermal-conf.xml.auto
+
+[Service]
+Type=oneshot
+ExecStart=/usr/libexec/dptfxtract -o /var/run/thermald/
+Restart=no
+
+NoNewPrivileges=yes
+LimitCPU=10
+LimitDATA=50M
+LimitNPROC=1
+
+ProtectHome=yes
+ProtectSystem=full
+ReadWritePaths=/var/run/thermald/
+PrivateTmp=yes
+PrivateDevices=yes
+PrivateNetwork=yes
+PrivateUsers=yes
+ProtectKernelTunables=yes
+ProtectKernelModules=yes
+ProtectControlGroups=yes
+RestrictAddressFamilies=
+RestrictNamespaces=
+LockPersonality=yes
+MemoryDenyWriteExecute=yes
+RestrictRealtime=yes
+RestrictSUIDSGID=yes
+SystemCallFilter=@basic-io @file-system @signal @process ioctl mprotect brk
+SystemCallArchitectures=native
+
+[Install]
+WantedBy=thermald.service
diff --git a/dptfxtract.spec b/dptfxtract.spec
new file mode 100644
index 0000000..09846bc
--- /dev/null
+++ b/dptfxtract.spec
@@ -0,0 +1,64 @@
+Name: dptfxtract
+Version: 1.3
+Release: 1%{?dist}
+Summary: Utility to generate a thermald configuration from DPTF
+
+License: Redistributable, no modification permitted
+URL:
https://github.com/intel/dptfxtract
+ExclusiveArch: x86_64
+Source0:
https://github.com/intel/dptfxtract/archive/v%{version}.tar.gz
+Source1: dptfxtract.service
+
+BuildRequires: systemd-rpm-macros
+Requires: thermald
+
+%{?systemd_requires}
+
+%global debug_package %{nil}
+
+%description
+This is a companion tool to Linux Thermal Daemon (thermald). This tool tries to
+reuse some of the tables used by "Intel ® Dynamic Platform and Thermal
+Framework (Intel® DPTF)" by converting to the thermal_conf.xml format used by
+thermald.
+
+Integration with thermald is included so that that a thermald configuration
+will be created automatically if thermald is enabled.
+
+%prep
+%autosetup
+
+%build
+
+%post
+%systemd_post dptfxtract.service
+systemctl try-restart thermald.service
+
+%preun
+%systemd_preun dptfxtract.service
+
+%postun
+%systemd_postun_with_restart dptfxtract.service
+
+%install
+mkdir -p %{buildroot}%{_libexecdir}
+mkdir -p %{buildroot}%{_unitdir}
+mkdir -p %{buildroot}%{_unitdir}/thermald.service.wants
+mkdir -p %{buildroot}usr/share/doc/dptfxtract
+
+install -m 755 dptfxtract %{buildroot}%{_libexecdir}/dptfxtract
+install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
+ln -s ../dptfxtract.service
%{buildroot}%{_unitdir}/thermald.service.wants/dptfxtract.service
+
+%files
+%{_libexecdir}/dptfxtract
+%{_unitdir}/dptfxtract.service
+%dir %{_unitdir}/thermald.service.wants
+%{_unitdir}/thermald.service.wants/dptfxtract.service
+%license COPYING
+%doc README.txt
+
+
+%changelog
+* Sat Jun 08 2019 Benjamin Berg <bberg(a)redhat.com> - 1.3-1
+- Package dptfxtract (#5268)
diff --git a/sources b/sources
index e69de29..ddf2bbb 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+9caf01728b0d2f71fa9c3af462de3e2c v1.3.tar.gz