[Share Experiences] Experimentally Enabling Computer Manager for Lenovo Computers
Tofloor
poster avatar
SuperDavid
deepin
2024-08-23 15:28
Author

[Experience Sharing] Experimentally Enabling Lenovo Computer Manager Functionality for Lenovo Computers (Xiaoxin, Yoga, Legion)

Project Address: LenovoLegionLinux on GitHub

Main Features:

  • Hot-switching power modes (Fn+Q switch between power-saving, balanced, and beast modes in Windows)
  • Monitor fan speed and temperature through additional sensors
  • Adjust fan curves (available for some models)
  • Switch Fn lock via software; use F1-F12 keys' special functions without pressing Fn
  • Adjust battery fast charging, normal, and maintenance modes
  • GPU/CPU overclocking functions supported by Lenovo BIOS
  • Adjust Legion lighting

The official author has only tested and adapted this for some Legion computers, but it also works on my Yoga Pro 14s 2022. I suspect more Lenovo laptops can use this driver, so I am sharing this post. This post primarily shares how to enable this driver on unsupported laptops, at your own risk. If your laptop is on the project's supported list, follow the GitHub method.

**Dependencies Installation:**I am using Fedora, but for Debian/Ubuntu/Deepin, the command should be:

sudo apt-get update

sudo apt-get install -y make gcc linux-headers-$(uname -r) build-essential git lm-sensors wget python3-pyqt5 python3-yaml python3-venv python3-pip python3-argcomplete

# Install the following for installation with DKMS

sudo apt-get install dkms openssl mokutil

Compile and Test

git clone https://github.com/johnfanv2/LenovoLegionLinux.git

cd LenovoLegionLinux/kernel_module

make

sudo make reloadmodule

sudo dmesg # Check kernel logs

If your laptop is not on the supported list, you will see in the kernel log: legion_laptop not loaded for this device. Therefore, we need to add compile options in the LenovoLegionLinux/kernel_module/Makefile file as shown below:

forcereloadmodule_disableplatformprofile:

rmmod legion-laptop.ko || true

insmod legion-laptop.ko force=1 enable_platformprofile=0

dmesg --ctime

bash -c "./issue-warning.sh"

Then execute:

sudo make forcereloadmodule_disableplatformprofile

This compile option passes the force and ignore platform options to the driver module, so after successful execution, all features will be enabled. However, this does not necessarily mean your computer can use them (for instance, my computer cannot manually adjust fan curves or control the lighting on the A side because it simply doesn't have these features).

If you see legion_laptop loaded for this device in the kernel log, it means the driver is loaded. At this point:

sudo cat /sys/kernel/debug/legion/fancurve

You should be able to see your fan curve.

Formal Installation

After testing and confirming no issues, formally install it:

make

sudo make install

Note: If your computer is unsupported, it still won't work after a reboot because the module parameters weren't passed. Therefore, create a legion-laptop.conf file in /etc/modprobe.d, and add:

options legion-laptop force=1 enable_platformprofile=0

Reboot. You will notice that adjusting system settings for balance/power-saving/performance will automatically switch the motherboard between balanced/power-saving/beast modes. For more advanced features, execute in the project's root directory:

sudo python/legion_linux/legion_linux/legion_gui.py

fancurve can adjust more advanced settings.

PS: If your computer works normally, please provide a report to the author in the project issues as per the format.

Reply Favorite View the author
All Replies
l***[email protected]
deepin
2024-08-27 11:26
#1
It has been deleted!