Debian Buster: Thinkpad E431 盖上显示屏后无法休眠

内核版本:4.19.0-5-amd64
现象为盖上显示屏后,系统不能进入休眠,盖子上的指示灯不会变成呼吸状态。经查看日志,与touchpad的驱动有关,即psmouse 模块,如果在盖上之前,通过 modprobe -r psmouse将其退出,则盖上盖后可以正常休眠。打开盖子后,通过 modprobe psmouse重新加载驱动,触摸也能正常使用。

之前找到一篇文章,是在 /etc/pm/sleep.d下面增加如下内容的脚本,通过 pm-hibernate命令可以正常进入到休眠状态,但如果直接盖显示屏是不行的。

#!/bin/sh
#
# Reload the psmouse module

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "${1}" in
   hibernate|suspend)
       rmmod psmouse
       ;;
   thaw|resume)
       modprobe psmouse
       ;;
   *)
       ;;
esac

今天在 https://askubuntu.com/questions/671910/touchpad-not-working-after-suspending-laptop 看到了正解,即在/lib/systemd/system-sleep/下增加如下内容的脚本可以解决问题,注意要将脚本改成可执行

#!/bin/sh

case $1/$2 in
  pre/*)
    echo "Going to $2..."
    # Place your pre suspend commands here, or `exit 0` if no pre suspend action required
    modprobe -r psmouse
    ;;
  post/*)
    echo "Waking up from $2..."
    # Place your post suspend (resume) commands here, or `exit 0` if no post suspend action required
    sleep 2
    modprobe psmouse
    ;;
esac
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值