hardware: use copr repo instead of script file

There is a much more stable and actively maintained copr package

As of Dec. 2020 Lenovo is aware of the problem but does not state an
official relase date of a fix.
parent 6d22b7d6
Pipeline #5235 failed
[Unit]
Description=set cpu heating limit to 97°c
[Service]
ExecStart=/usr/local/bin/cpu-throttling.sh
RemainAfterExit=no
[Install]
WantedBy=timers.target
\ No newline at end of file
#!/bin/bash
/bin/modprobe msr
wrmsr -a 0x1a2 0x3000000 # which sets the offset to 3 C, so the new trip point is 97 C
\ No newline at end of file
[Unit]
Description=set cpu heating limit to 97°c every minute
[Timer]
OnActiveSec=60
OnUnitActiveSec=60
Unit=cpu-throttling.service
[Install]
WantedBy=timers.target
\ No newline at end of file
......@@ -3,77 +3,26 @@
- name: Fix CPU Throttling Issues
block:
- name: Install msr-tools
dnf:
name: msr-tools
state: present
- name: Enable COPR
command: "dnf copr enable -y abn/throttled"
args:
creates: "_copr:copr.fedorainfracloud.org:abn:throttled.repo"
warn: false
tags:
- lenovo
- carbon
- 6th
- patches
- dnf
- packages
- copr
become: true
- name: Install CPU-Throttling patch script
copy:
src: cpu-throttling.sh
dest: /usr/local/bin/cpu-throttling.sh
mode: 0755
register: cpu_throttling_script
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Install CPU-Throttling systemd service
when: cpu_throttling_script is succeeded
copy:
src: cpu-throttling.service
dest: /etc/systemd/system/cpu-throttling.service
register: cpu_throttling_service
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Install CPU-throttling systemd timer
when: cpu_throttling_service is succeeded
copy:
src: cpu-throttling.timer
dest: /etc/systemd/system/cpu-throttling.timer
register: cpu_throttling_timer
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Enable CPU-throttling systemd service
when: cpu_throttling_service is succeeded
systemd:
name: cpu-throttling.service
enabled: yes
state: started
daemon_reload: yes
become: true
notify: "Throttling patch restart notification"
- name: Enable CPU-throttling systemd timer
when: cpu_throttling_timer is succeeded
- name: Enable systemd service
systemd:
name: cpu-throttling.timer
name: throttled.service
enabled: yes
state: started
daemon_reload: yes
become: true
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version is version('32', '>')
- hardware_thinkpad_x1_carbon_6th_cpu_throttling_fix is defined
- hardware_thinkpad_x1_carbon_6th_cpu_throttling_fix
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment