4 # fbset: Sets up fbcon video modes.
7 # chkconfig: 2345 69 31
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
24 if [ -n "${FBMODULE}" ]; then
25 _modprobe single $FBMODULE
30 # Setting default depth
31 if [ -n "${DEPTH}" ]; then
32 DEPTH_options="-depth ${DEPTH}"
35 # See how we were called.
38 # Check if service is already running?
39 if [ ! -f /var/lock/subsys/fbset ]; then
40 # Check if we have framebuffer in kernel.
41 if [ -f /proc/fb ]; then
42 # /proc files show as files with size=0, this is a workaround.
43 cat /proc/fb | grep -q "." || try_load
45 # if not, then try to load specified kernel module
49 if [ -n "${FBMODE_default}" ]; then
50 show "Setting default video mode"
52 # check if devfs (workaround: -a option don't work at all)
53 if [ -d /dev/vc ]; then
54 for a in `ls /dev/vc/*`; do
55 b=`ls $a | sed 's/\/dev\/vc\///g'`
56 /usr/bin/open -c $b -- /usr/sbin/fbset -fb /dev/fb/0 ${DEPTH_options} $FBMODE_default
59 for a in `ls /dev/tty[0-9] && ls /dev/tty[0-9][0-9]`; do
60 b=`ls $a | sed 's/\/dev\/tty//g'`
61 /usr/bin/open -c $b -- /usr/sbin/fbset ${DEPTH_options} $FBMODE_default
67 touch /var/lock/subsys/fbset
69 msg_already_running "fbset"
74 if [ -f /var/lock/subsys/fbset ]; then
75 rm -f /var/lock/subsys/fbset
81 # Check if we have framebuffer in kernel.
82 if [ -f /proc/fb ]; then
83 # /proc files show as files with size=0, this is a workaround.
84 cat /proc/fb | grep -q "." || exit 0
85 echo "Frame buffer present."
93 if [ -f /var/lock/subsys/fbset ]; then
94 if [ -n "${FBMODE_default}" ]; then
95 show "Setting default video mode"
97 /usr/sbin/fbset -a ${DEPTH_options} $FBMODE_default
101 echo "No FBMODE_default set"
104 msg_not_running fbset
108 msg_usage "$0 {start|stop|status|restart|restart-all|reload}"