diff options
author | Heinrich Wendel <lanius@gentoo.org> | 2004-09-08 16:22:46 +0000 |
---|---|---|
committer | Heinrich Wendel <lanius@gentoo.org> | 2004-09-08 16:22:46 +0000 |
commit | c68deb7a13f7f4ead6231bc5d5dfaa38805ea8d6 (patch) | |
tree | 1080a4f1512b4f2a9681137a903a0f3e0defd9bf /sys-apps/hdparm | |
parent | fix pid file, bug #62838 (Manifest recommit) (diff) | |
download | gentoo-2-c68deb7a13f7f4ead6231bc5d5dfaa38805ea8d6.tar.gz gentoo-2-c68deb7a13f7f4ead6231bc5d5dfaa38805ea8d6.tar.bz2 gentoo-2-c68deb7a13f7f4ead6231bc5d5dfaa38805ea8d6.zip |
support non-devfs compatible udev systems, bug #62915
Diffstat (limited to 'sys-apps/hdparm')
-rw-r--r-- | sys-apps/hdparm/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/hdparm/Manifest | 27 | ||||
-rw-r--r-- | sys-apps/hdparm/files/digest-hdparm-5.7-r1 | 1 | ||||
-rw-r--r-- | sys-apps/hdparm/files/hdparm-init-7 | 132 | ||||
-rw-r--r-- | sys-apps/hdparm/hdparm-5.7-r1.ebuild | 49 |
5 files changed, 199 insertions, 18 deletions
diff --git a/sys-apps/hdparm/ChangeLog b/sys-apps/hdparm/ChangeLog index f06d23dca366..4b14625e69ef 100644 --- a/sys-apps/hdparm/ChangeLog +++ b/sys-apps/hdparm/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/hdparm # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/ChangeLog,v 1.50 2004/09/06 02:17:08 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/ChangeLog,v 1.51 2004/09/08 16:22:46 lanius Exp $ + +*hdparm-5.7-r1 (08 Sep 2004) + + 08 Sep 2004; Heinrich Wendel <lanius@gentoo.org> +files/hdparm-init-7, + +hdparm-5.7-r1.ebuild: + support non-devfs compatible udev systems, bug #62915 06 Sep 2004; Sven Wegener <swegener@gentoo.org> files/hdparm-conf.d, files/hdparm-conf.d.3: diff --git a/sys-apps/hdparm/Manifest b/sys-apps/hdparm/Manifest index 5076d5b2f28b..ad5e3dafedc3 100644 --- a/sys-apps/hdparm/Manifest +++ b/sys-apps/hdparm/Manifest @@ -1,27 +1,20 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -MD5 e4f58280904d275f74fd9d97a0ea07e8 ChangeLog 6657 -MD5 27612805eeeff9fa51cb602fde9e2be2 hdparm-5.4.ebuild 1158 -MD5 afd1922e4ffc669c00d8126b9f4dc7e1 hdparm-5.5-r4.ebuild 1284 +MD5 3236b7d261a80cab0d2d237289f489ae hdparm-5.7-r1.ebuild 1232 MD5 860dc3584fa1d36414014543f9ac7843 hdparm-5.5.ebuild 1277 +MD5 0b4acdf6a79f5de1c7466f601abdd5b4 hdparm-5.7.ebuild 1232 +MD5 afd1922e4ffc669c00d8126b9f4dc7e1 hdparm-5.5-r4.ebuild 1284 +MD5 27612805eeeff9fa51cb602fde9e2be2 hdparm-5.4.ebuild 1158 MD5 aa5e51a0e3d7add5cc6da0da4d74922d hdparm-5.6.ebuild 1228 +MD5 6e2b185c95cf01699842981506c9f94a ChangeLog 6842 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 -MD5 0b4acdf6a79f5de1c7466f601abdd5b4 hdparm-5.7.ebuild 1232 MD5 300982c72dc0f865d5ad6c542e3b6c4c files/digest-hdparm-5.4 61 MD5 f5fc13fdfccb0f5600d45488c6a5d534 files/digest-hdparm-5.5 61 -MD5 f5fc13fdfccb0f5600d45488c6a5d534 files/digest-hdparm-5.5-r4 61 MD5 54e0645b436384968aed6c895cea3289 files/digest-hdparm-5.6 61 +MD5 5f8df0f54a44a97ccf131b4336698128 files/digest-hdparm-5.7 61 MD5 58b06c855068c6d95b0f665c201d6051 files/hdparm-5.4-readahead_rename.patch 1254 MD5 82a65f0cc4df5c775215311866cacaee files/hdparm-conf.d 513 -MD5 5246893ec7894ece9bf7a851d11fa18d files/hdparm-conf.d.3 491 MD5 dce31c3384bc0bf7baa99a850bd9494e files/hdparm-init-2 2126 MD5 935116718ebf153586f84f587e22e950 files/hdparm-init-6 3398 -MD5 5f8df0f54a44a97ccf131b4336698128 files/digest-hdparm-5.7 61 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.2.6 (GNU/Linux) - -iD8DBQFBO8ivI1lqEGTUzyQRAvfyAJwPl/iJOe/tfATofmoLsWMxG7yweACfSoYd -7MgoIdgn5ja8MH9gypt9mSk= -=vGlS ------END PGP SIGNATURE----- +MD5 c38076a414cefab249a09426a592259e files/hdparm-init-7 2706 +MD5 f5fc13fdfccb0f5600d45488c6a5d534 files/digest-hdparm-5.5-r4 61 +MD5 5f8df0f54a44a97ccf131b4336698128 files/digest-hdparm-5.7-r1 61 +MD5 5246893ec7894ece9bf7a851d11fa18d files/hdparm-conf.d.3 491 diff --git a/sys-apps/hdparm/files/digest-hdparm-5.7-r1 b/sys-apps/hdparm/files/digest-hdparm-5.7-r1 new file mode 100644 index 000000000000..8e2c57e1effc --- /dev/null +++ b/sys-apps/hdparm/files/digest-hdparm-5.7-r1 @@ -0,0 +1 @@ +MD5 1bfb16ac78ca4af8b3e4e3b9fab28743 hdparm-5.7.tar.gz 38638 diff --git a/sys-apps/hdparm/files/hdparm-init-7 b/sys-apps/hdparm/files/hdparm-init-7 new file mode 100644 index 000000000000..60236bad6f86 --- /dev/null +++ b/sys-apps/hdparm/files/hdparm-init-7 @@ -0,0 +1,132 @@ +#!/sbin/runscript +# METHOD +# ------ +# if /dev/ide exists, find all block devices beneath it named disc, cd, or +# generic. +# +# for the disc and cd ones, if there is a a matching /dev/hdX symlink and +# hdX_args is set in the config file, use hdX_args. otherwise, if there is a +# matching /dev/discs/discX or /dev/cdroms/cdromX symlink, and discX_args or +# cdromX_args is set in the config file, use discX_args / cdromX_args. finally, +# if all_args is set in the config file, use that. +# +# for the generic ones, sort them and look for genericX_args in the config file +# or use all_args. +# +# if /dev/ide does not exist, check the /dev/hdX entries, and see which ones +# correspond to real devices by opening them for reading. then check hdX_args +# and all_args in the config file. +# +# for each device considered, if no args are found in the config file, do not +# run hdparm. + +depend() { + before bootmisc +} + +do_hdparm() { + if [[ ${args:=$all_args} ]] + then + orgdevice=`readlink -f $device` + if [ -b $orgdevice ]; then + ebegin "Running hdparm on $device" + hdparm $args $device > /dev/null || ewarn "Failed to run hdparm on $device" + fi + fi +} + +start() { + + ebegin 'Starting hdparm' + + which hdparm &>/dev/null + eend $? 'hdparm executable not found' + + if [ -d /dev/ide ] + then + + # devfs compatible systems + for device in $(find /dev/ide -name disc) + do + + args='' + + for alias in /dev/hd? + do + if [ $alias -ef $device ] + then + device=$alias + eval args=\${`basename $alias`_args} + break + fi + done + + [ -z "$args" ] && for alias in /dev/discs/* + do + if [ $alias/disc -ef $device ] + then + device=$alias/disc + eval args=\${`basename $alias`_args} + break + fi + done + + do_hdparm + + done + + for device in $(find /dev/ide -name cd) + do + + args='' + + for alias in /dev/hd? + do + if [ $alias -ef $device ] + then + device=$alias + eval args=\${`basename $alias`_args} + break + fi + done + + [ -z $args ] && for alias in /dev/cdroms/* + do + if [ $alias -ef $device ] + then + device=$alias + eval args=\${`basename $alias`_args} + break + fi + done + + do_hdparm + + done + + let count=0 + # of course, the sort approach would fail here if any of the + # host/bus/target/lun numbers reached 2 digits.. + for device in $(find /dev/ide -name generic | sort) + do + eval args=\${generic${count}_args} + do_hdparm + let count=count+1 + done + + else + + # non-devfs compatible system + for device in /dev/hd? + do + # check that the block device really exists + # by opening it for reading + if [ -b $device ] && ( : <$device ) 2>/dev/null + then + eval args=\${`basename $device`_args} + do_hdparm + fi + done + + fi +} diff --git a/sys-apps/hdparm/hdparm-5.7-r1.ebuild b/sys-apps/hdparm/hdparm-5.7-r1.ebuild new file mode 100644 index 000000000000..9a3c85620f24 --- /dev/null +++ b/sys-apps/hdparm/hdparm-5.7-r1.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/hdparm-5.7-r1.ebuild,v 1.1 2004/09/08 16:22:46 lanius Exp $ + +inherit gcc eutils + +DESCRIPTION="Utility to change hard drive performance parameters" +HOMEPAGE="http://www.ibiblio.org/pub/Linux/system/hardware/" +SRC_URI="http://www.ibiblio.org/pub/Linux/system/hardware/${P}.tar.gz" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~ppc64 ~s390" +IUSE="" + +DEPEND="virtual/libc" + +src_unpack() { + unpack ${A} + cd ${S} + sed -i \ + -e "/^CC/s:gcc:$(gcc-getCC):" \ + -e "/^CFLAGS/s:-O2:${CFLAGS}:" \ + Makefile || die +} + +src_compile() { + emake || die "compile error" +} + +src_install() { + into / + dosbin hdparm contrib/idectl || die + + exeinto /etc/init.d + newexe ${FILESDIR}/hdparm-init-7 hdparm + + insinto /etc/conf.d + newins ${FILESDIR}/hdparm-conf.d.3 hdparm + + doman hdparm.8 + dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig +} + +pkg_postinst() { + einfo "The rc-script for hdparm has been updated, so make sure " + einfo "that you etc-update. The script is much more configurable" + einfo "for details please see /etc/conf.d/hdparm" +} |