我正在寻找一个内核参数,我可以在 GRUB 配置中使用它来永久禁用我新笔记本电脑的 LAN(有线以太网)卡上的EEE(节能以太网,维基百科):
基本信息:
# ethtool -i enp59s0
driver: r8169
version: 5.15.0-56-generic
firmware-version: rtl8168h-2_0.0.2 02/26/15
expansion-rom-version:
bus-info: 0000:3b:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no
什么有效(重启后不持久,睡眠和唤醒):
# ethtool --set-eee enp59s0 eee off
但是,我宁愿不必为此设置 @reboot CRON。
我在正在运行的机器上尝试过的,如这里、这里和其他地方所建议的:
# sysctl -w igb.EEE=0
# sysctl -w e1000e.EEE=0
# sysctl -w r8169.EEE=0
所有这些都以错误消息结尾:
sysctl: cannot stat /proc/sys/[PARAM]/EEE: No such file or directory
非常感谢您的帮助。
不存在这样的内核参数。
@reboot
但是,除了cron 作业之外,还有其他方法可以实现您的目标。如果您使用的是 NetworkManager,则可以创建一个预先调度程序脚本(例如
/etc/NetworkManager/dispatcher.d/pre-up.d/disable-eee
),以便在激活网络接口时更改配置:请务必将脚本标记为可执行。
或者,您可以创建
/etc/modprobe.d/disable-eee
以在加载内核模块时更改设置:(如果
r8169
内核模块是在 initramfs 启动阶段加载的,您可能必须先运行sudo update-initramfs -u
它才能在下次启动时生效。)或者您可以创建自己的
systemd
服务单元来运行 ethtool 命令(例如/etc/systemd/system/disable-eee.service
):重要提示:
根据您的操作系统配置,可能会像Vlastimil
ethtool
一样放置在其他地方。/usr/sbin/ethtool
如果您不确定,您可以运行which ethtool
或command -v ethtool
。程序也是如此logger
。