#!/bin/sh # # swsusp suspend helper script # for Asus L3800C and maybe other notebooks # by Nils Faerber # # Comments and suggestions welcome! # # It assumes that XFree is running on VT7 and that VT12 is more # or less unallocated for debugging output. # It will remove safe-to-remove drivers before suspend and re-insert them # afterwards (USB, Firewire, Ethernet, etc.) as well as ejecting a built-in # WLAN card (mini-PCI). # # Prepare for suspend chvt 12 ifdown eth0 > /dev/tty12 2>&1 ifdown eth1 > /dev/tty12 2>&1 cardctl eject 2 > /dev/tty12 2>&1 rmmod 8139too > /dev/tty12 2>&1 #rmmod usb-uhci > /dev/tty12 2>&1 #rmmod usbmouse > /dev/tty12 2>&1 #rmmod usbnet > /dev/tty12 2>&1 #rmmod usb-storage > /dev/tty12 2>&1 /etc/hotplug/usb.rc stop rmmod ohci1394 > /dev/tty12 2>&1 # Do it rmmod -a sync rmmod -a sync echo "waiting a second..." > /dev/tty12 2>&1 sleep 1 #echo "1 0 2" > /proc/sys/kernel/swsusp #echo "4" > /proc/acpi/sleep echo > /proc/swsusp/activate # Come back sync echo "waiting a second..." > /dev/tty12 2>&1 sleep 1 #modprobe usb-uhci > /dev/tty12 2>&1 /etc/hotplug/usb.rc start modprobe 8139too > /dev/tty12 2>&1 hwclock --hctosys ifup eth0 > /dev/tty12 2>&1 cardctl insert 2 > /dev/tty12 2>&1 chvt 7 > /dev/tty12 2>&1 modprobe ohci1394 > /dev/tty12 2>&1