diff options
author | Seth Chandler <sethbc@gentoo.org> | 2003-03-01 21:17:39 +0000 |
---|---|---|
committer | Seth Chandler <sethbc@gentoo.org> | 2003-03-01 21:17:39 +0000 |
commit | fea21bfdeeeda230d21a367b3673b0eedc0e289a (patch) | |
tree | b884cd1ea78a0b9eb7634b199fb0693fb6a00bc8 /sys-apps/hdparm/files | |
parent | fix installation (diff) | |
download | gentoo-2-fea21bfdeeeda230d21a367b3673b0eedc0e289a.tar.gz gentoo-2-fea21bfdeeeda230d21a367b3673b0eedc0e289a.tar.bz2 gentoo-2-fea21bfdeeeda230d21a367b3673b0eedc0e289a.zip |
updated rc-scripts for hdparm
Diffstat (limited to 'sys-apps/hdparm/files')
-rw-r--r-- | sys-apps/hdparm/files/digest-hdparm-5.3-r2 | 1 | ||||
-rw-r--r-- | sys-apps/hdparm/files/hdparm-conf.d | 15 | ||||
-rw-r--r-- | sys-apps/hdparm/files/hdparm-new-init | 105 |
3 files changed, 121 insertions, 0 deletions
diff --git a/sys-apps/hdparm/files/digest-hdparm-5.3-r2 b/sys-apps/hdparm/files/digest-hdparm-5.3-r2 new file mode 100644 index 000000000000..9d54b2662de0 --- /dev/null +++ b/sys-apps/hdparm/files/digest-hdparm-5.3-r2 @@ -0,0 +1 @@ +MD5 86c4d4508ce8289132bc6fdf71b5a5a9 hdparm-5.3.tar.gz 35837 diff --git a/sys-apps/hdparm/files/hdparm-conf.d b/sys-apps/hdparm/files/hdparm-conf.d new file mode 100644 index 000000000000..cf208a58aec0 --- /dev/null +++ b/sys-apps/hdparm/files/hdparm-conf.d @@ -0,0 +1,15 @@ +# Copyright 2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-conf.d,v 1.1 2003/03/01 21:17:39 sethbc Exp $ + +# You can either set hdparm arguments for each drive using disc*_args and cdrom*_args.. +# eg. +# disc0_args="-d1 -X66" +# disc1_args"-d1" +# cdrom0_args="-d1" + +# Or, you can set hdparm options for ALL drives using all_args.. +# eg. +# this mimics the behavior of the current script +all_args="-d1" + diff --git a/sys-apps/hdparm/files/hdparm-new-init b/sys-apps/hdparm/files/hdparm-new-init new file mode 100644 index 000000000000..fe6050136b98 --- /dev/null +++ b/sys-apps/hdparm/files/hdparm-new-init @@ -0,0 +1,105 @@ +#!/sbin/runscript +# Copyright 2003 Justin "Nagash" Jones +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-new-init,v 1.1 2003/03/01 21:17:39 sethbc Exp $ + +depend() { + need localmount +} + +checkconfig() { + drives="" + cdroms="" + + for i in `dir /dev/discs` + do + if [ ! -n "`ls -la /dev/discs/${i} | grep scsi`" ] + then + all_discs="${all_discs} `basename ${i}`" + elif [ ! -n "${all_args}" ] + then + ewarn "Skipping $i hdparm does not support SCSI devices." + fi + done + for i in `dir /dev/cdroms` + do + if [ ! -n "`ls -la /dev/cdroms/${i} | grep scsi`" ] + then + all_cdroms="${all_cdroms} `basename ${i}`" + elif [ ! -n "${all_args}" ] + then + ewarn "Skipping $i hdparm does not support SCSI devices." + fi + done + + for i in ${all_discs} + do + tmp_args=${i}_args + eval hd_args=\$${tmp_args} + + if [ -n "${hd_args}" ] + then + drives="$drives $i" + fi + done + + for i in ${all_cdroms} + do + tmp_args=${i}_args + eval hd_args=\$${tmp_args} + + if [ -n "${hd_args}" ] + then + cdroms="$cdroms $i" + fi + done +} + +start() { + ebegin "Starting hdparm" + checkconfig + + if [ -n "${all_args}" ] + then + for i in ${all_discs} + do + ebegin "Running hdparm on ${i}" + hdparm ${all_args} /dev/discs/${i}/disc &> /dev/null + eend $? "Failed to start hdparm on ${i}." + done + + for i in ${all_cdroms} + do + ebegin "Running hdparm on ${i}" + hdparm ${all_args} /dev/cdroms/${i} &> /dev/null + eend $? "Failed to start hdparm on ${i}." + done + else + for i in ${drives} + do + tmp_args=${i}_args + eval hd_args=\$$tmp_args + ebegin "Running hdparm on ${i}" + hdparm $hd_args /dev/discs/${i}/disc &> /dev/null + eend $? "Failed to start hdparm on ${i}." + done + + for i in ${cdroms} + do + tmp_args=${i}_args + eval hd_args=\$$tmp_args + ebegin "Running hdparm on ${i}" + hdparm $hd_args /dev/cdroms/${i} &> /dev/null + eend $? "Failed to start hdparm on ${i}." + done + fi + + eend $? "Failed to start hdparm." +} + +stop() { + ebegin "Stopping hdparm" + + eend $? "Failed to stop hdparm." +} + |