Compare commits
13 Commits
a6026e8bb4
...
c99b45f9d4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c99b45f9d4 | ||
|
|
88216b119a | ||
|
|
d5ee6de8eb | ||
|
|
e897f95385 | ||
|
|
2bd4626d8a | ||
|
|
8300044558 | ||
|
|
5fc826aac0 | ||
|
|
a88689b8bb | ||
|
|
c0b8c180bf | ||
|
|
422769aafd | ||
|
|
9cb8537425 | ||
|
|
fbcbbb93c7 | ||
|
|
232fcc3882 |
14
README.md
14
README.md
@@ -53,6 +53,13 @@ sudo systemctl enable --now lenovo_fix.service
|
|||||||
```
|
```
|
||||||
Thanks to *felixonmars* for creating and maintaining this package.
|
Thanks to *felixonmars* for creating and maintaining this package.
|
||||||
|
|
||||||
|
### Artix Linux
|
||||||
|
```
|
||||||
|
makepkg -si
|
||||||
|
sudo rc-update add lenovo_fix default
|
||||||
|
sudo rc-service lenovo_fix start
|
||||||
|
```
|
||||||
|
|
||||||
### Debian/Ubuntu
|
### Debian/Ubuntu
|
||||||
```
|
```
|
||||||
sudo apt install git build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev python3-venv python3-wheel
|
sudo apt install git build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev python3-venv python3-wheel
|
||||||
@@ -130,6 +137,12 @@ sv down lenovo_fix
|
|||||||
rm /var/service/lenovo_fix
|
rm /var/service/lenovo_fix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you're using OpenRC instead of systemd:
|
||||||
|
```
|
||||||
|
rc-service lenovo_fix stop
|
||||||
|
rc-update del lenovo_fix default
|
||||||
|
```
|
||||||
|
|
||||||
If you also need to remove the tool from the system:
|
If you also need to remove the tool from the system:
|
||||||
```
|
```
|
||||||
rm -rf /opt/lenovo_fix /etc/systemd/system/lenovo_fix.service
|
rm -rf /opt/lenovo_fix /etc/systemd/system/lenovo_fix.service
|
||||||
@@ -145,6 +158,7 @@ cd lenovo-throttling-fix
|
|||||||
git pull
|
git pull
|
||||||
sudo ./install.sh
|
sudo ./install.sh
|
||||||
sudo systemctl restart lenovo_fix.service
|
sudo systemctl restart lenovo_fix.service
|
||||||
|
OpenRC: sudo rc-service lenovo_fix restart
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ cTDP: 0
|
|||||||
# Disable BDPROCHOT (EXPERIMENTAL)
|
# Disable BDPROCHOT (EXPERIMENTAL)
|
||||||
Disable_BDPROCHOT: False
|
Disable_BDPROCHOT: False
|
||||||
|
|
||||||
|
# All voltage values are expressed in mV and *MUST* be negative (i.e. undervolt)!
|
||||||
[UNDERVOLT.BATTERY]
|
[UNDERVOLT.BATTERY]
|
||||||
# CPU core voltage offset (mV)
|
# CPU core voltage offset (mV)
|
||||||
CORE: 0
|
CORE: 0
|
||||||
@@ -56,6 +57,7 @@ UNCORE: 0
|
|||||||
# Analog I/O voltage offset (mV)
|
# Analog I/O voltage offset (mV)
|
||||||
ANALOGIO: 0
|
ANALOGIO: 0
|
||||||
|
|
||||||
|
# All voltage values are expressed in mV and *MUST* be negative (i.e. undervolt)!
|
||||||
[UNDERVOLT.AC]
|
[UNDERVOLT.AC]
|
||||||
# CPU core voltage offset (mV)
|
# CPU core voltage offset (mV)
|
||||||
CORE: 0
|
CORE: 0
|
||||||
|
|||||||
10
install.sh
10
install.sh
@@ -6,6 +6,8 @@ if pidof systemd 2>&1 1>/dev/null; then
|
|||||||
systemctl stop lenovo_fix.service >/dev/null 2>&1
|
systemctl stop lenovo_fix.service >/dev/null 2>&1
|
||||||
elif pidof runit 2>&1 1>/dev/null; then
|
elif pidof runit 2>&1 1>/dev/null; then
|
||||||
sv down lenovo_fix >/dev/null 2>&1
|
sv down lenovo_fix >/dev/null 2>&1
|
||||||
|
elif pidof openrc 2>&1 1>/dev/null; then
|
||||||
|
rc-service lenovo_fix stop >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$INSTALL_DIR" >/dev/null 2>&1
|
mkdir -p "$INSTALL_DIR" >/dev/null 2>&1
|
||||||
@@ -26,6 +28,10 @@ if pidof systemd 2>&1 1>/dev/null; then
|
|||||||
elif pidof runit 2>&1 1>/dev/null; then
|
elif pidof runit 2>&1 1>/dev/null; then
|
||||||
echo "Copying runit service file"
|
echo "Copying runit service file"
|
||||||
cp -R runit/lenovo_fix /etc/sv/
|
cp -R runit/lenovo_fix /etc/sv/
|
||||||
|
elif pidof openrc-init 2>&1 1>/dev/null; then
|
||||||
|
echo "Copying OpenRC service file"
|
||||||
|
cp -R openrc/lenovo_fix /etc/init.d/lenovo_fix
|
||||||
|
chmod 755 /etc/init.d/lenovo_fix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Building virtualenv..."
|
echo "Building virtualenv..."
|
||||||
@@ -44,6 +50,10 @@ elif pidof runit 2>&1 1>/dev/null; then
|
|||||||
echo "Enabling and starting runit service..."
|
echo "Enabling and starting runit service..."
|
||||||
ln -sv /etc/sv/lenovo_fix /var/service/
|
ln -sv /etc/sv/lenovo_fix /var/service/
|
||||||
sv up lenovo_fix
|
sv up lenovo_fix
|
||||||
|
elif pidof openrc-init 2>&1 1>/dev/null; then
|
||||||
|
echo "Enabling and starting OpenRC service..."
|
||||||
|
rc-update add lenovo_fix default
|
||||||
|
rc-service lenovo_fix start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "All done."
|
echo "All done."
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ supported_cpus = {
|
|||||||
'Kaby Lake (R)': (0x8E, 0x9E),
|
'Kaby Lake (R)': (0x8E, 0x9E),
|
||||||
'Coffee Lake': (0x9E,),
|
'Coffee Lake': (0x9E,),
|
||||||
'Cannon Lake': (0x66,),
|
'Cannon Lake': (0x66,),
|
||||||
|
'Comet Lake': (0xA6,),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -530,8 +531,8 @@ def set_hwp():
|
|||||||
|
|
||||||
def set_disable_bdprochot():
|
def set_disable_bdprochot():
|
||||||
# Disable BDPROCHOT
|
# Disable BDPROCHOT
|
||||||
cur_val = readmsr(0x1FC,flatten=True)
|
cur_val = readmsr(0x1FC, flatten=True)
|
||||||
new_val = (cur_val & 0xFFFFFFFFFFFFFFFE)
|
new_val = cur_val & 0xFFFFFFFFFFFFFFFE
|
||||||
|
|
||||||
writemsr(0x1FC, new_val)
|
writemsr(0x1FC, new_val)
|
||||||
if args.debug:
|
if args.debug:
|
||||||
@@ -787,6 +788,7 @@ def main():
|
|||||||
regs = calc_reg_values(platform_info, config)
|
regs = calc_reg_values(platform_info, config)
|
||||||
|
|
||||||
if not config.getboolean('GENERAL', 'Enabled'):
|
if not config.getboolean('GENERAL', 'Enabled'):
|
||||||
|
log('[I] Throttled is disabled in config file... Quitting. :(')
|
||||||
return
|
return
|
||||||
|
|
||||||
exit_event = Event()
|
exit_event = Event()
|
||||||
|
|||||||
5
openrc/lenovo_fix
Normal file
5
openrc/lenovo_fix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/openrc-run
|
||||||
|
command="env python3 /usr/lib/throttled/lenovo_fix.py"
|
||||||
|
pidfile=${pidfile-/var/run/lenovo_fix.pid}
|
||||||
|
description="Stop Intel throttling"
|
||||||
|
command_background="yes"
|
||||||
31
package/PKGBUILD
Normal file
31
package/PKGBUILD
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
pkgname=throttled
|
||||||
|
pkgver=0.6
|
||||||
|
pkgrel=4
|
||||||
|
pkgdesc="Workaround for Intel throttling issues in Linux."
|
||||||
|
arch=('any')
|
||||||
|
url="https://github.com/erpalma/throttled"
|
||||||
|
license=('MIT')
|
||||||
|
depends=('python-dbus' 'python-psutil' 'python-gobject')
|
||||||
|
conflicts=('lenovo-throttling-fix-git' 'lenovo-throttling-fix')
|
||||||
|
replaces=('lenovo-throttling-fix')
|
||||||
|
backup=('etc/lenovo_fix.conf')
|
||||||
|
source=("git+https://github.com/Hyper-KVM/throttled.git#branch=openrc")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}/throttled/"
|
||||||
|
python -m compileall *.py
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "${srcdir}/throttled/"
|
||||||
|
install -Dm644 etc/lenovo_fix.conf "$pkgdir"/etc/lenovo_fix.conf
|
||||||
|
install -Dm644 systemd/lenovo_fix.service "$pkgdir"/usr/lib/systemd/system/lenovo_fix.service
|
||||||
|
install -Dm755 lenovo_fix.py "$pkgdir"/usr/lib/$pkgname/lenovo_fix.py
|
||||||
|
install -Dm755 openrc/lenovo_fix "$pkgdir/etc/init.d/lenovo_fix"
|
||||||
|
install -Dm755 mmio.py "$pkgdir"/usr/lib/$pkgname/mmio.py
|
||||||
|
cp -a __pycache__ "$pkgdir"/usr/lib/$pkgname/
|
||||||
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user