#!/bin/sh # $Id$ # # fbset: Sets up fbcon video modes. # # # chkconfig: 2345 5 95 # description: fbset is a utility with which fbcons video modes can be read # and changed # # config: /etc/sysconfig/fbset # Source function library . /etc/rc.d/init.d/functions # Get service config if [ -f /etc/sysconfig/fbset ]; then . /etc/sysconfig/fbset fi # See how we were called. case "$1" in start) # Check if service is already running? if [ ! -f /var/lock/subsys/fbset ]; then # Check if we have framebuffer in kernel. if [ -f /proc/fb ]; then # /proc files show as files with size=0, this is a workaround. cat /proc/fb | grep -q "." || exit 0 else exit 0 fi if [ -n "${FBMODE_default}" ]; then show "Setting default video mode" busy # check if devfs (workaround: -a option don't work at all) if [ -d /dev/vc ]; then for a in `ls /dev/vc/*`; do b=`ls $a | sed 's/\/dev\/vc\///g'` /usr/bin/open -c $b -- /usr/sbin/fbset $FBMODE_default done else for a in `ls /dev/tty[0-9] && ls /dev/tty[0-9][0-9]`; do b=`ls $a | sed 's/\/dev\/tty//g'` /usr/bin/open -c $b -- /usr/sbin/fbset $FBMODE_default done fi deltext ok fi touch /var/lock/subsys/fbset else msg_Already_Running "fbset" exit 1 fi ;; stop) rm -f /var/lock/subsys/fbset ;; status) # Check if we have framebuffer in kernel. if [ -f /proc/fb ]; then # /proc files show as files with size=0, this is a workaround. cat /proc/fb | grep -q "." || exit 0 echo "Frame buffer present." fi ;; restart|reload) $0 stop $0 start ;; *) msg_Usage "$0 {start|stop|status|restart|reload}" exit 1 esac exit 0