#! /bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin PROG=/usr/sbin/915resolution VBETOOL=/usr/sbin/vbetool NAME=915resolution DESC=915resolution CONFIG=/etc/default/915resolution test -x $DAEMON || exit 0 # Include 915resolution defaults if available if [ -f "$CONFIG" ] ; then . "$CONFIG" fi if [ "$MODE" = auto -a \! -x "$VBETOOL" ] \ || [ "$MODE" != auto -a \( -z "$MODE" -o -z "$XRESO" -o -z "$YRESO" \) ] ; then echo "*** Your 915resolution hasn't been configured! ***" echo "Please read /usr/share/doc/915resolution/README.Debian and define" echo "MODE, XRESO, and YRESO or install the 'vbetool' package." exit 0 fi auto_select_modes() { if [ ! -x "$VBETOOL" ] || ! panelsize=`$VBETOOL vbefp panelsize` ; then echo "*** Your 915resolution was not automatically configured! ***" echo "Please read /usr/share/doc/915resolution/README.Debian then define" echo "MODE, XRESO, and YRESO manually in $CONFIG or install 'vbetool'." exit 1 fi # If the native panel-size is already in the BIOS mode list, we # don't have to do anything, yippee! bios_list=`$PROG -l` if echo "$bios_list" | grep -q "^Mode .* $panelsize" ; then #echo 'Correct panel-size is already listed, skipping' return fi # For want of a better approach to selecting modelines for stealing;... # this expression grabs us the highest *numbered* mode in each # bit-depth that the BIOS already lists. # # An argument for using the highest mode-number, rather than the # highest resolution is that if we've already reprogrammed the # mode to be a lower resolution it will no longer be the highest. # If this has changed over a suspend cycle, that consequences # might not be so good. -Paul Sladen target_modes=`echo "$bios_list" | awk '/^Mode [^T]/{sub(",","",$4); print $5,$4,$2}' | tac | sort -n -u | cut -d' ' -f3` for m in $target_modes ; do # The 'tr' converts '1024x768' -> '1024' '768' # and the bitdepth is missed off because we have one of each depth $PROG $m $(echo $panelsize | tr x ' ') done } set -e case "$1" in start|restart|force-reload) echo -n "Starting $DESC: " if [ "$MODE" = "auto" ] ; then auto_select_modes else $PROG $MODE $XRESO $YRESO $BIT fi ## Added by Sekar $PROG 58 1920 1200 ## End addition by Sekar echo "$NAME." ;; stop) #echo -n "Stopping $DESC: " #echo "$NAME." ;; # Move this to 'start' so there is only one code-path # restart|force-reload) # #echo -n "Stopping $DESC: " # #echo "$NAME." # echo -n "Starting $DESC: " # $PROG $MODE $XRESO $YRESO $BIT # echo "$NAME." # ;; *) N=/etc/init.d/$NAME # echo "Usage: $N start" >&2 echo "Usage: $N start" >&2 exit 1 ;; esac exit 0