4 # fbset: Sets up fbcon video modes.
8 # description: fbset is a utility with which fbcons video modes can be read
11 # config: /etc/sysconfig/fbset
14 # Source function library
15 . /etc/rc.d/init.d/functions
18 if [ -f /etc/sysconfig/fbset ]; then
19 . /etc/sysconfig/fbset
22 # See how we were called.
25 # Check if service is already running?
26 if [ ! -f /var/lock/subsys/fbset ]; then
27 # Check if we have framebuffer in kernel.
28 if [ -f /proc/fb ]; then
29 # /proc files show as files with size=0, this is a workaround.
30 cat /proc/fb | grep -q "." || exit 0
32 # if not, then try to load specified kernel module
33 if [ -n "${FBMODULE}" ]; then
34 _modprobe single $FBMODULE
40 if [ -n "${FBMODE_default}" ]; then
41 show "Setting default video mode"
43 # check if devfs (workaround: -a option don't work at all)
44 if [ -d /dev/vc ]; then
45 for a in `ls /dev/vc/*`; do
46 b=`ls $a | sed 's/\/dev\/vc\///g'`
47 /usr/bin/open -c $b -- /usr/sbin/fbset -fb /dev/fb/0 $FBMODE_default
50 for a in `ls /dev/tty[0-9] && ls /dev/tty[0-9][0-9]`; do
51 b=`ls $a | sed 's/\/dev\/tty//g'`
52 /usr/bin/open -c $b -- /usr/sbin/fbset $FBMODE_default
58 touch /var/lock/subsys/fbset
60 msg_Already_Running "fbset"
65 rm -f /var/lock/subsys/fbset
68 # Check if we have framebuffer in kernel.
69 if [ -f /proc/fb ]; then
70 # /proc files show as files with size=0, this is a workaround.
71 cat /proc/fb | grep -q "." || exit 0
72 echo "Frame buffer present."
80 msg_Usage "$0 {start|stop|status|restart|reload}"