home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / xresprobe / bitdepth.sh next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2007-03-17  |  1.6 KB  |  48 lines

  1. #!/bin/sh
  2. # usage: bitdepth.sh driver logfile [stdout]
  3. # Copyright (C) 2005 Canonical Ltd.
  4. # Author: Daniel Stone <daniel.stone@ubuntu.com>
  5. #  This program is free software; you can redistribute it and/or modify
  6. #  it under the terms of the GNU General Public License as published by
  7. #  the Free Software Foundation; version 2 of the License.
  8. #
  9. #  This program is distributed in the hope that it will be useful,
  10. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. #  GNU General Public License for more details.
  13. #
  14. #  You should have received a copy of the GNU General Public License with
  15. #  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
  16. #  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  17. #  Suite 330, Boston, MA  02111-1307  USA
  18. #
  19. # On Debian systems, the complete text of the GNU General Public
  20. # License, version 2, can be found in /usr/share/common-licenses/GPL-2.
  21.  
  22. DRIVER="$1"
  23. LOGFILE="$2"
  24. # stdout is, for now, unused
  25. STDOUT="$3"
  26.  
  27. if [ -z "$DRIVER" -o -z "$LOGFILE" ]; then
  28.   echo "Driver name and logfile must be specified on the command line."
  29.   exit 1
  30. fi
  31.  
  32. if [ "$DRIVER" = "i810" ]; then
  33.   if egrep -q "\(EE\) I810\(.*\): No Video BIOS modes for chosen depth." \
  34.            "$LOGFILE"; then
  35.     # broken bios!  word.  if we don't have any 24bpp modes, just hope like
  36.     # hell that 16bpp will work; some vendors ship bioses without 24bpp modes
  37.     # in their vesa mode table.  but sometimes this means we need to go to 32.
  38.     FORCEDEPTH=16
  39.   fi
  40. else
  41.   exit 1
  42. fi
  43.  
  44. if [ -n "$FORCEDEPTH" ]; then
  45.   echo $FORCEDEPTH
  46. fi
  47.