update upower with deps

This commit is contained in:
Phil 2011-07-12 19:59:28 +00:00
parent d6114a6285
commit 52d0d0ce7e
10 changed files with 181 additions and 158 deletions

View File

@ -1,8 +1,11 @@
# $Id: PKGBUILD 77636 2010-04-16 19:35:15Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=pm-quirks
_date=20100316
_date=20100619
pkgver=0.${_date}
pkgrel=1
pkgdesc="Quirks data for pm-utils"
@ -10,10 +13,10 @@ arch=(any)
license=('GPL')
url="http://pm-utils.freedesktop.org/wiki/"
source=(http://pm-utils.freedesktop.org/releases/${pkgname}-${_date}.tar.gz)
md5sums=('9e960d066959b88727e9259a0f04161f')
md5sums=('3b6ee39056b9ece0cd5e073a4c272b05')
build() {
cd "${srcdir}"
cd "${srcdir}/video-quirks"
install -m755 -d "${pkgdir}/usr/lib/pm-utils/video-quirks"
install -m644 *.quirkdb "${pkgdir}/usr/lib/pm-utils/video-quirks/" || return 1
}
}

View File

@ -0,0 +1,19 @@
Author: James Westby <james.westby@ubuntu.com>
Description: Do not clear the log file on each operation, but instead append to it.
This makes debugging of several suspends much easier.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=25255
Bug-Ubuntu: https://launchpad.net/bugs/410352
Index: pm-utils/pm/pm-functions.in
===================================================================
--- pm-utils.orig/pm/pm-functions.in 2010-07-05 18:41:21.118322244 +0200
+++ pm-utils/pm/pm-functions.in 2010-07-05 18:41:24.126325221 +0200
@@ -271,7 +271,7 @@
return 1
fi
export LOGGING=true
- exec > "$1" 2>&1
+ exec >> "$1" 2>&1
}
check_suspend() { [ -n "$SUSPEND_MODULE" ]; }

View File

@ -0,0 +1,40 @@
From: Florian Kriener <florian@kriener.org>
To: submit@bugs.debian.org
Subject: [pm-utils] wrong path in intel-audio-powersave (and a small bug)
Date: Sat, 25 Sep 2010 11:27:30 +0200
In the script intel-audio-powersave is this loop
for dev in /sys/module/snd_*/parameters/power_save; do
[ -w "$dev/parameters/power_save" ] || continue
printf "Setting power savings for $s to %d..." "$dev##*/" "$1"
echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed.
done
I think it should be
for dev in /sys/module/snd_*; do
[ -w "$dev/parameters/power_save" ] || continue
printf "Setting power savings for %s to %d..." "${dev##*/}" "$1"
echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed.
done
This fixes the two bugs.
diff --git a/pm/power.d/intel-audio-powersave b/pm/power.d/intel-audio-powersave
index 36675a8..da63e40 100644
--- a/pm/power.d/intel-audio-powersave
+++ b/pm/power.d/intel-audio-powersave
@@ -20,9 +20,9 @@ EOF
audio_powersave() {
[ "$INTEL_AUDIO_POWERSAVE" = "true" ] || exit $NA
- for dev in /sys/module/snd_*/parameters/power_save; do
+ for dev in /sys/module/snd_*; do
[ -w "$dev/parameters/power_save" ] || continue
- printf "Setting power savings for $s to %d..." "$dev##*/" "$1"
+ printf "Setting power savings for %s to %d..." "${dev##*/}" "$1"
echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed.
done
}

View File

@ -0,0 +1,43 @@
From 640b53438c20818b3e344343b58b1f1765606a85 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Mon, 31 Jan 2011 15:30:01 +0100
Subject: [PATCH] 49bluetooth: Wait for btusb module to get unused
The 49bluetooth hook disables /proc/acpi/ibm/bluetooth but this isn't
synchronous, i. e. it doesn't wait until the module usage count actually drops
to 0. Due to that, it's impossible to add btusb to SUSPEND_MODULES (on some
models/older kernels you need to do that to fix suspend problems), as at that
point the module is still in use.
On my system (ThinkPad X201) the module takes between 0.3 and 0.5 seconds to
unload, so use 100 ms wait steps with a timeout of 2 seconds.
Bug: https://bugs.freedesktop.org//show_bug.cgi?id=33759
Bug-Ubuntu: https://launchpad.net/bugs/698331
---
pm/sleep.d/49bluetooth | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/pm/sleep.d/49bluetooth b/pm/sleep.d/49bluetooth
index d46ba49..0dc1909 100755
--- a/pm/sleep.d/49bluetooth
+++ b/pm/sleep.d/49bluetooth
@@ -12,6 +12,15 @@ suspend_bluetooth()
if grep -q enabled /proc/acpi/ibm/bluetooth; then
savestate ibm_bluetooth enable
echo disable > /proc/acpi/ibm/bluetooth
+
+ # wait for up to 2 seconds for the module to actually get
+ # unused
+ TIMEOUT=20
+ while [ $TIMEOUT -ge 0 ]; do
+ [ `cat /sys/module/btusb/refcnt` = 0 ] && break
+ TIMEOUT=$((TIMEOUT-1))
+ sleep 0.1
+ done
else
savestate ibm_bluetooth disable
fi
--
1.7.2.3

