r8169: system-sleep hook for module unloading as a workaround for driver not working after resume from suspend

This commit is contained in:
Silvan Calarco 2016-03-08 12:08:39 +01:00
parent 94d9fb5882
commit 582526fc08
2 changed files with 12 additions and 0 deletions

View File

@ -67,6 +67,7 @@ xdg_directorydir = ${datadir}/desktop-directories
xdg_menudir = ${sysconfdir}/xdg/menus
xdg_mergedmenudir = $(xdg_menudir)/applications-merged
systemdsystemdir = /lib/systemd/system
systemdsleepdir = /lib/systemd/system-sleep
distrorootdir = ${datadir}/$(DISTROid)
distrobindir = ${distrorootdir}/bin
@ -148,12 +149,14 @@ install-kde-distro-addons: dist-update
@$(INSTALL_DIR) $(DESTDIR)$(sbindir)
@$(INSTALL_DIR) $(DESTDIR)$(distrobindir)
@$(INSTALL_DIR) $(DESTDIR)$(mambaimagesdir)
@$(INSTALL_DIR) $(DESTDIR)$(systemdsleepdir)
cp -r etc/polkit-1 $(DESTDIR)$(sysconfdir)/
cp -r etc/prelink.conf.d $(DESTDIR)$(sysconfdir)/
cp -r etc/profile.d $(DESTDIR)$(sysconfdir)/
cp -r etc/sudoers.d $(DESTDIR)$(sysconfdir)/
cp -r etc/sysconfig $(DESTDIR)$(sysconfdir)/
cp -r etc/xprofile.d $(DESTDIR)$(sysconfdir)/
cp etc/system-sleep/* $(DESTDIR)$(systemdsleepdir)/
chmod 755 $(DESTDIR)$(sysconfdir)/profile.d/*.sh
chmod 755 $(DESTDIR)$(sysconfdir)/xprofile.d/*.sh
$(INSTALL_SCRIPT) kde/scripts/showlog $(DESTDIR)$(distrobindir)

9
etc/system-sleep/r8169 Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
TMPFILE=/tmp/system-sleep-hook-r8169.tmp
if [ "$1/$2" = "pre/suspend" ]; then
rmmod r8169
touch $TMPFILE
elif [ "$1/$2" = "post/suspend" -a -e $TMPFILE ]; then
modprobe r8169
rm -f $TMPFILE
fi