summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2011-08-26 10:53:51 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2011-08-26 10:53:51 +0000
commit0dee21eb4351714a35f84ae033ecdc5a6e34ad7a (patch)
treebbf3d15c9091ddbdf03768ad1e4d5bc9bd6b70fa /sys-power/apcupsd
parentVersion bump. (diff)
downloadgentoo-2-0dee21eb4351714a35f84ae033ecdc5a6e34ad7a.tar.gz
gentoo-2-0dee21eb4351714a35f84ae033ecdc5a6e34ad7a.tar.bz2
gentoo-2-0dee21eb4351714a35f84ae033ecdc5a6e34ad7a.zip
Add a udev rules file that allows persistent naming of APC UPS devices.
(Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
Diffstat (limited to 'sys-power/apcupsd')
-rw-r--r--sys-power/apcupsd/ChangeLog8
-rw-r--r--sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild (renamed from sys-power/apcupsd/apcupsd-3.14.9.ebuild)15
-rw-r--r--sys-power/apcupsd/files/apcupsd-udev.rules10
3 files changed, 31 insertions, 2 deletions
diff --git a/sys-power/apcupsd/ChangeLog b/sys-power/apcupsd/ChangeLog
index 3933bb1d3e39..773751bdcddf 100644
--- a/sys-power/apcupsd/ChangeLog
+++ b/sys-power/apcupsd/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-power/apcupsd
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.72 2011/08/26 10:08:01 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.73 2011/08/26 10:53:51 flameeyes Exp $
+
+*apcupsd-3.14.9-r1 (26 Aug 2011)
+
+ 26 Aug 2011; Diego E. Pettenò <flameeyes@gentoo.org> -apcupsd-3.14.9.ebuild,
+ +apcupsd-3.14.9-r1.ebuild, +files/apcupsd-udev.rules:
+ Add a udev rules file that allows persistent naming of APC UPS devices.
26 Aug 2011; Diego E. Pettenò <flameeyes@gentoo.org> apcupsd-3.14.7.ebuild,
apcupsd-3.14.8-r1.ebuild:
diff --git a/sys-power/apcupsd/apcupsd-3.14.9.ebuild b/sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild
index ccc6d6418408..90aca78e0249 100644
--- a/sys-power/apcupsd/apcupsd-3.14.9.ebuild
+++ b/sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.9.ebuild,v 1.1 2011/08/22 14:27:25 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild,v 1.1 2011/08/26 10:53:51 flameeyes Exp $
EAPI=4
@@ -94,6 +94,12 @@ src_install() {
# remove hal settings, we don't really want to have it around still.
rm -r "${D}"/usr/share/hal
+ # replace it with our udev rules if we're in Linux
+ if use kernel_linux; then
+ insinto /lib/udev/rules.d
+ newins "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules
+ fi
+
# Without this it'll crash at startup. When merging in ROOT= this
# won't be created by default, so we want to make sure we got it!
keepdir /var/lock
@@ -121,4 +127,11 @@ pkg_postinst() {
elog ''
elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m'
elog ''
+
+ if use kernel_linux; then
+ elog "Starting from version 3.14.9-r1, ${PN} installs udev rules"
+ elog "for persistent device naming. If you have multiple UPS"
+ elog "connected to the machine, you can point them to the devices"
+ elog "in /dev/apcups/by-id directory."
+ fi
}
diff --git a/sys-power/apcupsd/files/apcupsd-udev.rules b/sys-power/apcupsd/files/apcupsd-udev.rules
new file mode 100644
index 000000000000..b2eeb27302d8
--- /dev/null
+++ b/sys-power/apcupsd/files/apcupsd-udev.rules
@@ -0,0 +1,10 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION!="add", GOTO="apcupsd_end"
+SUBSYSTEM!="usb", GOTO="apcupsd_end"
+ENV{ID_VENDOR}=="", IMPORT{program}="usb_id --export %p"
+ENV{ID_VENDOR_ID}!="051d", GOTO="apcupsd_end"
+
+KERNEL=="?*", SYMLINK+="apcups/by-id/$env{ID_BUS}-$env{ID_SERIAL_SHORT}"
+
+LABEL="apcupsd_end"