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
26 . /etc/sysconfig/console
28 # Checking if we have framebuffer enabled
29 if [ -f /proc/fb ]; then
30 # /proc shows as files with size=0, this is workaround
31 if cat /proc/fb | grep -q "."; then FB=yes; fi
34 if [ -n "$SVGATEXTMODE" ]
36 run_cmd "Setting Text Mode $SVGATEXTMODE" SVGATextMode $SVGATEXTMODE
38 if [ -n "$CONSOLEFONT" ]
40 CMD="/usr/bin/setfont -m ${CONSOLEMAP:-trivial} $CONSOLEFONT"
41 show "Loading console font and map"; busy
43 # Check for devfs (workaround: -a option don't work at all)
44 if [ -d /dev/vc ]; then
46 pattern="s/\/dev\/vc\///g"
48 list=`ls /dev/tty[0-9] && ls /dev/tty[0-9][0-9]`
49 pattern="s/\/dev\/tty//g"
52 tty=`/usr/bin/tty | sed $pattern`
54 b=`ls $a | sed $pattern`
55 /usr/bin/open -c $b -s -w -- $CMD
58 if [ $tty = "/dev/console" ]; then tty=1; fi
59 /usr/bin/switchto $tty
67 run_cmd "Loading keyboard table" loadkeys $KEYTABLE < /dev/tty0 > /dev/tty0
69 echo "Enabling SAK sequence"
70 echo Control Alt keycode 101 = SAK | loadkeys
79 msg_usage "$0 {start|stop|status|restart}"