View File

@ -0,0 +1,26 @@
Description: Disable SATA link power management by default, as it still causes disk errors and corruptions on many hardware.
Author: Martin Pitt <martin.pitt@ubuntu.com>
Bug-Ubuntu: https://launchpad.net/bugs/539467
Index: pm-utils/pm/power.d/sata_alpm
===================================================================
--- pm-utils.orig/pm/power.d/sata_alpm 2011-02-01 15:53:09.164867778 +0100
+++ pm-utils/pm/power.d/sata_alpm 2011-02-01 15:53:28.954867786 +0100
@@ -2,7 +2,7 @@
. "${PM_FUNCTIONS}"
-SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-true}
+SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-false}
help() {
cat <<EOF
@@ -16,7 +16,7 @@
This hook has 1 parameter:
SATA_ALPM_ENABLE = whether to use SATA ALPM on battery.
-Defaults to "true".
+Defaults to "false".
EOF
}

View File

@ -1,42 +1,50 @@
# $Id: PKGBUILD 77643 2010-04-16 19:48:23Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Thayer Williams <thayer@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=pm-utils
pkgver=1.3.0
pkgrel=2
pkgver=1.4.1
pkgrel=1
pkgdesc="Utilities and scripts for suspend and hibernate power management"
arch=('i686' 'x86_64')
url="http://pm-utils.freedesktop.org"
license=('GPL')
depends=('bash' 'procps' 'vbetool' 'pm-quirks')
optdepends=('upower')
depends=('bash' 'procps' 'pm-quirks')
makedepends=('xmlto' 'docbook-xml' 'docbook-xsl')
source=(http://pm-utils.freedesktop.org/releases/${pkgname}-${pkgver}.tar.gz
on_ac_power-upower.patch
11netcfg
daemons.patch)
md5sums=('37d71f8adbb409442212a85a080d324d'
'676855c54039a3b2c3171e69ccee2113'
'9839687c8787d99fd4ff36aa3238c27b'
'7be3f7460569d5a382474abd7f7b53fb')
02-logging-append.patch
12-fix-intel-audio-powersave-hook.patch
13-49bluetooth-sync.patch
14-disable-sata-alpm.patch
11netcfg)
md5sums=('1742a556089c36c3a89eb1b957da5a60'
'a45149617bf3eb8dc32e6d9e22ae715d'
'edada31a7d722763513fbe705d95d19d'
'298f78b873c03c025700d5da619ac134'
'd0040f7d30b6a0dd195b5401abbbbdb9'
'9839687c8787d99fd4ff36aa3238c27b')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
# make sure Arch Linux daemons are properly handled
patch -Np1 -i "${srcdir}/daemons.patch" || return 1
# Support upower for on_ac_power
patch -Np1 -i "${srcdir}/on_ac_power-upower.patch" || return 1
patch -Np1 -i "${srcdir}/02-logging-append.patch"
patch -Np1 -i "${srcdir}/12-fix-intel-audio-powersave-hook.patch"
patch -Np1 -i "${srcdir}/13-49bluetooth-sync.patch"
patch -Np1 -i "${srcdir}/14-disable-sata-alpm.patch"
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var || return 1
make || return 1
make DESTDIR="${pkgdir}" install || return 1
--sysconfdir=/etc \
--localstatedir=/var
make
make DESTDIR="${pkgdir}" install
# install additional hooks
install -m755 "${srcdir}/11netcfg" "${pkgdir}/usr/lib/pm-utils/sleep.d/" || return 1
install -m755 "${srcdir}/11netcfg" "${pkgdir}/usr/lib/pm-utils/sleep.d/"
# nm >=0.8.2 has native udev suspend/resume support
rm -f "${pkgdir}/usr/lib/pm-utils/sleep.d/55NetworkManager"
# Remove hooks that cause hardware failure or don't make sense at all
rm -f "${pkgdir}/usr/lib/pm-utils/power.d/"{harddrive,disable_wol}
}

View File

