From 308259025d51e1f340d7eaf95ee92ce3b981e692 Mon Sep 17 00:00:00 2001 From: Alon Bar-Lev Date: Wed, 11 Jun 2014 22:29:13 +0000 Subject: Add wireless kernel compatibility, bug#511110, thanks to Stefan Huber (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key BF20DC51) --- app-laptop/laptop-mode-tools/ChangeLog | 9 +- ...laptop-mode-tools-1.64-wireless-sysfsattr.patch | 41 +++++++++ .../laptop-mode-tools-1.64-r1.ebuild | 95 --------------------- .../laptop-mode-tools-1.64-r2.ebuild | 96 ++++++++++++++++++++++ 4 files changed, 145 insertions(+), 96 deletions(-) create mode 100644 app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.64-wireless-sysfsattr.patch delete mode 100644 app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r1.ebuild create mode 100644 app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r2.ebuild (limited to 'app-laptop') diff --git a/app-laptop/laptop-mode-tools/ChangeLog b/app-laptop/laptop-mode-tools/ChangeLog index d7296eed02e2..7bc970948f9e 100644 --- a/app-laptop/laptop-mode-tools/ChangeLog +++ b/app-laptop/laptop-mode-tools/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-laptop/laptop-mode-tools # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-laptop/laptop-mode-tools/ChangeLog,v 1.89 2014/06/07 17:13:16 alonbl Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-laptop/laptop-mode-tools/ChangeLog,v 1.90 2014/06/11 22:29:13 alonbl Exp $ + +*laptop-mode-tools-1.64-r2 (11 Jun 2014) + + 11 Jun 2014; Alon Bar-Lev + +files/laptop-mode-tools-1.64-wireless-sysfsattr.patch, + +laptop-mode-tools-1.64-r2.ebuild, -laptop-mode-tools-1.64-r1.ebuild: + Add wireless kernel compatibility, bug#511110, thanks to Stefan Huber 07 Jun 2014; Alon Bar-Lev laptop-mode-tools-1.64-r1.ebuild: diff --git a/app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.64-wireless-sysfsattr.patch b/app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.64-wireless-sysfsattr.patch new file mode 100644 index 000000000000..ba7b86251c16 --- /dev/null +++ b/app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.64-wireless-sysfsattr.patch @@ -0,0 +1,41 @@ +commit b340a340256c8fc97ec35a1df9e67ab033765480 +Author: Alon Bar-Lev +Date: Sat May 24 12:59:21 2014 +0300 + + wireless: support both sysfs attr enable/enabled + + backport of commit 8e8a88373079dffdf7196e2e622c5ade209b4439 + + Starting with linux kernel 3.13, the sysfs attribute 'enable' for pci + devices was renambed to 'enabled'. + + Support the two notations to allow seamless migration. + + Signed-off-by: Stefan Huber + +diff --git a/usr/share/laptop-mode-tools/modules/wireless-ipw-power b/usr/share/laptop-mode-tools/modules/wireless-ipw-power +index 3fd93ec..1579c1f 100755 +--- a/usr/share/laptop-mode-tools/modules/wireless-ipw-power ++++ b/usr/share/laptop-mode-tools/modules/wireless-ipw-power +@@ -71,7 +71,7 @@ if [ x$CONTROL_IPW_POWER = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_IPW + # the driver. + LINK_TARGET=`readlink $DEVICE/device/driver` + LINK_TARGET=${LINK_TARGET##*/} +- ENABLED=`cat $DEVICE/device/enable` ++ ENABLED=`[ -r $DEVICE/device/enabled ] && cat $DEVICE/device/enabled || cat $DEVICE/device/enable` + + if [ $ENABLED -eq 1 -a "$LINK_TARGET" = "$1" ]; then + # add the interface name to the list +diff --git a/usr/share/laptop-mode-tools/modules/wireless-iwl-power b/usr/share/laptop-mode-tools/modules/wireless-iwl-power +index ffdedec..ce82e1d 100755 +--- a/usr/share/laptop-mode-tools/modules/wireless-iwl-power ++++ b/usr/share/laptop-mode-tools/modules/wireless-iwl-power +@@ -24,7 +24,7 @@ findWifiIfsByDriver () { + # the driver. + LINK_TARGET=`readlink $DEVICE/device/driver` + LINK_TARGET=${LINK_TARGET##*/} +- ENABLED=`cat $DEVICE/device/enable` ++ ENABLED=`[ -r $DEVICE/device/enabled ] && cat $DEVICE/device/enabled || cat $DEVICE/device/enable` + + if [ $ENABLED -eq 1 -a "$LINK_TARGET" = "$1" ] ; then + # add the interface name to the list diff --git a/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r1.ebuild b/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r1.ebuild deleted file mode 100644 index 40ab731ba3c3..000000000000 --- a/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r1.ebuild +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r1.ebuild,v 1.3 2014/06/07 17:13:16 alonbl Exp $ - -EAPI=5 -inherit eutils multilib systemd udev - -MY_P=${PN}_${PV} - -DESCRIPTION="Linux kernel laptop_mode user-space utilities" -HOMEPAGE="http://www.samwel.tk/laptop_mode/" -SRC_URI="http://www.samwel.tk/laptop_mode/tools/downloads/${MY_P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" -IUSE="+acpi apm bluetooth scsi" - -RDEPEND="net-wireless/wireless-tools - sys-apps/iproute2 - sys-apps/ethtool - sys-apps/hdparm - sys-apps/which - acpi? ( sys-power/acpid ) - apm? ( sys-apps/apmd ) - bluetooth? ( net-wireless/bluez:= ) - scsi? ( sys-apps/sdparm )" -DEPEND="" - -S=${WORKDIR}/${MY_P} - -src_prepare() { - epatch "${FILESDIR}/${P}-ethernet-power.patch" - - # This should avoid conflict with pm-powersave wrt #327443 and #396703 - cat <<-EOF > "${T}"/${PN} - HOOK_BLACKLIST="00powersave" - EOF -} - -src_compile() { :; } - -src_install() { - DESTDIR="${D}" \ - INIT_D="none" \ - MAN_D="/usr/share/man" \ - LIB_D="/usr/$(get_libdir)" \ - UDEV_D="$(get_udevdir)" \ - SYSTEMD_UNIT_D="$(systemd_get_unitdir)" \ - TMPFILES_D="/usr/$(get_libdir)/tmpfiles.d" \ - ACPI="$(use acpi && echo force || echo disabled)" \ - PMU="$(false && echo force || echo disabled)" \ - APM="$(use apm && echo force || echo disabled)" \ - SYSTEMD=yes \ - sh ./install.sh || die - - dodoc Documentation/*.txt README.md - newinitd "${FILESDIR}"/laptop_mode.init-1.4 laptop_mode - - # See src_prepare() - insinto /etc/pm/config.d - doins "${T}"/${PN} -} - -pkg_postinst() { - if use acpi || use apm; then - if use acpi; then - daemon_name="acpid" - elif use apm; then - deamon_name="apmd" - fi - if [ "$(rc-config list default | grep laptop_mode)" = "" ] || [ "$(rc-config list default | grep ${daemon_name} )" = "" ]; then - ewarn "To enable automatic power state event handling," - ewarn "e.g. enabling laptop_mode after unplugging the battery," - ewarn "both laptop_mode and the ${daemon_name} daemon must be" - ewarn "added to default runlevel:" - if [ "$(rc-config list default | grep laptop_mode)" = "" ]; then - ewarn "# rc-update add laptop_mode default" - fi - if [ "$(rc-config list default | grep ${daemon_name} )" = "" ]; then - ewarn "# rc-update add ${daemon_name} default" - fi - fi - else - ewarn "Without USE=\"acpi\" or USE=\"apm\" ${PN} can not" - ewarn "automatically disable laptop_mode on low battery." - ewarn - ewarn "This means you can lose up to 10 minutes of work if running" - ewarn "out of battery while laptop_mode is enabled." - ewarn - ewarn "Please see laptop-mode.txt in /usr/share/doc/${PF} for further" - ewarn "information." - ewarn - fi -} diff --git a/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r2.ebuild b/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r2.ebuild new file mode 100644 index 000000000000..58673eba981e --- /dev/null +++ b/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r2.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-laptop/laptop-mode-tools/laptop-mode-tools-1.64-r2.ebuild,v 1.1 2014/06/11 22:29:13 alonbl Exp $ + +EAPI=5 +inherit eutils multilib systemd udev + +MY_P=${PN}_${PV} + +DESCRIPTION="Linux kernel laptop_mode user-space utilities" +HOMEPAGE="http://www.samwel.tk/laptop_mode/" +SRC_URI="http://www.samwel.tk/laptop_mode/tools/downloads/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="+acpi apm bluetooth scsi" + +RDEPEND="net-wireless/wireless-tools + sys-apps/iproute2 + sys-apps/ethtool + sys-apps/hdparm + sys-apps/which + acpi? ( sys-power/acpid ) + apm? ( sys-apps/apmd ) + bluetooth? ( net-wireless/bluez:= ) + scsi? ( sys-apps/sdparm )" +DEPEND="" + +S=${WORKDIR}/${MY_P} + +src_prepare() { + epatch "${FILESDIR}/${P}-ethernet-power.patch" + epatch "${FILESDIR}/${P}-wireless-sysfsattr.patch" + + # This should avoid conflict with pm-powersave wrt #327443 and #396703 + cat <<-EOF > "${T}"/${PN} + HOOK_BLACKLIST="00powersave" + EOF +} + +src_compile() { :; } + +src_install() { + DESTDIR="${D}" \ + INIT_D="none" \ + MAN_D="/usr/share/man" \ + LIB_D="/usr/$(get_libdir)" \ + UDEV_D="$(get_udevdir)" \ + SYSTEMD_UNIT_D="$(systemd_get_unitdir)" \ + TMPFILES_D="/usr/$(get_libdir)/tmpfiles.d" \ + ACPI="$(use acpi && echo force || echo disabled)" \ + PMU="$(false && echo force || echo disabled)" \ + APM="$(use apm && echo force || echo disabled)" \ + SYSTEMD=yes \ + sh ./install.sh || die + + dodoc Documentation/*.txt README.md + newinitd "${FILESDIR}"/laptop_mode.init-1.4 laptop_mode + + # See src_prepare() + insinto /etc/pm/config.d + doins "${T}"/${PN} +} + +pkg_postinst() { + if use acpi || use apm; then + if use acpi; then + daemon_name="acpid" + elif use apm; then + deamon_name="apmd" + fi + if [ "$(rc-config list default | grep laptop_mode)" = "" ] || [ "$(rc-config list default | grep ${daemon_name} )" = "" ]; then + ewarn "To enable automatic power state event handling," + ewarn "e.g. enabling laptop_mode after unplugging the battery," + ewarn "both laptop_mode and the ${daemon_name} daemon must be" + ewarn "added to default runlevel:" + if [ "$(rc-config list default | grep laptop_mode)" = "" ]; then + ewarn "# rc-update add laptop_mode default" + fi + if [ "$(rc-config list default | grep ${daemon_name} )" = "" ]; then + ewarn "# rc-update add ${daemon_name} default" + fi + fi + else + ewarn "Without USE=\"acpi\" or USE=\"apm\" ${PN} can not" + ewarn "automatically disable laptop_mode on low battery." + ewarn + ewarn "This means you can lose up to 10 minutes of work if running" + ewarn "out of battery while laptop_mode is enabled." + ewarn + ewarn "Please see laptop-mode.txt in /usr/share/doc/${PF} for further" + ewarn "information." + ewarn + fi +} -- cgit v1.2.3-65-gdbad