updating sleep script to fix resume issues

This commit is contained in:
Jake Day 2018-06-24 13:28:16 -04:00
parent 14395024b9
commit bcc46bc1e1
3 changed files with 33 additions and 26 deletions

View file

@ -1,24 +0,0 @@
#!/bin/sh
case $1/$2 in
pre/*)
systemctl stop NetworkManager.service
#echo 1 > /sys/bus/pci/devices/0000\:02\:00.0/reset
#echo 0 > "/sys/bus/pci/devices/0000:02:00.0/d3cold_allowed" # nvme
#echo 0 > "/sys/bus/pci/devices/0000:03:00.0/d3cold_allowed" # wifi
rmmod intel_ipts
rmmod mei_me
rmmod mei
rmmod mwifiex_pcie
rmmod mwifiex
;;
post/*)
modprobe intel_ipts
modprobe mei_me
modprobe mei
modprobe mwifiex_pcie
modprobe mwifiex
#echo 1 > /sys/bus/pci/devices/0000\:02\:00.0/reset
echo 1 > /sys/bus/pci/rescan
systemctl start NetworkManager.service
;;
esac

View file

@ -0,0 +1,31 @@
#!/bin/bash
case $1 in
pre)
# unload the modules before going to sleep
systemctl stop NetworkManager.service
modprobe -r intel_ipts
modprobe -r mei_me
modprobe -r mei
modprobe -r mwifiex_pcie;
modprobe -r mwifiex;
modprobe -r cfg80211;
;;
post)
# need to cycle the modules on a resume and after the reset is called, so unload...
modprobe -r intel_ipts
modprobe -r mei_me
modprobe -r mei
modprobe -r mwifiex_pcie;
modprobe -r mwifiex;
modprobe -r cfg80211;
# and reload
modprobe -i intel_ipts
modprobe -i mei_me
modprobe -i mei
modprobe -i cfg80211;
modprobe -i mwifiex;
modprobe -i mwifiex_pcie;
echo 1 > /sys/bus/pci/rescan
systemctl restart NetworkManager.service
;;
esac

View file

@ -34,8 +34,8 @@ echo "\nContinuing setup...\n"
echo "Coping the config files under root to where they belong...\n"
cp -R root/* /
echo "Making /lib/systemd/system-sleep/hibernate executable...\n"
chmod a+x /lib/systemd/system-sleep/hibernate
echo "Making /lib/systemd/system-sleep/sleep executable...\n"
chmod a+x /lib/systemd/system-sleep/sleep
read -rp "Do you want to replace suspend with hibernate? (type yes or no) " usehibernate;echo