@allen 发表于 2018-2-6 11:42:56

S500 Linux 系统休眠与唤醒

本帖最后由 @allen 于 2018-2-10 10:55 编辑

S500 Linux是支持休眠与唤醒的。但wifi 驱动 wlan_bcmdhd 走的是卸载/加载驱动的流程,所以进 入 suspend 时 必 须 卸 载 驱 动,resume后重新加载驱动才可以正常使用。不然会出现内核休眠会出现失败的情况。
结合debian 8 的systemd 特性,写个脚本来执行这个动作实现休眠与唤醒功能。

在/lib/systemd/system-sleep/ 添加owl-wifi.sh脚本vi /lib/systemd/system-sleep/owl-wifi.sh
#!/bin/sh
#Take care of wifi module insmod/rmmod during system suspend/resume
if [ $1 = "pre" ]; then
modprobe -r wlan_bcmdhd
elif [ $1 = "post" ]; then
modprobe wlan_bcmdhd
fi

保存,加执行权限
chmod 777 /lib/systemd/system-sleep/owl-wifi.sh
reboot

systemctl suspend即可进入休眠

休眠打印如下:root@cubieboard6:~# systemctl suspend
root@cubieboard6:~# [   47.961789] : atc2603c_suspend
[   47.961789]
[   48.475895] ddr checksum ok
通过power按键或是红外遥控器可唤醒


参考链接:
休眠接口
systemd

newCubie 发表于 2018-3-24 23:30:58

cb6文章好少啊
页: [1]
查看完整版本: S500 Linux 系统休眠与唤醒