diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-04-29 00:30:18 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-04-29 00:30:18 +0000 |
commit | 8d5c1f42e7e6f7d9002ae73f67863e83ddced974 (patch) | |
tree | 6a6eb4f400af32b21817fd0259acb5a98ec22386 /sys-apps/hdparm | |
parent | fix by David Leverton for PORTAGE_BZIP2_COMMAND/PORTAGE_BUNZIP2_COMMAND fallb... (diff) | |
download | gentoo-2-8d5c1f42e7e6f7d9002ae73f67863e83ddced974.tar.gz gentoo-2-8d5c1f42e7e6f7d9002ae73f67863e83ddced974.tar.bz2 gentoo-2-8d5c1f42e7e6f7d9002ae73f67863e83ddced974.zip |
Also run on cdrom devices, and drop devfsd support #413705 by tokiclover.
(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/hdparm')
-rw-r--r-- | sys-apps/hdparm/ChangeLog | 5 | ||||
-rw-r--r-- | sys-apps/hdparm/files/hdparm-init-8 | 97 |
2 files changed, 12 insertions, 90 deletions
diff --git a/sys-apps/hdparm/ChangeLog b/sys-apps/hdparm/ChangeLog index 57a557734670..6ce26d0d1841 100644 --- a/sys-apps/hdparm/ChangeLog +++ b/sys-apps/hdparm/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for sys-apps/hdparm # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/ChangeLog,v 1.229 2012/04/14 07:47:41 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/ChangeLog,v 1.230 2012/04/29 00:30:18 vapier Exp $ + + 29 Apr 2012; Mike Frysinger <vapier@gentoo.org> files/hdparm-init-8: + Also run on cdrom devices, and drop devfsd support #413705 by tokiclover. 14 Apr 2012; Zac Medico <zmedico@gentoo.org> hdparm-9.39.ebuild: Add ~amd64-linux keyword. diff --git a/sys-apps/hdparm/files/hdparm-init-8 b/sys-apps/hdparm/files/hdparm-init-8 index 89aa4f82b7aa..9a4200c8277a 100644 --- a/sys-apps/hdparm/files/hdparm-init-8 +++ b/sys-apps/hdparm/files/hdparm-init-8 @@ -1,24 +1,7 @@ #!/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. +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-init-8,v 1.3 2012/04/29 00:30:18 vapier Exp $ depend() { before bootmisc @@ -39,77 +22,17 @@ do_hdparm() { fi } -scan_devfs() { - local extra_args="pata_all_args" device= alias= args= - - # 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 - - if [ -z "$args" ] ; then - for alias in /dev/discs/* ; do - if [ "${alias}"/disc -ef "${device}" ]; then - device="${alias}/disc" - eval args=\$"$(basename "${alias}")"_args - break - fi - done - fi - - 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 - - if [ -z "$args" ] ; then - for alias in /dev/cdroms/* ; do - if [ "${alias}" -ef "${device}" ] ; then - device=${alias} - eval args=\$"$(basename "${alias}")"_args - break - fi - done - fi - - 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=$((${count} + 1)) - done -} - scan_nondevfs() { # non-devfs compatible system - for device in /dev/hd* /dev/sd* ; do + local device + + for device in /dev/hd* /dev/sd* /dev/cdrom* ; do [ -e "${device}" ] || continue case "${device}" in *[0-9]) continue ;; /dev/hd*) extra_args="pata_all_args" ;; /dev/sd*) extra_args="sata_all_args" ;; - *) extra_args="" ;; + *) extra_args="_no_xtra_args" ;; esac # check that the block device really exists by @@ -134,9 +57,5 @@ start() { return 0 fi - if [ -e /dev/.devfsd -a -d /dev/ide ] ; then - scan_devfs - else - scan_nondevfs - fi + scan_nondevfs } |