Commit 582526fc0891697f00928ff77874f19ec22d6a53

Authored by Silvan Calarco
1 parent 94d9fb5882
Exists in master and in 1 other branch milestone3

r8169: system-sleep hook for module unloading as a workaround for driver not wor…

…king after resume from suspend

Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff

... ... @@ -67,6 +67,7 @@
67 67 xdg_menudir = ${sysconfdir}/xdg/menus
68 68 xdg_mergedmenudir = $(xdg_menudir)/applications-merged
69 69 systemdsystemdir = /lib/systemd/system
  70 +systemdsleepdir = /lib/systemd/system-sleep
70 71  
71 72 distrorootdir = ${datadir}/$(DISTROid)
72 73 distrobindir = ${distrorootdir}/bin
73 74  
... ... @@ -148,12 +149,14 @@
148 149 @$(INSTALL_DIR) $(DESTDIR)$(sbindir)
149 150 @$(INSTALL_DIR) $(DESTDIR)$(distrobindir)
150 151 @$(INSTALL_DIR) $(DESTDIR)$(mambaimagesdir)
  152 + @$(INSTALL_DIR) $(DESTDIR)$(systemdsleepdir)
151 153 cp -r etc/polkit-1 $(DESTDIR)$(sysconfdir)/
152 154 cp -r etc/prelink.conf.d $(DESTDIR)$(sysconfdir)/
153 155 cp -r etc/profile.d $(DESTDIR)$(sysconfdir)/
154 156 cp -r etc/sudoers.d $(DESTDIR)$(sysconfdir)/
155 157 cp -r etc/sysconfig $(DESTDIR)$(sysconfdir)/
156 158 cp -r etc/xprofile.d $(DESTDIR)$(sysconfdir)/
  159 + cp etc/system-sleep/* $(DESTDIR)$(systemdsleepdir)/
157 160 chmod 755 $(DESTDIR)$(sysconfdir)/profile.d/*.sh
158 161 chmod 755 $(DESTDIR)$(sysconfdir)/xprofile.d/*.sh
159 162 $(INSTALL_SCRIPT) kde/scripts/showlog $(DESTDIR)$(distrobindir)
etc/system-sleep/r8169
  1 +#!/bin/bash
  2 +TMPFILE=/tmp/system-sleep-hook-r8169.tmp
  3 +if [ "$1/$2" = "pre/suspend" ]; then
  4 + rmmod r8169
  5 + touch $TMPFILE
  6 +elif [ "$1/$2" = "post/suspend" -a -e $TMPFILE ]; then
  7 + modprobe r8169
  8 + rm -f $TMPFILE
  9 +fi