修复opensuse不能进入睡眠模式(suspend)

#环境

  • os: OpenSUSE Tumbleweed
  • pc: Apple macbook 13’ pro 2015

#故障描述
电源管理设置成合上屏进入睡眠模式,但发现笔记本从包里拿出来时很烫

#修复
查看当前唤醒的设备

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
tianfei@openSuSeLinux:~> cat /proc/acpi/wakeup 
Device S-state Status Sysfs node
PEG0 S3 *disabled
EC S3 *disabled platform:PNP0C09:00
HDEF S3 *disabled pci:0000:00:1b.0
RP01 S3 *disabled pci:0000:00:1c.0
RP02 S3 *disabled pci:0000:00:1c.1
RP03 S4 *disabled pci:0000:00:1c.2
ARPT S4 *enabled pci:0000:03:00.0
RP05 S3 *disabled pci:0000:00:1c.4
RP06 S3 *disabled pci:0000:00:1c.5
SPIT S3 *disabled spi:spi-APP000D:00
XHC1 S3 *enabled pci:0000:00:14.0
ADP1 S3 *disabled platform:ACPI0003:00
LID0 S3 *enabled platform:PNP0C0D:00

其中enable的是可执行唤醒的设备,S3 state是suspend的状态.
保留使用电源键及开屏唤醒

1
2
3
4
5
6
7
8
9
#
# disabling wakeup on USB --- use just PWRB
#
for device in XHC EHC1 EHC2; do
grep $device /proc/acpi/wakeup | grep enabled > /dev/null && {
echo Disabling wakeup on $device
echo $device > /proc/acpi/wakeup
}
done

将脚本内容放置在/etc/init.d/boot.local中就可以了.

参考:
https://askubuntu.com/questions/552345/can-not-suspend-my-laptop-asus

坚持原创技术分享,您的支持将鼓励我继续创作!