]> git.pld-linux.org Git - packages/fbset.git/blobdiff - fbset.init
- run just before console (running after console caused resetting font)
[packages/fbset.git] / fbset.init
index e951e2aa76284245658361d34cc3acce510eb897..da7cfeda1d0ed49ceba842a8b0d0b30ca52df085 100644 (file)
@@ -4,7 +4,7 @@
 # fbset:       Sets up fbcon video modes.
 #
 #
-# chkconfig:   2345 5 95
+# chkconfig:   2345 69 31
 # description: fbset is a utility with which fbcons video modes can be read
 #              and changed
 #
@@ -19,6 +19,19 @@ if [ -f /etc/sysconfig/fbset ]; then
        . /etc/sysconfig/fbset
 fi
 
+function try_load
+{
+       if [ -n "${FBMODULE}" ]; then
+               _modprobe single $FBMODULE
+       else
+               exit 0
+       fi
+}
+# Setting default depth
+if [ -n "${DEPTH}" ]; then
+       DEPTH_options="-depth ${DEPTH}"
+fi
+
 # See how we were called.
 case "$1" in
   start)
@@ -27,9 +40,10 @@ case "$1" in
                # 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
+                       cat /proc/fb | grep -q "." || try_load
                else
-                       exit 0
+                       # if not, then try to load specified kernel module
+                       try_load
                fi
 
                if [ -n "${FBMODE_default}" ]; then
@@ -39,12 +53,12 @@ case "$1" in
                        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
+                                       /usr/bin/open -c $b -- /usr/sbin/fbset -fb /dev/fb/0 ${DEPTH_options} $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
+                                       /usr/bin/open -c $b -- /usr/sbin/fbset ${DEPTH_options} $FBMODE_default
                                done
                        fi
                        deltext
@@ -52,12 +66,16 @@ case "$1" in
                fi
                touch /var/lock/subsys/fbset
        else
-               msg_Already_Running "fbset"
+               msg_already_running "fbset"
                exit 1
        fi
        ;;
     stop)
-       rm -f /var/lock/subsys/fbset
+       if [ -f /var/lock/subsys/fbset ]; then
+               rm -f /var/lock/subsys/fbset
+       else
+               msg_not_running fbset
+       fi
        ;;
   status)
        # Check if we have framebuffer in kernel.
@@ -71,8 +89,23 @@ case "$1" in
        $0 stop
        $0 start
        ;;
+  restart-all)
+       if [ -f /var/lock/subsys/fbset ]; then
+               if [ -n "${FBMODE_default}" ]; then
+                       show "Setting default video mode"
+                       busy
+                       /usr/sbin/fbset -a ${DEPTH_options} $FBMODE_default
+                       deltext
+                       ok
+               else
+                       echo "No FBMODE_default set"
+               fi
+       else
+               msg_not_running fbset
+       fi
+       ;;
   *)
-       msg_Usage "$0 {start|stop|status|restart|reload}"
+       msg_usage "$0 {start|stop|status|restart|restart-all|reload}"
        exit 1
 esac
 
This page took 0.080886 seconds and 4 git commands to generate.