aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2000-11-30 05:27:29 +0000
committerBill Nottingham <notting@redhat.com>2000-11-30 05:27:29 +0000
commita0c90602f0ba826593a68f60271912f53900f9b2 (patch)
treecd3a12f89a74a05d0bad94b40c4a52aac2b10f74
parentbae85e6aeb801770726cbc64abac6cef375a68c6 (diff)
downloadinitscripts-a0c90602f0ba826593a68f60271912f53900f9b2.tar
initscripts-a0c90602f0ba826593a68f60271912f53900f9b2.tar.gz
initscripts-a0c90602f0ba826593a68f60271912f53900f9b2.tar.bz2
initscripts-a0c90602f0ba826593a68f60271912f53900f9b2.tar.xz
initscripts-a0c90602f0ba826593a68f60271912f53900f9b2.zip
From: Karsten Hopp (karsten@redhat.de)
- changed hdparm section in rc.sysinit to allow different parameters for each disk (if needed) by copying /etc/sysconfig/harddisks to /etc/sysconfig/harddiskhda (hdb,hdc..)
-rw-r--r--initscripts.spec10
-rwxr-xr-xrc.d/rc.sysinit73
2 files changed, 52 insertions, 31 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 33ef7a25..a278b8e1 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -1,6 +1,6 @@
Summary: The inittab file and the /etc/init.d scripts.
Name: initscripts
-Version: 5.51
+Version: 5.52
Copyright: GPL
Group: System Environment/Base
Release: 1
@@ -12,7 +12,7 @@ Requires: setup >= 2.0.3, /sbin/fuser, which
Requires: modutils >= 2.3.11-5
Requires: util-linux >= 2.10
Conflicts: kernel <= 2.2, timeconfig < 3.0, pppd < 2.3.9, wvdial < 1.40-3
-Conflicts: initscripts < 1.22.1-5, ypbind < 1.6-12
+Conflicts: initscripts < 1.22.1-5
Obsoletes: rhsound sapinit
Prereq: /sbin/chkconfig, /usr/sbin/groupadd, gawk, fileutils
BuildPrereq: glib-devel
@@ -229,6 +229,12 @@ rm -rf $RPM_BUILD_ROOT
%ghost %attr(0664,root,utmp) /var/run/utmp
%changelog
+* Tue Nov 21 2000 Karsten Hopp <karsten@redhat.de>
+- changed hdparm section in rc.sysinit to allow different
+ parameters for each disk (if needed) by copying
+ /etc/sysconfig/harddisks to /etc/sysconfig/harddiskhda (hdb,hdc..)
+- fix RFE #20967
+
* Tue Oct 31 2000 Than Ngo <than@redhat.com>
- fix the adding default route if GATEWAY=0.0.0.0
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 6be943d1..daba96dd 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -266,35 +266,50 @@ mount -f /proc
[ -f /proc/bus/usb/devices ] && mount -f -t usbdevfs usbdevfs /proc/bus/usb
# Turn on harddisk optimization
-if [ -f /etc/sysconfig/harddisks ] && [ -x /sbin/hdparm ]; then
- . /etc/sysconfig/harddisks
- HDFLAGS=
- if [ -n "$MULTIPLE_IO" ] && [ "$MULTIPLE_IO" != "0" ]; then
- HDFLAGS="-q -m$MULTIPLE_IO"
- fi
- if [ -n "$USE_DMA" ] && [ "$USE_DMA" != "0" ]; then
- HDFLAGS="$HDFLAGS -q -d$USE_DMA"
- fi
- if [ -n "$EIDE_32BIT" ]; then
- HDFLAGS="$HDFLAGS -q -c$EIDE_32BIT"
- fi
- if [ -n "$LOOKAHEAD" ]; then
- HDFLAGS="$HDFLAGS -q -A$LOOKAHEAD"
- fi
- if [ -n "$EXTRA_PARAMS" ]; then
- HDFLAGS="$HDFLAGS $EXTRA_PARAMS"
- fi
- if [ -n "$HDFLAGS" ]; then
- for i in a b c d e f g h ; do
- if [ -e "/proc/ide/hd$i/media" ] ; then
- hdmedia=`cat /proc/ide/hd$i/media`
- if [ "$hdmedia" = "disk" ]; then
- action "Setting hard drive parameters for hd$i: " /sbin/hdparm $HDFLAGS /dev/hd$i
- fi
- fi
- done
- fi
-fi
+# There is only one file /etc/sysconfig/harddisks for all disks
+# after installing the hdparm-RPM. If you need different hdparm parameters
+# for each of your disks, copy /etc/sysconfig/harddisks to
+# /etc/sysconfig/harddiskhda (hdb, hdc...) and modify it.
+# each disk witch has no special parameters will use the defaults.
+
+disk[0]=s; disk[1]=hda; disk[2]=hdb; disk[3]=hdc;
+disk[4]=hdd; disk[5]=hde; disk[6]=hdf; disk[7]=hdg; disk[8]=hdh;
+
+
+if [ -x /sbin/hdparm ]; then
+ for device in 0 1 2 3 4 5 6 7 8; do
+ unset MULTIPLE_IO USE_DMA EIDE_32BIT LOOKAHEAD EXTRA_PARAMS
+ if [ -f /etc/sysconfig/harddisk${disk[$device]} ]; then
+ . /etc/sysconfig/harddisk${disk[$device]}
+ HDFLAGS[$device]=
+ if [ -n "$MULTIPLE_IO" ] && [ "$MULTIPLE_IO" != "0" ]; then
+ HDFLAGS[$device]="-q -m$MULTIPLE_IO"
+ fi
+ if [ -n "$USE_DMA" ] && [ "$USE_DMA" != "0" ]; then
+ HDFLAGS[$device]="${HDFLAGS[$device]} -q -d$USE_DMA"
+ fi
+ if [ -n "$EIDE_32BIT" ]; then
+ HDFLAGS[$device]="${HDFLAGS[$device]} -q -c$EIDE_32BIT"
+ fi
+ if [ -n "$LOOKAHEAD" ]; then
+ HDFLAGS[$device]="${HDFLAGS[$device]} -q -A$LOOKAHEAD"
+ fi
+ if [ -n "$EXTRA_PARAMS" ]; then
+ HDFLAGS[$device]="${HDFLAGS[$device]} $EXTRA_PARAMS"
+ fi
+ else
+ HDFLAGS[$device]="${HDFLAGS[0]}"
+ fi
+ if [ -e "/proc/ide/${disk[$device]}/media" ] ; then
+ hdmedia=`cat /proc/ide/${disk[$device]}/media`
+ if [ "$hdmedia" = "disk" ]; then
+ if [ -n "${HDFLAGS[$device]}" ]; then
+ action "Setting hard drive parameters for ${disk[$device]}: " /sbin/hdparm ${HDFLAGS[$device]} /dev/${disk[$device]}
+ fi
+ fi
+ fi
+ done
+fi
# Update quotas if fsck was run on /.
if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then