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
13 # Source function library
14 . /etc/rc.d/init.d/functions
17 if [ -f /etc/sysconfig/fbset ]; then
18 . /etc/sysconfig/fbset
23 if [ -n "${FBMODULE}" ]; then
24 _modprobe single $FBMODULE
30 # Setting default depth
31 if [ -n "${DEPTH}" ]; then
32 DEPTH_options="-depth ${DEPTH}"
35 if [ -z "${FBDEV_NUM}" ]; then
40 # Check if service is already running?
41 if [ ! -f /var/lock/subsys/fbset ]; then
43 # Check if we have framebuffer in kernel.
44 if [ -f /proc/fb ]; then
45 # /proc files show as files with size=0, this is a workaround.
46 cat /proc/fb | grep -q "." || try_load
48 # if not, then try to load specified kernel module
52 if [ -n "${FBMODE_default}" ]; then
53 show "Setting default video mode"
56 # check if devfs (workaround: -a option don't work at all)
57 if [ -d /dev/vc ]; then
58 if [ -z "$FBTERMINALS" ]; then
59 FBTERMINALS=$(ls /dev/vc/)
61 FBDEV=/dev/fb/${FBDEV_NUM}
64 if [ -z "$FBTERMINALS" ]; then
65 FBTERMINALS=$(awk -F: '/^[0-9]*:/{print $1}' /etc/inittab)
67 FBDEV=/dev/fb${FBDEV_NUM}
75 for cons in $FBTERMINALS; do
76 /usr/bin/con2fb $FBDEV $cons
77 /usr/bin/switchto $cons
79 $FBDEV ${DEPTH_options} $FBMODE_default \
80 0<>/dev/tty$cons >&0 2>&0
82 [ $tty = "/dev/console" ] && tty=1
83 /usr/bin/switchto $tty
86 touch /var/lock/subsys/fbset
88 msg_already_running fbset
93 if [ -f /var/lock/subsys/fbset ]; then
94 rm -f /var/lock/subsys/fbset
100 # See how we were called.
109 # Check if we have framebuffer in kernel.
110 if [ -f /proc/fb ]; then
111 # /proc files show as files with size=0, this is a workaround.
112 cat /proc/fb | grep -q "." && nls "Frame buffer present." && exit 0
113 nls "Frame buffer not present."
116 nls "Frame buffer not present."
120 restart|force-reload)
125 msg_usage "$0 {start|stop|restart|force-reload|status}"