diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-06-25 04:43:52 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-06-25 04:43:52 +0000 |
commit | 6cdc12ea70a0c3d8894064c21442f2bd5e4455a6 (patch) | |
tree | 213a4cae1e7cd2f7f421abd217afbf005e04f808 /sys-apps/hdparm | |
parent | old (diff) | |
download | gentoo-2-6cdc12ea70a0c3d8894064c21442f2bd5e4455a6.tar.gz gentoo-2-6cdc12ea70a0c3d8894064c21442f2bd5e4455a6.tar.bz2 gentoo-2-6cdc12ea70a0c3d8894064c21442f2bd5e4455a6.zip |
Version bump and add initial support for SATA drives #130330.
(Portage version: 2.1.1_pre1-r2)
Diffstat (limited to 'sys-apps/hdparm')
-rw-r--r-- | sys-apps/hdparm/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/hdparm/files/digest-hdparm-6.6 | 3 | ||||
-rw-r--r-- | sys-apps/hdparm/files/hdparm-conf.d.3 | 11 | ||||
-rw-r--r-- | sys-apps/hdparm/files/hdparm-init-7 | 157 | ||||
-rw-r--r-- | sys-apps/hdparm/hdparm-6.6.ebuild | 40 |
5 files changed, 141 insertions, 78 deletions
diff --git a/sys-apps/hdparm/ChangeLog b/sys-apps/hdparm/ChangeLog index a115378cb95a..891203ca63e7 100644 --- a/sys-apps/hdparm/ChangeLog +++ b/sys-apps/hdparm/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/hdparm # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/ChangeLog,v 1.77 2006/03/19 22:01:58 ferdy Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/ChangeLog,v 1.78 2006/06/25 04:43:52 vapier Exp $ + +*hdparm-6.6 (25 Jun 2006) + + 25 Jun 2006; Mike Frysinger <vapier@gentoo.org> files/hdparm-init-7, + files/hdparm-conf.d.3, +hdparm-6.6.ebuild: + Version bump and add initial support for SATA drives #130330. 19 Mar 2006; Fernando J. Pereda <ferdy@gentoo.org> hdparm-6.3.ebuild: Stable on alpha as per bug #125656 diff --git a/sys-apps/hdparm/files/digest-hdparm-6.6 b/sys-apps/hdparm/files/digest-hdparm-6.6 new file mode 100644 index 000000000000..6fc9620e21cc --- /dev/null +++ b/sys-apps/hdparm/files/digest-hdparm-6.6 @@ -0,0 +1,3 @@ +MD5 ecea69f775396e4ab6112dcf9066239f hdparm-6.6.tar.gz 45538 +RMD160 714fbc5216bdb427c7e817649f3c4f5462620c13 hdparm-6.6.tar.gz 45538 +SHA256 7e2db39a4e1f41bb327a9a8ef9e5e8359aaed0cc78e642a4ca67659629e3048b hdparm-6.6.tar.gz 45538 diff --git a/sys-apps/hdparm/files/hdparm-conf.d.3 b/sys-apps/hdparm/files/hdparm-conf.d.3 index d47c205606fb..ae4c454a7b62 100644 --- a/sys-apps/hdparm/files/hdparm-conf.d.3 +++ b/sys-apps/hdparm/files/hdparm-conf.d.3 @@ -7,6 +7,11 @@ # disc1_args="-d1" # cdrom0_args="-d1" -# or, you can set hdparm options for ALL drives using all_args, e.g. -# -all_args="-d1" +# or you can set options for all PATA drives +pata_all_args="-d1" + +# or you can set options for all SATA drives +sata_all_args="" + +# or, you can set hdparm options for all drives +all_args="" diff --git a/sys-apps/hdparm/files/hdparm-init-7 b/sys-apps/hdparm/files/hdparm-init-7 index 231d42021d47..559db1f389cd 100644 --- a/sys-apps/hdparm/files/hdparm-init-7 +++ b/sys-apps/hdparm/files/hdparm-init-7 @@ -25,7 +25,7 @@ depend() { } do_hdparm() { - if [[ ${args:=$all_args} ]] ; then + if [[ -n ${args:=${all_args} ${!extra_args}} ]] ; then local orgdevice=$(readlink -f ${device}) if [[ -b ${orgdevice} ]] ; then ebegin "Running hdparm on ${device}" @@ -35,96 +35,105 @@ do_hdparm() { fi } -start() { +scan_devfs() { + extra_args="pata_all_args" - if [ -e /dev/.devfs ] && [ -d /dev/ide ] - then + # devfs compatible systems + for device in $(find /dev/ide -name disc) + do + args='' - # devfs compatible systems - for device in $(find /dev/ide -name disc) + for alias in /dev/hd? 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 - + if [ $alias -ef $device ] + then + device=$alias + eval args=\${`basename $alias`_args} + break + fi done - for device in $(find /dev/ide -name cd) + [ -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 - 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 - do_hdparm + done - done + for device in $(find /dev/ide -name cd) + do + + args='' - 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) + for alias in /dev/hd? do - eval args=\${generic${count}_args} - do_hdparm - let count=count+1 + if [ $alias -ef $device ] + then + device=$alias + eval args=\${`basename $alias`_args} + break + fi done - else - - # non-devfs compatible system - for device in /dev/hd? + [ -z "$args" ] && for alias in /dev/cdroms/* do - # check that the block device really exists - # by opening it for reading - local errmsg status - errmsg=$(: 2>&1 <$device) - status=$? - if [[ -b $device ]] && [[ ${status} == 0 || ${errmsg} == *": No medium found" ]] + if [ $alias -ef $device ] then - eval args=\${`basename $device`_args} - do_hdparm + device=$alias + eval args=\${`basename $alias`_args} + break fi done + do_hdparm + done + + local 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 + ((++count)) + done +} + +scan_nondevfs() { + # non-devfs compatible system + for device in /dev/hd? /dev/sd? ; do + case ${device} in + /dev/hd*) extra_args="pata_all_args" ;; + /dev/sd*) extra_args="sata_all_args" ;; + *) extra_args="" ;; + esac + + # check that the block device really exists by + # opening it for reading + local errmsg status + errmsg=$(: 2>&1 <$device) + status=$? + if [[ -b $device ]] && \ + [[ ${status} == 0 || ${errmsg} == *": No medium found" ]] + then + local conf_var="${device##*/}_args" + args=${!conf_var} + do_hdparm + fi + done +} + +start() { + if [[ -e /dev/.devfs ]] && [[ -d /dev/ide ]] ; then + scan_devfs + else + scan_nondevfs fi } diff --git a/sys-apps/hdparm/hdparm-6.6.ebuild b/sys-apps/hdparm/hdparm-6.6.ebuild new file mode 100644 index 000000000000..19bad8fa6bc6 --- /dev/null +++ b/sys-apps/hdparm/hdparm-6.6.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/hdparm-6.6.ebuild,v 1.1 2006/06/25 04:43:52 vapier Exp $ + +inherit toolchain-funcs + +DESCRIPTION="Utility to change hard drive performance parameters" +HOMEPAGE="http://sourceforge.net/projects/hdparm/" +SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="" + +DEPEND="" + +src_unpack() { + unpack ${A} + cd ${S} + sed -i \ + -e "/^CFLAGS/ s:-O2:${CFLAGS}:" \ + -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \ + Makefile || die "sed" +} + +src_compile() { + emake CC="$(tc-getCC)" || die "compile error" +} + +src_install() { + into / + dosbin hdparm contrib/idectl || die "dosbin" + + newinitd "${FILESDIR}"/hdparm-init-7 hdparm + newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm + + doman hdparm.8 + dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig +} |