3 # console Loads console font and keyboard table
7 # description: Loads the console font, the application-charset map \
8 # and the keyboard table.
10 # This must be executed *after* /usr is mounted.
11 # This means, if /usr is NFS-mounted it needs to
12 # be run after networking and NFS mounts are up.
14 [ -f /etc/sysconfig/console ] || exit 0
16 [ -f /bin/loadkeys ] || exit 0
17 [ -f /usr/bin/setfont ] || exit 0
19 # Source function library
20 . /etc/rc.d/init.d/functions
24 . /etc/sysconfig/console
26 # Checking if we have framebuffer enabled
27 if [ -f /proc/fb ]; then
28 # /proc shows as files with size=0, this is workaround
29 if cat /proc/fb | grep -q "."; then FB=yes; fi
32 if [ -n "$SVGATEXTMODE" ]
34 run_cmd "Setting Text Mode $SVGATEXTMODE" SVGATextMode $SVGATEXTMODE
36 if [ -n "$CONSOLEFONT" ]
38 CMD="/usr/bin/setfont -m ${CONSOLEMAP:-trivial} $CONSOLEFONT"
39 show "Loading console font and map"; busy
41 # don't initialize on multiple terminals if we use fbset
42 # (assume that, in this case fb is loaded as a module)
43 if [ ! -z $FB ] && [ -f /var/lock/subsys/fbset ]; then
44 # Check for devfs (workaround: -a option don't work at all)
45 if [ -d /dev/vc ]; then
46 pattern="s/\/dev\/vc\///g"
48 pattern="s/\/dev\/tty//g"
52 tty=`/usr/bin/tty | sed $pattern`
54 # check if devfs (workaround: -a option don't work at all)
55 if [ -d /dev/vc ]; then
56 DEVICES="`ls /dev/vc/* | sed 's|/dev/vc/||g'`"
58 DEVICES="`cat /etc/inittab | grep '^[0-9]*:' | cut -f1 -d :`"
61 [ -z "$SET_FONT_TERMINALS" ] && SET_FONT_TERMINALS="$DEVICES"
63 for cons in $SET_FONT_TERMINALS; do
64 /usr/bin/open -c $cons -s -w -- $CMD
67 if [ $tty = "/dev/console" ]; then tty=1; fi
68 /usr/bin/switchto $tty
76 run_cmd "Loading keyboard table" loadkeys $KEYTABLE < /dev/tty0 > /dev/tty0
78 echo "Enabling SAK sequence"
79 echo Control Alt keycode 101 = SAK | loadkeys
82 if [ $POWER_SAVE ]; then
83 if [ $BLANK_TIME ]; then
84 power_option="-blank $BLANK_TIME";
86 if [ $POWERDOWN_TIME ]; then
87 power_option="-powerdown $POWERDOWN_TIME $power_option";
89 /usr/bin/setterm $power_option -powersave $POWER_SAVE
91 if [ $FOREGROUND_COLOUR ]; then
92 /usr/bin/setterm -foreground $FOREGROUND_COLOUR
94 if [ $BACKGROUND_COLOUR ]; then
95 /usr/bin/setterm -background $BACKGROUND_COLOUR
99 /usr/bin/setterm -defaults
105 msg_usage "$0 {start|stop|status|restart}"