#!/bin/sh # # hdpram Sets up fbcon video modes. # # # chkconfig: 2345 5 95 # description: fbset is a utility with which fbcons video modes can be read\ # and changed # Source function library . /etc/rc.d/init.d/functions # Get service config [ -f /etc/sysconfig/fbset ] && . /etc/sysconfig/fbset # See how we were called. case "$1" in start) # 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 /usr/sbin/fbset -a ${FBMODE_default} deltext ok fi for tty in /dev/tty[0-9]*; do eval FBMODE=\${FBMODE_${tty#/dev/}} if [ -n "${FBMODE}" ]; then # XXX fuser $tty <- sprawdzić, czy tty jest wolna. show "Setting $tty video mode" busy /usr/bin/open -c ${tty#/dev/tty} -- /usr/sbin/fbset ${FBMODE} deltext ok fi done touch /var/lock/subsys/fbset ;; 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