video_upgrade_wizard-OLD 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. #! /bin/bash
  2. #(c) Copyright Barry Kauler, Oct 2010
  3. #License: gpl v2 (/usr/share/doc/legal/gpl-2.0.txt)
  4. #101024 fix bug with internet connection detection.
  5. #101027 fixed little bugs for nvidia.
  6. #101106 make generic so will work in other woof-built puppies, not just wary.
  7. #101106 added support to install a commercial ATI driver.
  8. #101107 ati driver installation (aticonfig --initial) messes up xorg.conf.
  9. #101112 fix paths to which_ati_pkg, which_nvidia_pkg.
  10. #101114 01micko: backslash was missing.
  11. #101116 call 'download_file' instead of running wget directly.
  12. #101117 fglrx fix.
  13. #101118 insert warning to install DRI pkg before upgrade.
  14. #101129 WRONG for intel upgrade, upgrade pkg has upgraded dri/mesa in it.
  15. #101205 fixes. nobody seems to have got my ati pet to work, remove for now.
  16. #110105 new xorg 7.5 upgrade pet.
  17. #110827 support split nvidia pkgs, nvidia_base and nvidia_kmodule. 110829 bugfix.
  18. export LANG=C
  19. . /etc/DISTRO_SPECS
  20. . /root/.packages/DISTRO_PET_REPOS #101106
  21. #if [ "$DISTRO_COMPAT_VERSION" != "wary5" ];then
  22. # xmessage -bg pink -center "Sorry, this Wizard currently only works in Wary Puppy"
  23. # exit
  24. #fi
  25. #101106 determine where to look for PETs...
  26. PET_DB_FILE="`echo -n "$PACKAGELISTS_PET_ORDER" | cut -f 1 -d ' '`" #exs: Packages-puppy-wary5-official, Packages-puppy-lucid-official, Packages-puppy-5-official
  27. case $DISTRO_COMPAT_VERSION in
  28. wary*)
  29. PET_URL='http://distro.ibiblio.org/pub/linux/distributions/quirky/'
  30. ;;
  31. *)
  32. PET_URL='http://distro.ibiblio.org/pub/linux/distributions/puppylinux/'
  33. ;;
  34. esac
  35. [ "$DISTRO_BINARY_COMPAT" = "t2" ] && PET_URL='http://distro.ibiblio.org/pub/linux/distributions/quirky/'
  36. case $PET_DB_FILE in
  37. Packages-puppy-wary5-official)
  38. PET_FOLDER='pet_packages-wary5/'
  39. ;;
  40. Packages-puppy-lucid-official)
  41. PET_FOLDER='pet_packages-lucid/'
  42. ;;
  43. *)
  44. PET_FOLDER='pet_packages-5/'
  45. ;;
  46. esac
  47. #101107 ati driver installation (aticonfig --initial) messes up xorg.conf... 101117
  48. if [ "`grep '^ #card0driver' /etc/X11/xorg.conf`" != "" ];then
  49. sed -i -e '/#card0driver/d' /etc/X11/xorg.conf
  50. sed -i -e 's%^\tDriver *"fglrx".*%\tDriver "fglrx" #card0driver%' /etc/X11/xorg.conf
  51. #101117 just in case it is still set to radeon driver...
  52. sed -i -e 's%^\tDriver *"radeon".*%\tDriver "radeon" #card0driver%' /etc/X11/xorg.conf
  53. fi
  54. INTERNETCNT=0
  55. if [ "`ifconfig | grep -o '^[pwe][a-z0-9]*'`" != "" ];then #101024
  56. for ONEIF in `ifconfig | grep -o '^[pwe][a-z0-9]*' | tr '\n' ' '`
  57. do
  58. [ -e /sys/class/net/${ONEIF}/statistics/rx_bytes ] && [ `cat /sys/class/net/${ONEIF}/statistics/rx_bytes` -gt 0 ] && INTERNETCNT=1
  59. done
  60. fi
  61. if [ $INTERNETCNT -eq 0 ];then
  62. #OFFMSG="<pixmap><input file>/usr/local/video_upgrade/notconnected.png</input></pixmap>"
  63. #gtkdialog span tag parsing is a bit odd...
  64. OFFMSG="<text use-markup=\"true\"><label>\"<b><big><span color='"'red'"' background='"'yellow'"'>Currently not connected to Internet! Run this Wizard later (see Setup menu), when Internet working</span></big></b>\"</label></text>"
  65. #this also works...
  66. #OFFMSG='<text use-markup="true"><label>"<b><big><span color='"'red'"' background='"'yellow'"'>Currently not connected to Internet! Run this Wizard later (see Setup menu), when Internet working</span></big></b>"</label></text>'
  67. fi
  68. #101118 put up a warning to install DRI pkg first...
  69. #101129 take this out...
  70. #WARNMSG="<text use-markup=\"true\"><label>\"<b><big><span color='"'red'"' background='"'yellow'"'>NOTICE: Install the DRI (mesa) package FIRST, followed by upgrade: we have found DRI pkg gives improved stability</span></big></b>\"</label></text>"
  71. PET_UPGRADE_INTEL="`grep '^xorg_upgrade_intel\-' /root/.packages/${PET_DB_FILE} | cut -f 8 -d '|' | tail -n 1`"
  72. PET_UPGRADE_DEV="`grep '^xorg_upgrade_DEV\-' /root/.packages/${PET_DB_FILE} | cut -f 8 -d '|' | tail -n 1`"
  73. PET_UPGRADE_DRI_EXTRA="`grep '^xorg_upgrade_dri_extra-\-' /root/.packages/${PET_DB_FILE} | cut -f 8 -d '|' | tail -n 1`"
  74. PET_MESA="`grep '^mesa\-[0-9]' /root/.packages/${PET_DB_FILE} | cut -f 8 -d '|' | tail -n 1`"
  75. #101129 find if any already installed...
  76. puiPATTERN='|'"${PET_UPGRADE_INTEL}"'|'
  77. [ "`grep "$puiPATTERN" /root/.packages/user-installed-packages`" != "" ] && FLAG_UPGRADE_INTEL='done'
  78. #101114 01micko: backslash was missing...
  79. echo "#!/bin/sh
  80. PET=\"\$1\" #ex: xorg_upgrade_intel-2.10.0-w5.pet
  81. cd /root
  82. download_file ${PET_URL}${PET_FOLDER}\$PET" > /tmp/petupgradevideo.sh
  83. echo '
  84. if [ $? -ne 0 ];then
  85. xmessage -bg pink -center "Sorry, download failed"
  86. exit 1
  87. fi
  88. petget /root/$PET
  89. rm -f /root/$PET
  90. PKGBASE="`basename $PET .pet`"
  91. if [ ! -f /root/.packages/$PKGBASE.files ];then
  92. xmessage -bg pink -center "Sorry, something went wrong, package downloaded but is not installed"
  93. fi
  94. ' >> /tmp/petupgradevideo.sh
  95. chmod 755 /tmp/petupgradevideo.sh
  96. OFFER_MESA="<frame Mesa DRI><hbox>
  97. <text><label>DRI (Direct Rendering Infrastructure) provides Xorg drivers that will speed up some graphics/video applications that use openGL. This is optional, and will only give a noticeable improvement on a small selection of applications. If you have an Internet connection, click button to download (filesize 12MB):</label></text>
  98. <vbox>
  99. <button><input file>/usr/local/video_upgrade/dri48x29.png</input>
  100. <action>/tmp/petupgradevideo.sh ${PET_MESA} & </action></button>
  101. </vbox>
  102. </hbox></frame>"
  103. VIDEODETAILS="`lspci -nn -m | grep 'VGA compatible controller'`"
  104. #ex: 00:02.0 "VGA compatible controller [0300]" "Intel Corporation [8086]" "Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller [27a2]" -r03 "Acer Incorporated [ALI] [1025]" "Device [0110]"
  105. #ex: 01:00.0 "VGA compatible controller [0300]" "nVidia Corporation [10de]" "G86 [GeForce 8400M GS] [0427]" -ra1 "Acer Incorporated [ALI] [1025]" "Device [011e]"
  106. MANUFACTURER=""
  107. #if currently running a generic driver, offer the upgrade...
  108. if [ "`readlink /usr/bin/X`" == "Xvesa" ];then
  109. CURRENTDRIVER="Xvesa"
  110. else
  111. CURRENTDRIVER="`grep '#card0driver' /etc/X11/xorg.conf | cut -f 2 -d '"'`" #'geany
  112. MANUFACTURER="`cat /etc/X11/xorg.conf | tr '\n' ' ' | tr '\t' ' ' | tr -s ' ' | grep -o '#card0driver .*' | grep -o 'VendorName "[^"]*' | cut -f 2 -d '"'`" #'geany
  113. fi
  114. #if multiple cards, find one most likely to be plugin...
  115. [ "$MANUFACTURER" != "" ] && [ "`echo -n "$VIDEODETAILS" | grep "$MANUFACTURER"`" == "" ] && MANUFACTURER=""
  116. [ "$MANUFACTURER" == "" ] && [ "`echo "$VIDEODETAILS" | grep 'nVidia Corporation'`" != "" ] && MANUFACTURER="nVidia Corporation"
  117. [ "$MANUFACTURER" == "" ] && [ "`echo "$VIDEODETAILS" | grep 'Intel Corporation'`" != "" ] && MANUFACTURER="Intel Corporation"
  118. [ "$MANUFACTURER" == "" ] && MANUFACTURER="`echo -n "$ONECARD" | cut -f 4 -d '"' | rev | cut -f 2-9 -d ' ' | rev`" #'geany
  119. MANUFID="`echo -n "$VIDEODETAILS" | grep "$MANUFACTURER" | cut -f 4 -d '"' | rev | cut -f 2 -d ']' | cut -f 1 -d '[' | rev`" #'geany
  120. DESCRIPTION="`echo -n "$VIDEODETAILS" | grep "$MANUFACTURER" | cut -f 6 -d '"' | rev | cut -f 2-12 -d ' ' | rev | sed -e 's%[^0-9a-zA-Z_ ,/]%%g'`" #'geany
  121. DEVICEID="`echo -n "$VIDEODETAILS" | grep "$MANUFACTURER" | cut -f 6 -d '"' | rev | cut -f 2 -d ']' | cut -f 1 -d '[' | rev`" #'geany
  122. #MANUFACTURER="nVidia Corporation" #TEST
  123. #MANUFID='10DE' #TEST
  124. #DEVICEID='0041' #TEST
  125. HEADERMSG="<text><label>Your computer has an '${MANUFACTURER}' video chip:</label></text>
  126. <text use-markup=\"true\"><label>\"<b>${DESCRIPTION}</b>
  127. PCI chip numbers: ${MANUFID}:${DEVICEID}\"</label></text>"
  128. case "$MANUFACTURER" in
  129. "Intel Corporation") #8086:
  130. case $CURRENTDRIVER in
  131. vesa)
  132. GENERICMSG0="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances.</label></text>"
  133. GENERICMSG="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. If you want snappier performance, you might want to try this upgrade:</label></text>"
  134. ;;
  135. Xvesa)
  136. GENERICMSG0="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. Xvesa also has other limitations as it is not a true Xorg driver, for example the screen refresh frequency is not adjustable and you might notice flicker. You might also find video playing to be restricted.</label></text>"
  137. GENERICMSG="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. Xvesa also has other limitations as it is not a true Xorg driver, for example the screen refresh frequency is not adjustable and you might notice flicker. You might also find video playing to be restricted. If you want snappier performance, you might want to try this upgrade:</label></text>"
  138. ;;
  139. *)
  140. GENERICMSG0="<text><label>X is currently using the '${CURRENTDRIVER}' driver which is the correct driver for this chip. You really don't need to upgrade.</label></text>"
  141. GENERICMSG="<text><label>X is currently using the '${CURRENTDRIVER}' driver which is the correct driver for this chip. You really don't need to upgrade. However, some applications will be snappier if you install the Mesa package:</label></text>
  142. ${OFFER_MESA}
  143. <text use-markup=\"true\"><label>\"<span color='"'red'"' background='"'yellow'"'>It is recommended that you do <b>NOT</b> click any of the buttons below!</span>\"</label></text>"
  144. WARNMSG="" #101118
  145. ;;
  146. esac
  147. WARNMSG="" #101129
  148. INTEL_DEV_MSG=" <frame Developer files><hbox>
  149. <text><label>If you are a developer, or have any need to compile packages, then also download these two packages. The first has the extra files needed for compiling with the upgraded X. Note that this package may enable you to compile other advanced Xorg drivers, other than Intel, that will not work with the original X server and/or require KMS. The second package has DRI drivers for non-Intel hardware. If you are a user and know nothing about compiling, do not download these packages.</label></text>
  150. <vbox>
  151. <button><input file>/usr/local/lib/X11/pixmaps/x24.png</input>
  152. <action>/tmp/petupgradevideo.sh ${PET_UPGRADE_DEV} & </action></button>
  153. <button><input file>/usr/local/lib/X11/pixmaps/x24.png</input>
  154. <action>/tmp/petupgradevideo.sh ${PET_UPGRADE_DRI_EXTRA} & </action></button>
  155. </vbox>
  156. </hbox></frame>" #101205
  157. OFFER_MSG="<frame Upgrade Intel driver>${WARNMSG}<hbox>
  158. <text><label>Clicking this button will download and install Xorg server 1.6.0 and Intel driver 2.10.0. Please note that this is a fairly radical upgrade, that will run the kernel with KMS (Kernel Mode Setting) turned on and upgrades many files. If you have an Internet connection, click button (filesize is 7.5MB):</label></text>
  159. <vbox>
  160. <button><input file>/usr/local/video_upgrade/intel48x32.png</input>
  161. <action>/tmp/petupgradevideo.sh ${PET_UPGRADE_INTEL} & </action></button>
  162. </vbox>
  163. </hbox></frame>
  164. ${INTEL_DEV_MSG}
  165. "
  166. if [ "$FLAG_UPGRADE_INTEL" = "done" ];then #101129
  167. GENERICMSG=""
  168. OFFER_MSG="<text use-markup=\"true\"><label>\"<span color='"'red'"' background='"'yellow'"'>Upgrade package '${PET_UPGRADE_INTEL}' already installed</span>\"</label></text>
  169. ${INTEL_DEV_MSG}"
  170. fi
  171. ;;
  172. "nVidia Corporation") #10DE:
  173. /usr/local/video_upgrade/which_nvidia_pkg $DEVICEID $PET_DB_FILE #writes to /tmp/vuw_nvidia_pkg. 101106 10112
  174. PET_NVIDIA="`cat /tmp/vuw_nvidia_pkg`"
  175. case $CURRENTDRIVER in
  176. vesa)
  177. GENERICMSG0="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances.</label></text>"
  178. GENERICMSG="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. If you want snappier performance, you might want to try this upgrade:</label></text>"
  179. ;;
  180. Xvesa)
  181. GENERICMSG0="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. Xvesa also has other limitations as it is not a true Xorg driver, for example the screen refresh frequency is not adjustable and you might notice flicker. You might also find video playing to be restricted.</label></text>"
  182. GENERICMSG="<text><label>X is currently using '${CURRENTDRIVER}' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. Xvesa also has other limitations as it is not a true Xorg driver, for example the screen refresh frequency is not adjustable and you might notice flicker. You might also find video playing to be restricted. If you want snappier performance, you might want to try this upgrade:</label></text>"
  183. ;;
  184. nv)
  185. GENERICMSG0="<text><label>X is currently using the 'nv' driver, which is the correct driver for this video hardware. This driver is satisfactory.</label></text>"
  186. GENERICMSG="<text><label>X is currently using the 'nv' driver, which is the correct driver for this video hardware. This driver is satisfactory. However, some applications will be snappier if you install the Mesa package:</label></text>
  187. ${OFFER_MESA}
  188. <text use-markup=\"true\"><label>\"Alternatively: the 'nv' driver may be noticeably slow with some graphics/video applications, and if you want faster rendering and more control over the display settings, you might want to <b>try the commercial nVidia driver</b>:\"</label></text>"
  189. ;;
  190. nvidia)
  191. GENERICMSG0="<text use-markup=\"true\"><label>\"<b>Currently using the 'nvidia' driver, so you have already upgraded!</b>\"</label></text>"
  192. GENERICMSG="<text use-markup=\"true\"><label>\"<b>Currently using the 'nvidia' driver, so you have already upgraded!</b>\"</label></text>"
  193. ;;
  194. esac
  195. if [ "$PET_NVIDIA" == "" ];then
  196. OFFER_MSG="<frame Commercial nVidia driver><text use-markup=\"true\"><label>\"<b>Sorry, do not have a PET package that supports your video chip. Suggest that you go to the nVidia website and download a driver (look in Puppy Forum for other users experiences with doing this)</b>\"</label></text></frame>"
  197. else
  198. if [ "`echo "$PET_NVIDIA" | grep 'nvidia_kmodule'`" != "" ];then #110827
  199. NVIDIA_BASE="`echo "$PET_NVIDIA" | grep '^nvidia_base' | tail -n 1`"
  200. NVIDIA_KMODULE="`echo "$PET_NVIDIA" | grep '^nvidia_kmodule' | tail -n 1`"
  201. if [ "`grep "$NVIDIA_BASE" /root/.packages/user-installed-packages`" = "" ];then
  202. PETSIZE=`grep "$NVIDIA_BASE" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 2-9 | rev`
  203. PETSIZE2=`expr $PETSIZE \/ 3`
  204. SIZEUNIT="`grep "$NVIDIA_BASE" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 1`"
  205. UNITS="KB"
  206. [ "$SIZEUNIT" = "M" ] && UNITS="MB"
  207. OFFER_MSG_BASE="<hbox>
  208. <text><label>Clicking this button will download and install '${NVIDIA_BASE}'. This is a closed-source commercial product, provided by nVidia Corporation. It gives maximum performance and also has a GUI to finetune the settings. (when installed will occupy ${PETSIZE}${UNITS}, the PET package to download is approx. ${PETSIZE2}${UNITS}):</label></text>
  209. <vbox>
  210. <button><input file>/usr/local/video_upgrade/nvidia48x32.png</input>
  211. <action>/tmp/petupgradevideo.sh ${NVIDIA_BASE} & </action></button>
  212. </vbox>
  213. </hbox>
  214. <text><label>You must ALSO install the following package, please install both immediately, one after the other:</label></text>"
  215. else
  216. OFFER_MSG_BASE="<text><label>The 'nvidia_base' package has already been installed, so all that you need to do now is install the 'nvidia_kmodule' kernel driver. You should reboot afterward to activate it:</label></text>"
  217. fi
  218. PETSIZE=`grep "$NVIDIA_KMODULE" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 2-9 | rev`
  219. PETSIZE2=`expr $PETSIZE \/ 3`
  220. SIZEUNIT="`grep "$NVIDIA_KMODULE" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 1`"
  221. UNITS="KB"
  222. [ "$SIZEUNIT" = "M" ] && UNITS="MB"
  223. OFFER_MSG="<frame Commercial nVidia driver>${WARNMSG}
  224. ${OFFER_MSG_BASE}
  225. <hbox>
  226. <text><label>Clicking this button will download and install '${NVIDIA_KMODULE}'. This package has the kernel driver module. (when installed will occupy ${PETSIZE}${UNITS}, the PET package to download is approx. ${PETSIZE2}${UNITS}):</label></text>
  227. <vbox>
  228. <button><input file>/usr/local/video_upgrade/nvidia48x32.png</input>
  229. <action>/tmp/petupgradevideo.sh ${NVIDIA_KMODULE} & </action></button>
  230. </vbox>
  231. </hbox></frame>"
  232. else #single pkg, as before...
  233. PET_NVIDIA="`echo "$PET_NVIDIA" | grep -v -E 'nvidia_base|nvidia_kmodule' | tail -n 1`"
  234. PETSIZE=`grep "$PET_NVIDIA" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 2-9 | rev`
  235. PETSIZE2=`expr $PETSIZE \/ 3`
  236. SIZEUNIT="`grep "$PET_NVIDIA" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 1`"
  237. UNITS="KB"
  238. [ "$SIZEUNIT" = "M" ] && UNITS="MB"
  239. OFFER_MSG="<frame Commercial nVidia driver>${WARNMSG}<hbox>
  240. <text><label>Clicking this button will download and install '${PET_NVIDIA}'. This is a closed-source commercial product, provided by nVidia Corporation. It gives maximum performance and also has a GUI to finetune the settings. (when installed will occupy ${PETSIZE}${UNITS}, the PET package to download is approx. ${PETSIZE2}${UNITS}):</label></text>
  241. <vbox>
  242. <button><input file>/usr/local/video_upgrade/nvidia48x32.png</input>
  243. <action>/tmp/petupgradevideo.sh ${PET_NVIDIA} & </action></button>
  244. </vbox>
  245. </hbox></frame>"
  246. fi
  247. fi
  248. ;;
  249. "ATI Technologies Inc") #1002:
  250. /usr/local/video_upgrade/which_ati_pkg $DEVICEID $PET_DB_FILE #writes to /tmp/vuw_ati_pkg. 101106 101112
  251. PET_ATI="`cat /tmp/vuw_ati_pkg`"
  252. case $CURRENTDRIVER in
  253. vesa)
  254. GENERICMSG0="<text><label>X is currently using 'vesa' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances.</label></text>"
  255. GENERICMSG="<text><label>X is currently using 'vesa' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. If you want snappier performance, you might want to try this upgrade:</label></text>"
  256. ;;
  257. Xvesa)
  258. GENERICMSG0="<text><label>X is currently using 'Xvesa' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. Xvesa also has other limitations as it is not a true Xorg driver, for example the screen refresh frequency is not adjustable and you might notice flicker. You might also find video playing to be restricted.</label></text>"
  259. GENERICMSG="<text><label>X is currently using 'Xvesa' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. Xvesa also has other limitations as it is not a true Xorg driver, for example the screen refresh frequency is not adjustable and you might notice flicker. You might also find video playing to be restricted. If you want snappier performance, you might want to try this upgrade:</label></text>"
  260. ;;
  261. *)
  262. GENERICMSG0="<text><label>X is currently using the '${CURRENTDRIVER}' driver, which is the correct driver for this video hardware. This driver is satisfactory.</label></text>"
  263. GENERICMSG="<text><label>X is currently using the '${CURRENTDRIVER}' driver, which is the correct driver for this video hardware. This driver is satisfactory. However, some applications will be snappier if you install the Mesa package:</label></text>
  264. ${OFFER_MESA}
  265. <text use-markup=\"true\"><label>\"<b>Alternatively:</b> the '${CURRENTDRIVER}' driver is fine, but for even faster graphics/video rendering and more control over the display settings, you might want to <b>try the commercial ATI driver</b>:\"</label></text>"
  266. ;;
  267. esac
  268. #101205 nobody seems to have got my ati pet to work, remove for now...
  269. #if [ "$PET_ATI" == "" ];then #101106
  270. OFFER_MSG="<frame Commercial ATI driver><pixmap><input file>/usr/local/video_upgrade/ati48x32.png</input></pixmap><text use-markup=\"true\"><label>\"<b>Sorry, do (yet) not have a PET package that supports your video chip. Suggest that you go to the ATI website and download a driver (look in Puppy Forum for other users experiences with doing this)</b>\"</label></text></frame>"
  271. #else
  272. # PETSIZE=`grep "$PET_ATI" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 2-9 | rev`
  273. # PETSIZE2=`expr $PETSIZE \/ 3`
  274. # SIZEUNIT="`grep "$PET_ATI" /root/.packages/${PET_DB_FILE} | head -n 1 | cut -f 6 -d '|' | rev | cut -c 1`"
  275. # UNITS="KB"
  276. # [ "$SIZEUNIT" = "M" ] && UNITS="MB"
  277. # OFFER_MSG="<frame Commercial ATI driver>${WARNMSG}<hbox>
  278. # <text><label>Clicking this button will download and install '${PET_ATI}'. This is a closed-source commercial product, provided by ATI Corporation. It gives maximum performance and also has a GUI to finetune the settings. (when installed will occupy ${PETSIZE}${UNITS}, the PET package to download is approx. ${PETSIZE2}${UNITS}):</label></text>
  279. # <vbox>
  280. # <button><input file>/usr/local/video_upgrade/ati48x32.png</input>
  281. # <action>/tmp/petupgradevideo.sh ${PET_ATI} & </action></button>
  282. # </vbox>
  283. # </hbox></frame>"
  284. #fi
  285. ;;
  286. *)
  287. case $CURRENTDRIVER in
  288. vesa)
  289. GENERICMSG="<text><label>X is currently using 'vesa' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances, however Wary does not have a hardware-specific driver for your video chip.</label></text>"
  290. GENERICMSG0="$GENERICMSG"
  291. ;;
  292. Xvesa)
  293. GENERICMSG="<text><label>X is currently using 'Xvesa' which is a generic unaccelerated driver. This driver is slow and you may notice the sluggishness under certain circumstances. Xvesa also has other limitations as it is not a true Xorg driver, for example the screen refresh frequency is not adjustable and you might notice flicker. You might also find video playing to be restricted. If possible, you should use the 'vesa' Xorg driver, that is another generic driver but is a true Xorg driver and is in msome ways superior. Sorry, but Wary does not have a hardware-specific Xorg driver for your video chip.</label></text>"
  294. GENERICMSG0="$GENERICMSG"
  295. ;;
  296. *)
  297. GENERICMSG0="<text><label>X is currently using the '${CURRENTDRIVER}' driver which is the correct driver for this chip. So, you have nothing more to do.</label></text>"
  298. GENERICMSG="<text><label>X is currently using the '${CURRENTDRIVER}' driver which is the correct driver for this chip. So, you have nothing more to do, however, some applications will be snappier if you install the Mesa package:</label></text>
  299. ${OFFER_MESA}"
  300. ;;
  301. esac
  302. ;;
  303. esac
  304. # <hbox>
  305. # <vbox>
  306. # <button><input file>/usr/local/video_upgrade/nvidia48x32.png</input></button>
  307. # </vbox>
  308. # </hbox>
  309. # <hbox>
  310. # <vbox>
  311. # <button><input file>/usr/local/video_upgrade/ati48x32.png</input></button>
  312. # </vbox>
  313. # </hbox>
  314. export VIDEOUPGRADE_DLG="<window title=\"Video Driver Upgrade Wizard\" icon-name=\"gtk-select-color\">
  315. <vbox>
  316. ${OFFMSG}
  317. ${HEADERMSG}
  318. ${GENERICMSG}
  319. ${OFFER_MSG}
  320. <hbox>
  321. <button><input file>/usr/local/lib/X11/mini-icons/mini.exit.xpm</input><action type=\"exit\">EXIT</action></button>
  322. </hbox>
  323. </vbox>
  324. </window>
  325. "
  326. UPFLAG="`cat /root/.packages/woof-installed-packages /root/.packages/user-installed-packages | grep '^zzx_upgrade_73_'`"
  327. ALTMSG=""
  328. if [ "$UPFLAG" = "" ];then
  329. ALTMSG="<text><label>There is currently a choice of two different upgrade paths:</label></text>
  330. <frame Mesa/nVidia/ATI/Intel>
  331. <hbox>
  332. <text><label>This offers various upgrades depending on your current hardware. Probably best choice, see what is offered, if you don't like it then you can come back here go for the next option. Note, even if you have the correct driver for your hardware, the Mesa upgrade can improve performance, so do check this out:</label></text>
  333. <vbox>
  334. <button><input file>/usr/local/lib/X11/pixmaps/x24.png</input><action type=\"exit\">CHOICE1</action></button>
  335. </vbox>
  336. </hbox>
  337. </frame>
  338. <frame Xorg 7.5>
  339. <hbox>
  340. <text><label>Xorg is version 7.3. This option performs a major upgrade to Xorg 7.5. Even if you already have the correct driver for your hardware, this upgrade may improve behaviour (or may not). This option also includes Mesa for faster performance. If you are currently only able to use 'vesa' or 'Xvesa', this upgrade may find a correct hardware driver.</label></text>
  341. <vbox>
  342. <button><input file>/usr/local/lib/X11/pixmaps/x24.png</input><action type=\"exit\">CHOICE2</action></button>
  343. </vbox>
  344. </hbox>
  345. </frame>
  346. "
  347. fi
  348. #110105
  349. export ALTUPGRADE_DLG="<window title=\"Video Driver Upgrade Wizard\" icon-name=\"gtk-select-color\">
  350. <vbox>
  351. ${OFFMSG}
  352. ${HEADERMSG}
  353. ${GENERICMSG0}
  354. ${ALTMSG}
  355. <hbox>
  356. <button><input file>/usr/local/lib/X11/mini-icons/mini.exit.xpm</input><action type=\"exit\">EXIT</action></button>
  357. </hbox>
  358. </vbox>
  359. </window>
  360. "
  361. RETVALS="`gtkdialog3 --program=ALTUPGRADE_DLG`"
  362. eval "$RETVALS"
  363. case $EXIT in
  364. CHOICE1)
  365. gtkdialog3 --program=VIDEOUPGRADE_DLG
  366. ;;
  367. CHOICE2)
  368. PET_UPGRADE_XORG75="`grep '^zxx_upgrade_73_to_75_nokms\-' /root/.packages/${PET_DB_FILE} | cut -f 8 -d '|' | tail -n 1`"
  369. PET_UPGRADE_XORG75_DEV="`grep '^zxx_upgrade_73_to_75_nokms_DEV\-' /root/.packages/${PET_DB_FILE} | cut -f 8 -d '|' | tail -n 1`"
  370. export CHOICE2_DLG="<window title=\"Video Driver Upgrade Wizard\" icon-name=\"gtk-select-color\">
  371. <vbox>
  372. <hbox>
  373. <text><label>Click this button to download and install the upgrade to Xorg 7.5. The package is a bit big as it contains the complete mesa 7.6 package. The xorg-server is 1.7.5. Note that the most recent drivers are chosen that work without KMS (Kernel Mode Setting). (19MB):</label></text>
  374. <vbox>
  375. <button><input file>/usr/local/lib/X11/pixmaps/x24.png</input>
  376. <action>/tmp/petupgradevideo.sh ${PET_UPGRADE_XORG75} & </action>
  377. </button>
  378. </vbox>
  379. </hbox>
  380. <hbox>
  381. <text><label>FOR DEVELOPERS: If you want to compile source packages, you will need this package in addition to the above (4.2MB):</label></text>
  382. <vbox>
  383. <button><input file>/usr/local/lib/X11/pixmaps/x24.png</input>
  384. <action>/tmp/petupgradevideo.sh ${PET_UPGRADE_XORG75_DEV} & </action>
  385. </button>
  386. </vbox>
  387. </hbox>
  388. <hbox>
  389. <button><input file>/usr/local/lib/X11/mini-icons/mini.exit.xpm</input><action type=\"exit\">EXIT</action></button>
  390. </hbox>
  391. </vbox>
  392. </window>
  393. "
  394. gtkdialog3 --program=CHOICE2_DLG
  395. ;;
  396. esac
  397. ###END###