aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initscripts.spec1
-rwxr-xr-xrc.d/init.d/functions23
2 files changed, 12 insertions, 12 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 6103a611..199f0e0e 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -250,6 +250,7 @@ rm -rf $RPM_BUILD_ROOT
- allow building with a cross-compiler #64362,#64255
- faster check in network-functions:check_default_route()
- better checks for backup files
+- drastically reduce the number of consoletype invocations
* Fri Jul 05 2002 Florian La Roche <Florian.LaRoche@redhat.de>
- rc.sysinit: do not load raid modules unless /etc/raidtab exists
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 1371f897..996203a2 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -22,18 +22,19 @@ export PATH
# Get a sane screen width
[ -z "${COLUMNS:-}" ] && COLUMNS=80
+[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="`/sbin/consoletype`"
+
if [ -f /etc/sysconfig/i18n -a -z "${NOLOCALE:-}" ] ; then
. /etc/sysconfig/i18n
- if [ "${LANG:-}" = "ja_JP.eucJP" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
- elif [ "${LANG:-}" = "ko_KR.eucKR" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
- elif [ "${LANG:-}" = "zh_CN.GB2312" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
- elif [ "${LANG:-}" = "zh_TW.Big5" -a "`/sbin/consoletype`" != "pty" ]; then
- unset LANG
+ if [ "$CONSOLETYPE" != "pty" ]; then
+ case "${LANG:-}" in
+ ja_JP.eucJP|ko_KR.eucKR|zh_CN.GB2312|zh_TW.Big5)
+ unset LANG;;
+ *)
+ export LANG
+ esac
else
- export LANG
+ export LANG
fi
fi
@@ -53,15 +54,13 @@ if [ -z "${BOOTUP:-}" ]; then
SETCOLOR_NORMAL="echo -en \\033[0;39m"
LOGLEVEL=1
fi
- if [ -x /sbin/consoletype ]; then
- if [ "`consoletype`" = "serial" ]; then
+ if [ "$CONSOLETYPE" = "serial" ]; then
BOOTUP=serial
MOVE_TO_COL=
SETCOLOR_SUCCESS=
SETCOLOR_FAILURE=
SETCOLOR_WARNING=
SETCOLOR_NORMAL=
- fi
fi
fi