@ -1,20 +0,0 @@
--- a/pm/functions.in 2009-11-07 21:51:04.000000000 -0800
+++ b/pm/functions.in 2009-12-01 17:30:59.000000000 -0800
@@ -141,7 +141,7 @@
if ! command_exists service; then
service()
{
- for svc in "/etc/init.d/$1" "/etc/rc.d/rc.$1"; do #lsb, then slack
+ for svc in "/etc/init.d/$1" "/etc/rc.d/$1"; do #lsb, then slack
[ -x "$svc" ] && { shift; "$svc" "$@"; return $?; }
done
# this only happens if we did not find the service
@@ -153,7 +153,7 @@
stopservice()
{
- if service "$1" status 2>/dev/null | grep -q -e running -e started
+ if [[ -e "/var/run/daemons/$1" ]] || service "$1" status 2>/dev/null | grep -q -e running -e started
then
touch "${STORAGEDIR}/service:$1"
service "$1" stop

View File

@ -1,11 +0,0 @@
--- a/pm/sleep.d/98smart-kernel-video.old 2010-01-07 08:31:25.275911479 -0800
+++ a/pm/sleep.d/98smart-kernel-video 2010-01-07 08:32:01.596732967 -0800
@@ -32,7 +32,7 @@
{
# if we are running with a KMS-enabled video driver, we should not
# attempt to run any quirks
- grep -q -E '(noveau|drm)fb' /proc/fb || return 1
+ grep -q -E '(nouveau|drm)fb' /proc/fb || return 1
remove_all_video_quirks
add_parameters --quirk-no-chvt
}

View File

@ -1,89 +0,0 @@
From e8d0b58a9df080f021d04b4c2d358003974092f3 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 23 Feb 2010 13:57:05 +0000
Subject: on_ac_power: support UPower (new name for DeviceKit-power)
DeviceKit-power got renamed to UPower and its D-Bus interface changed
accordingly.
Try UPower first in on_ac_power.
If it fails, try DeviceKit-power.
It if fails too, try hal.
Also update documentation.
Signed-off-by: Michael Biebl <mbiebl@gmail.com>
---
diff --git a/man/pm-action.xml b/man/pm-action.xml
index ccb4153..6e9f639 100644
--- a/man/pm-action.xml
+++ b/man/pm-action.xml
@@ -104,7 +104,7 @@
For some options external programs are needed.
</para>
<para>
- These commands will usually be called by <command>DeviceKit-power</command>
+ These commands will usually be called by <command>UPower</command>
or <command>hald</command> when triggered to do so by a program
in a desktop session such as <command>gnome-power-manager</command>.
Calling them from the command line is also possible, but it is not
diff --git a/man/pm-is-supported.xml b/man/pm-is-supported.xml
index 88bb9fd..d07c87d 100644
--- a/man/pm-is-supported.xml
+++ b/man/pm-is-supported.xml
@@ -89,7 +89,7 @@
<para>
The intended purpose of <command>&dhpackage;</command> is to
find out which power management modes are supported by the
- system. hald(8) will call it to do just that. (Note that DeviceKit-power
+ system. hald(8) will call it to do just that. (Note that UPower
does not use this.)
</para>
</refsect1>
@@ -161,10 +161,6 @@
<!-- In alpabetical order. -->
<para>
<citerefentry>
- <refentrytitle>DeviceKit-power</refentrytitle>
- <manvolnum>7</manvolnum>
- </citerefentry>,
- <citerefentry>
<refentrytitle>hald</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>,
@@ -175,6 +171,10 @@
<citerefentry>
<refentrytitle>s2both</refentrytitle>
<manvolnum>8</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>UPower</refentrytitle>
+ <manvolnum>7</manvolnum>
</citerefentry>
</para>
</refsect1>
diff --git a/src/on_ac_power b/src/on_ac_power
index fdbcb36..1f9c59e 100755
--- a/src/on_ac_power
+++ b/src/on_ac_power
@@ -30,7 +30,17 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# prefer DeviceKit-power if available
+# prefer UPower if available
+if s="$(dbus-send --system --print-reply \
+ --dest=org.freedesktop.UPower \
+ /org/freedesktop/UPower \
+ org.freedesktop.DBus.Properties.Get \
+ string:org.freedesktop.UPower string:OnBattery)"; then
+ echo "$s" | grep -q 'boolean false'
+ exit $?
+fi
+
+# try its old name 'DeviceKit-power' too
if s="$(dbus-send --system --print-reply \
--dest=org.freedesktop.DeviceKit.Power \
/org/freedesktop/DeviceKit/Power \
--
cgit v0.8.3-6-g21f6

View File

@ -5,23 +5,27 @@
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=upower
pkgver=0.9.8
pkgver=0.9.12
pkgrel=1
pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics"
arch=('i686' 'x86_64')
url="http://upower.freedesktop.org"
license=('GPL')
depends=('udev>=166' 'libusb>=1.0.8' 'polkit>=0.98' 'pm-utils' 'dbus-glib>=0.92')
depends=('udev>=172' 'libusb>=1.0.8' 'polkit>=0.98' 'pm-utils>=1.4.1' 'dbus-glib>=0.92')
makedepends=('pkg-config' 'intltool' 'docbook-xsl')
replaces=('devicekit-power')
options=('!libtool')
source=($url/releases/${pkgname}-${pkgver}.tar.bz2)
md5sums=('cf10a756a93495e6076fecf1ac9d829b')
source=($url/releases/${pkgname}-${pkgver}.tar.xz)
sha256sums=('06e7bb323c93a8e377a3cc5000b8deafdd22c92f3d2f3ef7f1a1f74d8e134bb0')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--libexecdir=/usr/lib/upower --disable-static --disable-gtk-doc
--libexecdir=/usr/lib/upower --disable-static
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
}