aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2009-07-29 01:12:23 -0300
committerThomas Bächler <thomas@archlinux.org>2009-07-29 09:27:14 +0200
commit7f643ce45cfa621165a67c6ad969a36d8fbd8924 (patch)
tree922d0c22253a1030520631a04bd6fef3618d91cc /rc.sysinit
parentd0722bd6fb631ce6c678de32d09a10e2e5fa7c35 (diff)
downloadinitscripts-7f643ce45cfa621165a67c6ad969a36d8fbd8924.tar.xz
Make dynamic initilization code for consoles.
This changes the currect code for console initialization to make it dynamic. For example when boot on UML the number of consoles is 15 and not 63. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit22
1 files changed, 11 insertions, 11 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 777ffe9..298f446 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -358,9 +358,9 @@ if echo "$LOCALE" | /bin/grep -qi utf ; then
# UTF-8 consoles are default since 2.6.24 kernel
# this code is needed not only for older kernels,
# but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8.
- for i in $(/usr/bin/seq 0 63); do
- /usr/bin/kbd_mode -u < /dev/tty${i}
- printf "\e%%G" > /dev/tty${i}
+ for i in /dev/tty[0-9]*; do
+ /usr/bin/kbd_mode -u < ${i}
+ printf "\e%%G" > ${i}
done
# the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e%%G"; fi' >>/etc/profile.d/locale.sh
@@ -369,9 +369,9 @@ if echo "$LOCALE" | /bin/grep -qi utf ; then
else
stat_busy "Setting Consoles to legacy mode"
# make non-UTF-8 consoles work on 2.6.24 and newer kernels
- for i in $(/usr/bin/seq 0 63); do
- /usr/bin/kbd_mode -a < /dev/tty${i}
- printf "\e%%@" > /dev/tty${i}
+ for i in /dev/tty[0-9]*; do
+ /usr/bin/kbd_mode -a < ${i}
+ printf "\e%%@" > ${i}
done
# the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e%%@"; fi' >>/etc/profile.d/locale.sh
@@ -385,18 +385,18 @@ if [ -n "$CONSOLEFONT" ]; then
if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | /bin/grep -qi utf ; then
CONSOLEMAP=""
fi
- for i in $(/usr/bin/seq 0 63); do
+ for i in /dev/tty[0-9]*; do
if [ -n "$CONSOLEMAP" ]; then
- /usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/tty${i} >/dev/null 2>&1
+ /usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C ${i} >/dev/null 2>&1
else
- /usr/bin/setfont $CONSOLEFONT -C /dev/tty${i} >/dev/null 2>&1
+ /usr/bin/setfont $CONSOLEFONT -C ${i} >/dev/null 2>&1
fi
done
if [ $? -ne 0 ]; then
stat_fail
else
- for i in $(/usr/bin/seq 0 63); do
- printf "\e(K" > /dev/tty${i}
+ for i in /dev/tty[0-9]*; do
+ printf "\e(K" > ${i}
done
# the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\e(K"; fi' >>/etc/profile.d/locale.sh