[Share Experiences] 为联想电脑(小新,Yoga,拯救者)实验性启用联想电脑管家的功能
Tofloor
poster avatar
jalawov
deepin
2023-08-14 01:13
Author

项目地址:https://github.com/johnfanv2/LenovoLegionLinux

主要功能:

  • 热切换电源模式(win下的Fn+Q切换省电/均衡/野兽)
  • 通过额外的传感器监测风扇速度和温度
  • 调整风扇曲线(部分型号可用)
  • 通过软件切换Fn锁;使用F1-F12键的特殊功能而不按Fn键
  • 电池快充/普通/养护模式调整
  • 联想bios支持的GPU/CPU 超频功能
  • 拯救者灯光调整

官方作者只测试了部分拯救者电脑并为他们作了适配,但是它在本人的Yoga Pro 14s 2022上也能正常工作,我怀疑可能有更多的联想笔记本可以使用这个驱动,因此分享这个帖子。本帖子主要分享在不受支持的笔记本上启用这个驱动,风险自负。如果你的笔记本在项目支持列表里,请按照github的方法来。

依赖安装:

本人使用的是Fedora,但是对于Debian/Ubuntu/Deepin来说,命令应该为:

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

编译并测试

git clone https://github.com/johnfanv2/LenovoLegionLinux.git
cd LenovoLegionLinux/kernel_module
make
sudo make reloadmodule
sudo dmesg # 查看内核日志

如果你的笔记本不在支持列表,在内核日志中会看到:legion_laptop not loaded for this device 所以我们需要在LenovoLegionLinux/kernel_module/Makefile文件添加编译选项如图

forcereloadmodule_disableplatformprofile:
	rmmod legion-laptop.ko || true
	insmod legion-laptop.ko force=1 enable_platformprofile=0
	dmesg --ctime
	bash -c "./issue-warning.sh"

截图 2023-08-13 16-58-38.png

然后 执行

sudo make forcereloadmodule_disableplatformprofile

该编译选项为驱动模块传递强制和忽略平台选项,因此执行成功后会启用所有的功能,但是这不一定意味着你的电脑可以使用请注意!(比如我的电脑不能手动调节风扇曲线,也不能控制A面的灯,因为根本没有)

如果你在内核日志中看到 legion_laptop loaded for this device,说明驱动已经加载。这时候

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

应该可以看到你的风扇曲线。

正式安装

经过测试没有问题后,我们正式安装它

make
sudo make install

注意:如果你是不受支持的电脑,这样重启以后还是无法使用,因为没有给模块传递参数。因此我们在/etc/modprobe.d下新建legion-laptop.conf,加入options legion-laptop force=1 enable_platformprofile=0。重启。你就会发现调整系统设置的平衡/省电/性能,主板也会自动的切换均衡/省电/野兽了。更多的高级功能,可以在项目根目录中执行

sudo python/legion_linux/legion_linux/legion_gui.py

fancurve能调节更多的高级设置

PS:如果你的电脑可以正常使用,请去项目issue给作者大大按照格式提供报告吧

Reply Favorite View the author
All Replies
fuuko
deepin
2023-08-14 01:21
#1

楼主头像好评like

Reply View the author
jjcui8595
Moderator
2023-08-14 01:58
#2

大赞like

Reply View the author
阿尼樱奈奈
Moderator
2023-08-14 02:05
#3

like

Reply View the author
hanzn-zzx
deepin
2023-08-14 02:58
#4

like赞!

Reply View the author
doodo
deepin
2023-08-14 04:46
#5
It has been deleted!
青稚°
Moderator
2023-08-14 04:48
#6

赞了like

Reply View the author
jalawov
deepin
2023-08-14 04:54
#7
doodo It has been deleted!

LenovoLegionLinux 也是配合power-profiles-daemon使用的,测试下来应该也不是拯救者专属,目前我用着效果比tlp好,基本接近Windows。不管是最大性能释放还是续航都有所增强

Reply View the author
Ziggy
deepin
2023-08-14 05:13
#8

不知道电池模式是不是支持调充点阈值呢

Reply View the author
jalawov
deepin
2023-08-14 05:17
#9
Ziggy

不知道电池模式是不是支持调充点阈值呢

可以养护模式,保持在50%,但是我没找到怎么手动调节阈值

图片.png

Reply View the author
doodo
deepin
2023-08-14 06:35
#10
It has been deleted!
jalawov
deepin
2023-08-14 07:19
#11
doodo It has been deleted!

是的,主要他还提供了驱动的功能,不然我的电脑风扇转速,cpu,gpu温度传感器全看不了,更遑论控制。还有他的控制是直接控制BIOS的模式,改了以后进windows也还能保持住。我不清楚这与tlp这种效果上有什么区别。

Reply View the author
doodo
deepin
2023-08-14 18:43
#12
It has been deleted!