笔记本电脑上的 Arch linux 在盖子关闭/打开后禁用 wifi

笔记本电脑上的 Arch linux 在盖子关闭/打开后禁用 wifi

我有一台使用 NetworkManager 运行 Arch Linux 的笔记本电脑。每次我合上盖子时,WiFi 就会被禁用(rfkill显示“软阻止”)。

我已经尝试了一切:禁用省电、重新安装 NetworkManager...

这是我的日记:

Jul 13 19:44:40 commondevice systemd-logind[271]: Lid closed.
Jul 13 19:44:40 commondevice kernel: wlo1: deauthenticating from 50:d2:f5:2c:d0:e0 by local choice (Reason: 3=DEAUTH_LEAVING)
Jul 13 19:44:40 commondevice wpa_supplicant[283]: wlo1: CTRL-EVENT-DISCONNECTED bssid=50:d2:f5:2c:d0:e0 reason=3 locally_generated=1
Jul 13 19:44:40 commondevice wpa_supplicant[283]: rfkill: WLAN soft blocked
Jul 13 19:44:40 commondevice NetworkManager[2125]: <info>  [1689266680.9394] manager: rfkill: Wi-Fi now disabled by radio killswitch
Jul 13 19:44:40 commondevice NetworkManager[2125]: <info>  [1689266680.9396] device (wlo1): state change: activated -> unavailable (reason 'none', sys-iface-state: 'managed')
Jul 13 19:44:40 commondevice NetworkManager[2125]: <info>  [1689266680.9534] dhcp4 (wlo1): canceled DHCP transaction
Jul 13 19:44:40 commondevice NetworkManager[2125]: <info>  [1689266680.9535] dhcp4 (wlo1): activation: beginning transaction (timeout in 45 seconds)
Jul 13 19:44:40 commondevice NetworkManager[2125]: <info>  [1689266680.9535] dhcp4 (wlo1): state changed no lease
Jul 13 19:44:40 commondevice systemd[1]: Starting Load/Save RF Kill Switch Status...
Jul 13 19:44:40 commondevice systemd[1]: Started Load/Save RF Kill Switch Status.
Jul 13 19:44:40 commondevice systemd-logind[271]: Lid opened.
Jul 13 19:44:41 commondevice NetworkManager[2125]: <info>  [1689266681.1575] manager: NetworkManager state is now DISCONNECTED
Jul 13 19:44:41 commondevice wpa_supplicant[283]: wlo1: CTRL-EVENT-DSCP-POLICY clear_all
Jul 13 19:44:41 commondevice dbus-daemon[270]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.74' (uid=0 pid=2125 comm="/usr/bin/NetworkManager --no-daemon")
Jul 13 19:44:41 commondevice systemd[1]: Starting Network Manager Script Dispatcher Service...
Jul 13 19:44:41 commondevice wpa_supplicant[283]: wlo1: CTRL-EVENT-DSCP-POLICY clear_all
Jul 13 19:44:41 commondevice wpa_supplicant[283]: nl80211: deinit ifname=wlo1 disabled_11b_rates=0
Jul 13 19:44:41 commondevice dbus-daemon[270]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jul 13 19:44:41 commondevice systemd[1]: Started Network Manager Script Dispatcher Service.
Jul 13 19:44:45 commondevice systemd[1]: systemd-rfkill.service: Deactivated successfully.
Jul 13 19:44:48 commondevice dbus-daemon[270]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-org.freedesktop.home1.service' requested by ':1.92' (uid=1000 pid=2658 comm="/usr/lib/xfce4-screensaver-dialog --monitor=0 --he")
Jul 13 19:44:48 commondevice dbus-daemon[270]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.home1.service': Unit dbus-org.freedesktop.home1.service not found.
Jul 13 19:44:48 commondevice xfce4-screensaver-dialog[2658]: pam_systemd_home(xfce4-screensaver:auth): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.
Jul 13 19:44:48 commondevice rtkit-daemon[484]: Supervising 4 threads of 2 processes of 1 users.
Jul 13 19:44:48 commondevice rtkit-daemon[484]: Supervising 4 threads of 2 processes of 1 users.
Jul 13 19:44:51 commondevice xfce4-screensaver-dialog[2658]: gkr-pam: unlocked login keyring
Jul 13 19:44:51 commondevice xfce4-screensaver-dialog[2658]: pam_warn(xfce4-screensaver:account): function=[pam_sm_acct_mgmt] flags=0 service=[xfce4-screensaver] terminal=[:0.0] user=[mrvoid] ruser=[<unknown>] rhost=[<unknown>]
Jul 13 19:44:51 commondevice systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.

答案1

如果您不需要使用物理开关禁用 wifi,您可以尝试将rfkill模块列入黑名单吗?也许尝试先用 删除它modprobe -r rfkill,看看是否可以防止关闭盖子时的阻塞行为?

(我确信有更好的方法来做到这一点,但这可能是一个快速修复)

答案2

如果不需要深入研究问题,
您可以使用[tlp][1]可以在启动时“强制”打开 wifi 电源的软件


[1] https://github.com/linrunner/TLP

相关内容