summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorazazello <gentoo@horizon.ath.cx>2007-11-09 17:18:02 +0000
committerazazello <gentoo@horizon.ath.cx>2007-11-09 17:18:02 +0000
commita1872131e91e25064f252dbd147613ea045e1a57 (patch)
treec833a45e3f922aca1d6ed78aeb20d887477d0e00 /sys-power
parentnet-analyzer/daemonlogger: Added init scripts and modified the ebuild accordi... (diff)
downloadsunrise-a1872131e91e25064f252dbd147613ea045e1a57.tar.gz
sunrise-a1872131e91e25064f252dbd147613ea045e1a57.tar.bz2
sunrise-a1872131e91e25064f252dbd147613ea045e1a57.zip
sys-power/acpi-support: version bump
svn path=/sunrise/; revision=5035
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/acpi-support/ChangeLog4
-rw-r--r--sys-power/acpi-support/Manifest5
-rw-r--r--sys-power/acpi-support/acpi-support-0.103.ebuild85
-rw-r--r--sys-power/acpi-support/files/acpi-support-0.103-gentoo.patch461
4 files changed, 554 insertions, 1 deletions
diff --git a/sys-power/acpi-support/ChangeLog b/sys-power/acpi-support/ChangeLog
index 63fc00247..f741ca2fd 100644
--- a/sys-power/acpi-support/ChangeLog
+++ b/sys-power/acpi-support/ChangeLog
@@ -2,6 +2,10 @@
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 09 Nov 2007; azazello <gentoo@horizon.ath.cx> +acpi-support-0.103.ebuild,
+ +files/acpi-support-0.103-gentoo.patch:
+ version bump
+
15 Apr 2007; Jakub Moc <jakub@gentoo.org> -acpi-support-0.91.ebuild,
-files/acpi-support-0.91-gentoo.patch, acpi-support-0.95.ebuild:
Remove old, remove bogus use flags and move relevant info to pkg_postinst.
diff --git a/sys-power/acpi-support/Manifest b/sys-power/acpi-support/Manifest
index f7e0b72e0..962a3783a 100644
--- a/sys-power/acpi-support/Manifest
+++ b/sys-power/acpi-support/Manifest
@@ -1,5 +1,8 @@
+AUX acpi-support-0.103-gentoo.patch 16714 RMD160 684233251d7cd3814adc52d6fc8c70094e5e5a8d SHA1 d620d962bada1d6c0d31c660e796b8661c63f76f SHA256 6182cea5ad0f6e844a0ad198a5b9ab17d534af00c8444426a0ce6be6904c9b05
AUX acpi-support-0.95-gentoo.patch 10738 RMD160 704f66b855fc4bebae197b8817ff50bc0260b5e5 SHA1 1b2349a363fa68fc738d016efef204d9e579b2a8 SHA256 c95ca160931bbfa0837884d2b9034bebc66bed016d54e2182cf4883bab053b5f
+DIST acpi-support_0.103.tar.gz 40874 RMD160 36a2fb06bfff21a8523d1df9ce917a2603f7c155 SHA1 058dabab97258cca69f8a48a31c5805d0da3ec5b SHA256 c456b9275077a3a0667a683163ba6574c8d7661d2a9a68a19dab8ef0fc0f2bfe
DIST acpi-support_0.95.tar.gz 43813 RMD160 ae8cbddb8f6a18d033d528c2f7a169c9b23f5e89 SHA1 5aac3d6f33b9c24cfc3a2ae90b20d6f7b14b5ff0 SHA256 c717b06b32cb427d2f927711f0cf7066ad117475f29c1fea5394bbadd2e8a4a9
+EBUILD acpi-support-0.103.ebuild 2375 RMD160 d9a68f1d7c228e56925f67643d3251255b9d47a3 SHA1 7161dc25a7096a38902f71a3af9566adbf14bbb7 SHA256 a6f6c29d35dfc3e1eed00f2a9c6c1c59bbcacbbe6c3633b4458e0c5c1abc6006
EBUILD acpi-support-0.95.ebuild 2374 RMD160 9b76753c62ed3fb27ec843b994bd0b5b23cc0364 SHA1 392da43e993306f78efd70ef08364fc3d1b03526 SHA256 59a1847b828f510c14ed25228e9267a7c7f4eb7105104f194337ff82954931a3
-MISC ChangeLog 1544 RMD160 dbce102216e61beac2e4fda4c768e15500223103 SHA1 adb098477c758bd570a328d929172c7b659f4eac SHA256 b3a65d5f3d34a48d26366346fd308bd89f2db34d2121c46f0277a2e92578cbe8
+MISC ChangeLog 1678 RMD160 36c0504e2b3ea185e1f9b4f6650eb0ccfa742405 SHA1 fd11e2586b2216b36bb398881c4c9f7ba5c462ee SHA256 fe33cac2c04ac3b6a45479ff4527aea06deba0fbdfc082b01e9742462b2c29a5
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
diff --git a/sys-power/acpi-support/acpi-support-0.103.ebuild b/sys-power/acpi-support/acpi-support-0.103.ebuild
new file mode 100644
index 000000000..8a163e6c1
--- /dev/null
+++ b/sys-power/acpi-support/acpi-support-0.103.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils
+
+DESCRIPTION="Ubuntu scripts and events for acpid, power management, and vendor-specific laptop configuration"
+HOMEPAGE="http://packages.ubuntu.com/feisty/admin/acpi-support"
+SRC_URI="http://archive.ubuntu.com/ubuntu/pool/main/a/acpi-support/acpi-support_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE="X hibernate-script video_cards_radeon"
+
+DEPEND=""
+RDEPEND="sys-power/acpid
+ sys-apps/kbd
+ sys-apps/dmidecode
+ sys-apps/vbetool
+ sys-apps/ethtool
+ sys-power/powermgmt-base
+ hibernate-script? ( sys-power/hibernate-script )
+ X? ( x11-apps/xset )
+ video_cards_radeon? ( app-laptop/radeontool )"
+
+# Say thanks to whoever packaged this...
+S=${WORKDIR}/${PN}-0.102
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}/${P}-gentoo.patch"
+ use hibernate-script && sed -i '/USE_HIBERNATE_SCRIPT=true/ s/# //' "${S}/acpi-support"
+ use video_cards_radeon && sed -i '/RADEON_LIGHT=true/ s/# //' "${S}/acpi-support"
+ use X || sed -i '/xset/ s/\(.*\)/#\1/' "${S}/"{lid.sh,lib/screenblank}
+ sed -i "s!/etc/default/acpi-support!/etc/conf.d/${PN}!" "${S}/"{*.sh,vbesave} || die "sed failed"
+}
+
+src_compile() {
+ sed -i 's/strip acpi_fakekey//' Makefile
+ emake || die "emake failed"
+}
+
+src_install() {
+ dobin acpi_fakekey
+
+ insinto /usr/share/${PN}
+ doins key-constants lib/*
+
+ insinto /etc/acpi
+ insopts -m755
+ doins *.sh
+ doins -r *.d events
+
+ doconfd ${PN}
+ newinitd debian/init.d ${PN}
+
+ keepdir /etc/acpi/{local,{resume,battery,events,suspend,start,ac}.d} /var/lib/${PN}
+ dodoc README
+}
+
+pkg_postinst() {
+ elog "You may wish to read the Gentoo Linux Power Management Guide,"
+ elog "which can be found online at:"
+ elog
+ elog "http://www.gentoo.org/doc/en/power-management-guide.xml"
+ elog
+ elog "The following packages provide additional functionality:"
+ elog
+ elog "app-laptop/laptop-mode-tools"
+ elog "app-laptop/toshset"
+ elog "sys-power/kpowersave"
+ elog "sys-power/powersave"
+ elog "sys-apps/855resolution"
+ elog "sys-apps/pcmciautils"
+ elog
+ elog "To initialize power management options for your devices at"
+ elog "system startup, please run the following:"
+ elog
+ elog "rc-update add ${PN} default"
+ elog
+ elog "This package will not work until you restart acpid. Please run the following:"
+ elog
+ elog "/etc/init.d/acpid restart"
+}
diff --git a/sys-power/acpi-support/files/acpi-support-0.103-gentoo.patch b/sys-power/acpi-support/files/acpi-support-0.103-gentoo.patch
new file mode 100644
index 000000000..64db7a506
--- /dev/null
+++ b/sys-power/acpi-support/files/acpi-support-0.103-gentoo.patch
@@ -0,0 +1,461 @@
+diff -urN orig/acpi-support-0.102/acpi-support work/acpi-support-0.102/acpi-support
+--- orig/acpi-support-0.102/acpi-support 2007-08-30 23:35:02.000000000 -0400
++++ work/acpi-support-0.102/acpi-support 2007-11-09 10:48:42.000000000 -0500
+@@ -69,4 +69,12 @@
+ ENABLE_LAPTOP_MODE=false
+
+ # Spindown time on battery
+-SPINDOWN_TIME=12
+\ No newline at end of file
++SPINDOWN_TIME=12
++
++# Disable wake-on-LAN for wired Ethernet devices. WOL is on by default on some
++# laptops. Disabling it can save power during sleep.
++# DISABLE_WOL=true
++
++# Use hibernate-script to handle hibernation and sleep. Hibernate-script uses
++# configuration files in /etc/hibernate and does not use the options above.
++# USE_HIBERNATE_SCRIPT=true
+diff -urN orig/acpi-support-0.102/debian/init.d work/acpi-support-0.102/debian/init.d
+--- orig/acpi-support-0.102/debian/init.d 2007-08-30 22:48:20.000000000 -0400
++++ work/acpi-support-0.102/debian/init.d 2007-11-09 12:11:54.000000000 -0500
+@@ -1,35 +1,34 @@
+-#!/bin/bash
++#!/sbin/runscript
+ # INIT script to check whether we're on batteries, and so start with laptop
+ # mode etc enabled.
+
+ # BUGS: unless we start *really* late, we have no way of throttling
+ # xscreensaver, since it won't be there to command.
+-. /usr/share/acpi-support/power-funcs
+-
+-test -f /lib/lsb/init-functions || exit 1
+-. /lib/lsb/init-functions
+-
+-test -d /var/lib/acpi-support || exit 0
+-
+-shopt -s nullglob
+-
+-case "$1" in
+- start)
+- log_begin_msg "Checking battery state..."
+- /etc/acpi/power.sh
+- # Source everything in /etc/acpi/start.d/
+- for SCRIPT in /etc/acpi/start.d/*.sh; do
+- . $SCRIPT
+- done
+- log_end_msg 0
+- ;;
+- stop)
+- log_begin_msg "Disabling power management..."
+- /etc/acpi/power.sh stop
+- log_end_msg 0
+- ;;
+- *)
+- ;;
+-esac
+-
+
++depend() {
++ need acpid
++}
++
++start() {
++ ebegin "Starting acpi-support"
++ . /usr/share/acpi-support/power-funcs
++
++ test -d /var/lib/acpi-support || eend 0
++
++ shopt -s nullglob
++
++ ebegin "Checking battery state..."
++ /etc/acpi/power.sh
++
++ # Source everything in /etc/acpi/start.d/
++ for SCRIPT in /etc/acpi/start.d/*.sh; do
++ . $SCRIPT
++ done
++ eend 0
++}
++
++stop() {
++ ebegin "Disabling power management..."
++ /etc/acpi/power.sh stop
++ eend 0
++}
+diff -urN orig/acpi-support-0.102/debian/init.d.orig work/acpi-support-0.102/debian/init.d.orig
+--- orig/acpi-support-0.102/debian/init.d.orig 1969-12-31 19:00:00.000000000 -0500
++++ work/acpi-support-0.102/debian/init.d.orig 2007-11-09 10:24:44.000000000 -0500
+@@ -0,0 +1,35 @@
++#!/bin/bash
++# INIT script to check whether we're on batteries, and so start with laptop
++# mode etc enabled.
++
++# BUGS: unless we start *really* late, we have no way of throttling
++# xscreensaver, since it won't be there to command.
++. /usr/share/acpi-support/power-funcs
++
++test -f /lib/lsb/init-functions || exit 1
++. /lib/lsb/init-functions
++
++test -d /var/lib/acpi-support || exit 0
++
++shopt -s nullglob
++
++case "$1" in
++ start)
++ log_begin_msg "Checking battery state..."
++ /etc/acpi/power.sh
++ # Source everything in /etc/acpi/start.d/
++ for SCRIPT in /etc/acpi/start.d/*.sh; do
++ . $SCRIPT
++ done
++ log_end_msg 0
++ ;;
++ stop)
++ log_begin_msg "Disabling power management..."
++ /etc/acpi/power.sh stop
++ log_end_msg 0
++ ;;
++ *)
++ ;;
++esac
++
++
+diff -urN orig/acpi-support-0.102/events/ibm-ultrabay-eject work/acpi-support-0.102/events/ibm-ultrabay-eject
+--- orig/acpi-support-0.102/events/ibm-ultrabay-eject 1969-12-31 19:00:00.000000000 -0500
++++ work/acpi-support-0.102/events/ibm-ultrabay-eject 2007-11-09 10:47:47.000000000 -0500
+@@ -0,0 +1,5 @@
++# /etc/acpi/events/ibm-ultrabay-eject
++# This is called when the user ejects the ultrabay lever
++
++event=ibm/bay MSTR 00000003 00000000
++action=/etc/acpi/thinkpad-ultrabay-eject.sh
+diff -urN orig/acpi-support-0.102/events/ibm-ultrabay-insert work/acpi-support-0.102/events/ibm-ultrabay-insert
+--- orig/acpi-support-0.102/events/ibm-ultrabay-insert 1969-12-31 19:00:00.000000000 -0500
++++ work/acpi-support-0.102/events/ibm-ultrabay-insert 2007-11-09 10:47:47.000000000 -0500
+@@ -0,0 +1,5 @@
++# /etc/acpi/events/ibm-ultrabay-insert
++# This is called when the user inserts the ultrabay lever
++
++event=ibm/bay MSTR 00000001 00000000
++action=/etc/acpi/thinkpad-ultrabay-insert.sh
+diff -urN orig/acpi-support-0.102/hibernatebtn.sh work/acpi-support-0.102/hibernatebtn.sh
+--- orig/acpi-support-0.102/hibernatebtn.sh 2006-02-06 09:54:47.000000000 -0500
++++ work/acpi-support-0.102/hibernatebtn.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -1,3 +1,3 @@
+ #!/bin/bash
+-. /usr/share/acpi-support/key-constants
+-acpi_fakekey $KEY_SUSPEND
++
++. /etc/acpi/hibernate.sh
+diff -urN orig/acpi-support-0.102/hibernate.sh work/acpi-support-0.102/hibernate.sh
+--- orig/acpi-support-0.102/hibernate.sh 2006-09-15 16:43:46.000000000 -0400
++++ work/acpi-support-0.102/hibernate.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -8,6 +8,11 @@
+ exit;
+ fi
+
++if [[ $USE_HIBERNATE_SCRIPT == true ]] && [[ -x /usr/sbin/hibernate ]] ; then
++ /usr/sbin/hibernate
++ exit
++fi
++
+ # Unset video posting - it's not needed for suspend to disk
+ unset POST_VIDEO
+ unset USE_DPMS
+diff -urN orig/acpi-support-0.102/lib/policy-funcs work/acpi-support-0.102/lib/policy-funcs
+--- orig/acpi-support-0.102/lib/policy-funcs 2006-05-19 16:21:58.000000000 -0400
++++ work/acpi-support-0.102/lib/policy-funcs 2007-11-09 10:47:47.000000000 -0500
+@@ -1,6 +1,6 @@
+ CheckPolicy() {
+ if pidof gnome-power-manager kpowersave > /dev/null ||
+- (pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop kded kded loadedModules | grep -q klaptopdaemon) ; then
++ (pidof dcopserver > /dev/null && test -x /usr/kde/3.5/bin/dcop && /usr/kde/3.5/bin/dcop kded kded loadedModules | grep -q klaptopdaemon) ; then
+ echo 0;
+ else
+ echo 1;
+diff -urN orig/acpi-support-0.102/lib/power-funcs work/acpi-support-0.102/lib/power-funcs
+--- orig/acpi-support-0.102/lib/power-funcs 2007-08-30 22:07:02.000000000 -0400
++++ work/acpi-support-0.102/lib/power-funcs 2007-11-09 10:47:47.000000000 -0500
+@@ -6,9 +6,9 @@
+ POWERSTATE="/var/lib/acpi-support/powerstate"
+
+ getXuser() {
+- user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
++ user=`who| grep -m1 ":$displaynum " | awk '{print $1}'`
+ if [ x"$user" = x"" ]; then
+- user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
++ user=`who| grep -m1 ":$displaynum" | awk '{print $1}'`
+ fi
+ if [ x"$user" != x"" ]; then
+ userhome=`getent passwd $user | cut -d: -f6`
+diff -urN orig/acpi-support-0.102/Makefile work/acpi-support-0.102/Makefile
+--- orig/acpi-support-0.102/Makefile 2006-03-21 12:03:00.000000000 -0500
++++ work/acpi-support-0.102/Makefile 2007-11-09 10:47:47.000000000 -0500
+@@ -2,7 +2,6 @@
+
+ acpi_fakekey: acpi_fakekey.c
+ gcc -g -Wall -o acpi_fakekey acpi_fakekey.c
+- strip acpi_fakekey
+
+ # Keep this manually generated so that it doesn't build-dep on
+ # 'linux-headers' and stays predictable.
+diff -urN orig/acpi-support-0.102/resume.d/13-855-resolution-set.sh work/acpi-support-0.102/resume.d/13-855-resolution-set.sh
+--- orig/acpi-support-0.102/resume.d/13-855-resolution-set.sh 2005-09-26 20:29:27.000000000 -0400
++++ work/acpi-support-0.102/resume.d/13-855-resolution-set.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -1,7 +1,6 @@
+ #!/bin/bash
+
+ if [ -x /usr/sbin/855resolution ]; then
+- . /etc/default/855resolution
+ if [ "$MODE" != "" ] && [ "$XRESO" != "" ] && [ "$YRESO" != "" ]; then
+ /etc/init.d/855resolution start;
+ fi
+diff -urN orig/acpi-support-0.102/resume.d/40-infra-red.sh work/acpi-support-0.102/resume.d/40-infra-red.sh
+--- orig/acpi-support-0.102/resume.d/40-infra-red.sh 2006-04-21 10:12:54.000000000 -0400
++++ work/acpi-support-0.102/resume.d/40-infra-red.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -3,7 +3,6 @@
+ # Restart IR if necessary
+ if [ -f /var/run/irdadev ] && [ x$RESTART_IRDA = xtrue ]; then
+ rm /var/run/irdadev;
+- /etc/init.d/irda-setup start;
+- /etc/init.d/irda-utils start;
++ /etc/init.d/irda start;
+ fi;
+
+diff -urN orig/acpi-support-0.102/resume.d/49-855-resolution-set.sh work/acpi-support-0.102/resume.d/49-855-resolution-set.sh
+--- orig/acpi-support-0.102/resume.d/49-855-resolution-set.sh 2005-09-26 20:29:27.000000000 -0400
++++ work/acpi-support-0.102/resume.d/49-855-resolution-set.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -1,7 +1,6 @@
+ #!/bin/bash
+
+ if [ -x /usr/sbin/855resolution ]; then
+- . /etc/default/855resolution
+ if [ "$MODE" != "" ] && [ "$XRESO" != "" ] && [ "$YRESO" != "" ]; then
+ /etc/init.d/855resolution start;
+ fi
+diff -urN orig/acpi-support-0.102/resume.d/62-ifup.sh work/acpi-support-0.102/resume.d/62-ifup.sh
+--- orig/acpi-support-0.102/resume.d/62-ifup.sh 2006-04-21 10:13:34.000000000 -0400
++++ work/acpi-support-0.102/resume.d/62-ifup.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -3,6 +3,6 @@
+ # Bring up the interfaces (this should probably be left up to some policy
+ # manager, but at the moment we just bring back whatever we ifdowned)
+ for x in $INTERFACES; do
+- ifup $x &
++ /etc/init.d/net.$x start &
+ done
+
+diff -urN orig/acpi-support-0.102/resume.d/67-sound.sh work/acpi-support-0.102/resume.d/67-sound.sh
+--- orig/acpi-support-0.102/resume.d/67-sound.sh 2006-04-21 10:19:38.000000000 -0400
++++ work/acpi-support-0.102/resume.d/67-sound.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+
+ # Get sound back
+-if [ -x /etc/init.d/alsa-utils ]; then
+- /etc/init.d/alsa-utils start
++if [ -x /etc/init.d/alsasound ]; then
++ /etc/init.d/alsasound start
+ fi
+
+diff -urN orig/acpi-support-0.102/sleepbtn.sh work/acpi-support-0.102/sleepbtn.sh
+--- orig/acpi-support-0.102/sleepbtn.sh 2006-02-06 09:55:00.000000000 -0500
++++ work/acpi-support-0.102/sleepbtn.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -1,3 +1,3 @@
+ #!/bin/bash
+-. /usr/share/acpi-support/key-constants
+-acpi_fakekey $KEY_SLEEP
++
++. /etc/acpi/sleep.sh
+diff -urN orig/acpi-support-0.102/sleep.sh work/acpi-support-0.102/sleep.sh
+--- orig/acpi-support-0.102/sleep.sh 2006-05-19 15:37:32.000000000 -0400
++++ work/acpi-support-0.102/sleep.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -16,6 +16,11 @@
+ exit;
+ fi
+
++if [[ $USE_HIBERNATE_SCRIPT == true ]] && [[ -x /usr/sbin/hibernate ]] ; then
++ /usr/sbin/hibernate --config-file=/etc/hibernate/ram.conf
++ exit;
++fi
++
+ if [ x$LOCK_SCREEN = xtrue ]; then
+ if pidof xscreensaver > /dev/null; then
+ for x in /tmp/.X11-unix/*; do
+diff -urN orig/acpi-support-0.102/suspend.d/50-irda-stop.sh work/acpi-support-0.102/suspend.d/50-irda-stop.sh
+--- orig/acpi-support-0.102/suspend.d/50-irda-stop.sh 2006-04-21 11:05:47.000000000 -0400
++++ work/acpi-support-0.102/suspend.d/50-irda-stop.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -2,7 +2,7 @@
+
+ # Stop IRDA if it's running
+ if [ -f /var/run/irattach.pid ]; then
+- /etc/init.d/irda-utils stop
++ /etc/init.d/irda stop
+ killall -9 irattach
+ fi
+
+diff -urN orig/acpi-support-0.102/suspend.d/52-disable-wol.sh work/acpi-support-0.102/suspend.d/52-disable-wol.sh
+--- orig/acpi-support-0.102/suspend.d/52-disable-wol.sh 1969-12-31 19:00:00.000000000 -0500
++++ work/acpi-support-0.102/suspend.d/52-disable-wol.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -0,0 +1,13 @@
++#!/bin/sh
++
++# Find the currently running network interfaces
++
++if [[ $DISABLE_WOL == "true" ]] ; then
++ ETHTOOL=`type -p ethtool`
++ INTERFACES=`/sbin/ifconfig | awk '/^[^ ]+/ {print $1}'`
++
++ for i in $INTERFACES; do
++ # TODO: find out if it's a wired ethernet card (and/or supports WOL)
++ [[ $i =~ "eth" && -n $ETHTOOL && -x $ETHTOOL ]] && $ETHTOOL -s $i wol d > /dev/null 2>&1
++ done
++fi
+diff -urN orig/acpi-support-0.102/suspend.d/55-down-interfaces.sh work/acpi-support-0.102/suspend.d/55-down-interfaces.sh
+--- orig/acpi-support-0.102/suspend.d/55-down-interfaces.sh 2006-05-16 07:57:43.000000000 -0400
++++ work/acpi-support-0.102/suspend.d/55-down-interfaces.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -10,7 +10,7 @@
+
+ # And shut them down
+ for x in $INTERFACES; do
+- ifdown $x;
++ /etc/init.d/net.$x stop;
+ ifconfig $x down;
+ done
+
+diff -urN orig/acpi-support-0.102/suspend.d/85-alsa-state.sh work/acpi-support-0.102/suspend.d/85-alsa-state.sh
+--- orig/acpi-support-0.102/suspend.d/85-alsa-state.sh 2006-04-21 11:00:08.000000000 -0400
++++ work/acpi-support-0.102/suspend.d/85-alsa-state.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+
+ # Save the ALSA state
+-if [ -x /etc/init.d/alsa-utils ]; then
+- /etc/init.d/alsa-utils stop
++if [ -x /etc/init.d/alsasound ]; then
++ /etc/init.d/alsasound stop
+ fi
+
+diff -urN orig/acpi-support-0.102/thinkpad-ultrabay-eject.sh work/acpi-support-0.102/thinkpad-ultrabay-eject.sh
+--- orig/acpi-support-0.102/thinkpad-ultrabay-eject.sh 1969-12-31 19:00:00.000000000 -0500
++++ work/acpi-support-0.102/thinkpad-ultrabay-eject.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -0,0 +1,66 @@
++s#!/bin/sh
++# Handle Thinkpad Ultrabay hotswap
++
++# TODO: /sys/devices/platform/bay* may also work
++# TODO: must check that libata is used for the bay!
++if ! ( egrep -sq 'status:.+occupied' /proc/acpi/ibm/bay && egrep -sq 'commands:.+eject' /proc/acpi/ibm/bay ) ; then
++ exit 1;
++fi
++
++ULTRABAY_SYSDIR='/sys/class/scsi_device/1:0:0:0/device'
++shopt -s nullglob
++
++# Umount the filesystem(s) backed by the given major:minor device(s)
++unmount_rdev() { perl - "$@" <<'EOPERL' # let's do it in Perl
++ for $major_minor (@ARGV) {
++ $major_minor =~ m/^(\d+):(\d+)$/ or die;
++ push(@tgt_rdevs, ($1<<8)|$2);
++ }
++ # Sort by reverse length of mount point, to unmount sub-directories first
++ open MOUNTS,"</proc/mounts" or die "$!";
++ @mounts=sort { length($b->[1]) <=> length($a->[1]) } map { [ split ] } <MOUNTS>;
++ close MOUNTS;
++ foreach $m (@mounts) {
++ ($dev,$dir)=@$m;
++ next unless -b $dev; $rdev=(stat($dev))[6];
++ next unless grep($_==$rdev, @tgt_rdevs);
++ system("umount","-v","$dir")==0 or $bad=1;
++ }
++ exit 1 if $bad;
++EOPERL
++}
++
++# Get the UltraBay's /dev/foo block device node
++ultrabay_dev_node() {
++ UDEV_PATH="`readlink -e "$ULTRABAY_SYSDIR/block:"*`" || return 1
++ UDEV_NAME="`udevinfo -q name -p $UDEV_PATH`" || return 1
++ echo /dev/$UDEV_NAME
++}
++
++if [ -d $ULTRABAY_SYSDIR ]; then
++ /bin/sync
++ # Unmount filesystems backed by this device
++ unmount_rdev `cat $ULTRABAY_SYSDIR/block\:*/dev \
++ $ULTRABAY_SYSDIR/block\:*/*/dev` \
++ || {
++ echo 10 > /proc/acpi/ibm/beep; # error tone
++ exit 1;
++ }
++ sync
++ # Nicely power off the device
++ DEVNODE=`ultrabay_dev_node` && /sbin/hdparm -Y $DEVNODE
++ # Let HAL+KDE notice the unmount and let the disk spin down
++ sleep 0.5
++ # Unregister this SCSI device:
++ sync
++ echo 1 > $ULTRABAY_SYSDIR/delete
++fi
++sync
++# Turn off power to the UltraBay:
++if [ -d /sys/devices/platform/bay.0 ]; then
++ echo 1 > /sys/devices/platform/bay.0/eject
++else
++ echo eject > /proc/acpi/ibm/bay
++fi
++# Tell the user we're OK
++echo 12 > /proc/acpi/ibm/beep
+diff -urN orig/acpi-support-0.102/thinkpad-ultrabay-insert.sh work/acpi-support-0.102/thinkpad-ultrabay-insert.sh
+--- orig/acpi-support-0.102/thinkpad-ultrabay-insert.sh 1969-12-31 19:00:00.000000000 -0500
++++ work/acpi-support-0.102/thinkpad-ultrabay-insert.sh 2007-11-09 10:47:47.000000000 -0500
+@@ -0,0 +1,15 @@
++#!/bin/sh
++# Handle Thinkpad Ultrabay hotswap
++
++# TODO: /sys/devices/platform/bay* may also work
++# TODO: must check that libata is used for the bay!
++if ! ( egrep -sq 'status:.+unoccupied' /proc/acpi/ibm/bay ) ; then
++ exit 1;
++fi
++
++/bin/sync
++
++echo 0 0 0 > /sys/class/scsi_host/host1/scan
++
++# The beep is necessary as confirmation of success. Instead of the beep, need to configure a messaging system, e.g. using kdialog or gnome equivalent or xosd
++echo 12 > /proc/acpi/ibm/beep
+diff -urN orig/acpi-support-0.102/vbesave work/acpi-support-0.102/vbesave
+--- orig/acpi-support-0.102/vbesave 2006-05-03 16:31:51.000000000 -0400
++++ work/acpi-support-0.102/vbesave 2007-11-09 10:47:47.000000000 -0500
+@@ -3,8 +3,6 @@
+ test -x /usr/sbin/vbetool || exit 0
+ set -e
+
+-. /lib/lsb/init-functions
+-
+ test -f /etc/default/rcS && . /etc/default/rcS
+ test -f /etc/default/acpi-support && . /etc/default/acpi-support
+ test -f /usr/share/acpi-support/device-funcs && . /usr/share/acpi-support/device-funcs
+@@ -20,20 +18,16 @@
+ fi
+
+ DeviceConfig
+- log_begin_msg "Saving VESA state..."
+ if [ "$SAVE_VBE_STATE" = "true" ]; then
+ if [ "$VERBOSE" = no ]; then
+ if ! vbetool vbestate save > $VBESTATE 2>/dev/null; then
+- log_end_msg $?
+ exit 1
+ fi
+ else
+ if ! vbetool vbestate save > $VBESTATE ; then
+- log_end_msg $?
+ exit 1
+ fi
+ fi
+- log_end_msg 0
+ fi
+ ;;
+ *)