Merge lp:~sylvain-pineau/checkbox/graphics-test-changes into lp:checkbox

Proposed by Sylvain Pineau
Status: Merged
Merged at revision: 1206
Proposed branch: lp:~sylvain-pineau/checkbox/graphics-test-changes
Merge into: lp:checkbox
Diff against target: 1066 lines (+16/-1012)
4 files modified
data/whitelists/default.whitelist (+1/-1)
jobs/graphics.txt.in (+15/-16)
scripts/compiz-check (+0/-968)
scripts/run_compiz_check (+0/-27)
To merge this branch: bzr merge lp:~sylvain-pineau/checkbox/graphics-test-changes
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Sylvain Pineau (community) Needs Resubmitting
Review via email: mp+90324@code.launchpad.net

Description of the change

Replace compiz-check script by a call to unity_support_test
Add a test to check is the hardware is able to run Unity 3D
Replace xrandr_detect_modes test by a shell job that checks if VESA drivers are in use

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Great, love simplification and this is as discussed in the Fix Papercuts document.

Two questions/comments:

1- is nux-tools included in the default CD/install?

2- I think the intent was to replace graphics/xrandr_detect_modes rather than graphics/cycle_resolution. The reason is that the cycle_resolution test allows the tester to visually check that all resolutions work correctly, which has in the past enabled us to catch some interesting bugs (see for instance https://bugs.launchpad.net/ubuntu/+source/linux/+bug/753994). If the cycle_resolution test is removed we won't catch stuff like this. However, graphics/xrandr_detect-modes just shows the list of modes to the user and asks if it's OK (to which everybody almost invariably replies "yes", so the test is kinda useless that way), and thus is the one I thought could be replaced by a simple check of the vesa driver. Could you check this please?

Thanks again!

review: Needs Information
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Yes, nux-tools is included in the CD (I always check that now !)
I'm going to replace just graphics/xrandr_detect-modes and keep the cycle one.

Thanks for your review

1203. By Sylvain Pineau

Restore graphics/cycle_resolution test but remove the useless detect_modes, replaced now by a simple check of vesa drivers

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

branch updated to reflect Daniel's recommendation

review: Needs Resubmitting
Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks!

I merged this and tried to test, I found two issues:

1- Need to update the whitelists in data/whitelists/ to replace xrandr_detect_modes with the new VESA_drivers_not_in_use.

2- I ran this on my system (Intel GPU) and it failed, because even though it's not used, vesa_drv.so is still marked as loaded in Xorg.0.log (if it helps, here's my log: http://paste.ubuntu.com/819025/). So maybe checking for the vesa driver being actually in use needs something else?

Thanks for looking into this!

review: Needs Fixing
1204. By Sylvain Pineau

Look for "Unloading vesa driver" if previously loaded to avoif false positive

1205. By Sylvain Pineau

update default.whitelist to replace xrandr_detect_modes with the new VESA_drivers_not_in_use

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

I've changed the oneliner to check if the driver is unloaded before returning an error.
The default.whitelist has been updated to match the new test case.

Thanks for your log file !

review: Needs Resubmitting
Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks!

I updated the debian/changelog file as well, and this seems to be working OK now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/whitelists/default.whitelist'
2--- data/whitelists/default.whitelist 2012-01-23 18:02:28 +0000
3+++ data/whitelists/default.whitelist 2012-01-30 09:11:23 +0000
4@@ -45,7 +45,7 @@
5 graphics/display
6 graphics/resolution
7 graphics/minimum_resolution
8-graphics/xrandr_detect_modes
9+graphics/VESA_drivers_not_in_use
10 __info__
11 codecs_attachment
12 cpuinfo_attachment
13
14=== modified file 'jobs/graphics.txt.in'
15--- jobs/graphics.txt.in 2011-11-24 11:46:23 +0000
16+++ jobs/graphics.txt.in 2012-01-30 09:11:23 +0000
17@@ -100,19 +100,10 @@
18 VERIFICATION:
19 Do you see color bars and static?
20
21-plugin: manual
22-name: graphics/xrandr_detect_modes
23-requires: package.name == 'xorg'
24-command: xrandr
25-_description:
26- PURPOSE:
27- This test checks the detected video modes
28- STEPS:
29- 1. The following screens and video modes have been detected on your system
30- INFO:
31- $output
32- VERIFICATION:
33- Are those correct?
34+plugin: shell
35+name: graphics/VESA_drivers_not_in_use
36+command: cat /var/log/Xorg.0.log | perl -e '$a=0;while(<>){$a++ if /Loading.*vesa_drv\.so/;$a-- if /Unloading.*vesa/&&$a}exit 1 if $a'
37+_description: Check that VESA drivers are not in use
38
39 plugin: manual
40 name: graphics/cycle_resolution
41@@ -129,9 +120,17 @@
42
43 plugin: shell
44 name: graphics/compiz_check
45-command: run_compiz_check | ansi_parser
46-_description:
47- Check that the hardware is able to run compiz.
48+requires: package.name == 'nux-tools'
49+command:
50+ perl -e '$a=`/usr/lib/nux/unity_support_test -c -p`;$a=~s/\e\[[\d;]*m//g;print $a;exit($? ? 1:0)'
51+_description: Check that hardware is able to run compiz
52+
53+plugin: shell
54+name: graphics/unity-support
55+requires: package.name == 'nux-tools'
56+command:
57+ perl -e '$a=`/usr/lib/nux/unity_support_test -p`;$a=~s/\e\[[\d;]*m//g;print $a;exit($? ? 1:0)'
58+_description: Check that hardware is able to run Unity 3D
59
60 plugin: manual
61 name: graphics/glxgears
62
63=== removed file 'scripts/compiz-check'
64--- scripts/compiz-check 2009-08-26 22:02:21 +0000
65+++ scripts/compiz-check 1970-01-01 00:00:00 +0000
66@@ -1,968 +0,0 @@
67-#!/bin/bash
68-# Compiz-Check -- script to test if your system is able to run Compiz
69-#
70-# Copyright (c) 2008 Nick Bauermeister <Forlong@gmx.de>
71-#
72-# This program is free software. Feel free to redistribute and/or
73-# modify it under the terms of the GNU General Public License v3
74-# as published by the Free Software Foundation.
75-#
76-# This program is distributed in the hope that it will be useful
77-# but comes WITHOUT ANY WARRANTY; without even the implied warranty
78-# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
79-# See the GNU General Public License for more details.
80-
81-VERSION="0.4.5-4"
82-
83-usage()
84-{
85- printf "\nAbout:\n"
86- printf "%6s Compiz-Check will check if your system satisfies all requirements to\n"
87- printf "%6s run Compiz properly.\n"
88- printf "%6s It will also help you trace back the problem(s) you may be facing.\n\n"
89- printf "%6s Visit\033[1m http://forlong.blogage.de/article/pages/Compiz-Check \033[0m\n"
90- printf "%6s for further information.\n\n"
91- printf "Usage:\n"
92- printf "%6s Run this script without any arguments.\n\n"
93- printf "Available arguments:\n"
94- printf " -h or --help %8s List available arguments and usage (this message).\n"
95- printf " -v or --version %5s Print version of Compiz-Check in use.\n\n"
96-}
97-
98-banana()
99-{
100- printf "//\\ \nV%2s\\ \n \\%2s\\ \n%2s\\ \033[1;33m.\`-.\n%3s|\\ \`. \`.\n%3s( \\%2s\`. \`-.%24s_,.-:\\ \n%4s\\ \\%3s\`.%2s\`-._%13s__..--' ,-';/\n%5s\\ \`.%3s\`-.%3s\`-..___..---'%3s_.--' ,'/\n%6s\`. \`.%4s\`-._%8s__..--'%4s,' /\n%8s\`. \`-_%4s \`\`--..''%6s _.-' ,'\n%10s\`-_ \`-.___%8s__,--'%3s,'\n%13s\`-.__%2s\`----'''%4s__.-'\n%18s\`--..____..--'\033[0m\n\n"
101-}
102-
103-if [ $# != 0 ]; then
104- case $1 in
105- -h | --help)
106- usage
107- exit 0
108- ;;
109- -v | --version)
110- echo $VERSION
111- exit 0
112- ;;
113- --banana)
114- banana
115- exit 0
116- ;;
117- *)
118- printf "Error, unknown option: \"$1\"\nRun \033[1m$0 --help\033[0m for details.\n"
119- exit 1
120- ;;
121- esac
122-fi
123-
124-# Exit when running as root
125-if [ "$(whoami)" = root ]; then
126- printf "\n Do not run this script as root, because it might distort its outcome.\n Aborting.\n\n"
127- exit 1
128-fi
129-
130-# Needed for lspci, because it's not in the $PATH of every distro
131-export PATH=$PATH:/sbin:/usr/sbin
132-
133-# Can't handle more than one graphics card or X server at a time
134-if [ $(lspci | grep VGA -c) -gt 1 ]; then
135- ERROR_DEVICE="graphics chip"
136-elif [ $(xdpyinfo | grep -i dimensions: -c) -gt 1 ]; then
137- ERROR_DEVICE="running X server"
138-fi
139-
140-if [ ! -z "$ERROR_DEVICE" ]; then
141- printf "\n More than one $ERROR_DEVICE detected -- sorry, the script can not handle that.\n Aborting.\n\n"
142- exit 1
143-fi
144-
145-# Skip system checks if they are harmful or useless
146-SKIP=yes
147-
148-# Coloured output (there are other emphases hardcoded in the script, so
149-# it would be pretty useless changing those here)
150-UNKNOWN="\033[1;31mUnknown\033[0m"
151-OK=" \033[1;32mOK\033[0m "
152-FAIL="\033[1;31mFAIL\033[0m"
153-SKIPPING="\033[33mSKIP\033[0m"
154-WARN="\033[33mWARN\033[0m"
155-
156-# General distribution info file
157-DIST_INFO="/etc/lsb-release"
158-
159-# Detect distribution
160-# If your distro is not on this list, contact me.
161-detect_distro()
162-{
163- if [ -d /etc/linuxmint ]; then
164- DISTRIB_ID="Linux Mint"
165- return 0
166- elif [ -r $DIST_INFO ]; then
167- . $DIST_INFO
168- fi
169-
170- if [ -z $DISTRIB_ID ]; then
171- unset DISTRIB_RELEASE
172- if [ -f /etc/arch-release ]; then
173- DISTRIB_ID="Arch Linux"
174- elif [ -r /etc/knoppix-version ]; then
175- DISTRIB_ID="Knoppix"
176- DISTRIB_RELEASE="($(cat /etc/knoppix_version))"
177- elif [ -r /etc/sidux-version ]; then
178- DISTRIB_ID="Sidux"
179- DISTRIB_RELEASE="($(cat /etc/sidux-version | awk '{print $4}'))"
180- elif [ -r /etc/debian_version ]; then
181- DISTRIB_ID="Debian GNU/Linux"
182- DISTRIB_RELEASE="($(cat /etc/debian_version))"
183- elif [ -r /etc/fedora-release ]; then
184- DISTRIB_ID="$(cat /etc/redhat-release)"
185- elif [ -r /etc/gentoo-release ]; then
186- DISTRIB_ID="Gentoo"
187- DISTRIB_RELEASE="($(cat /etc/gentoo-release | awk '{print $5}'))"
188- elif [ -f /etc/lfs-version ]; then
189- DISTRIB_ID="Linux from scratch"
190- elif [ -r /etc/pclinuxos-release ]; then
191- DISTRIB_ID="PCLinuxOS"
192- elif [ -f /etc/mandriva-release ] || [ -f /etc/mandrake-release ]; then
193- DISTRIB_ID="Mandriva"
194- elif [ -f /etc/redhat-release ]; then
195- DISTRIB_ID="RedHat"
196- elif [ -r /etc/vector-version ]; then
197- DISTRIB_ID="VectorLinux"
198- DISTRIB_RELEASE="($(cat /etc/vector-version))"
199- elif [ -r /etc/slackware-version ]; then
200- DISTRIB_ID="$(cat /etc/slackware-version)"
201- elif [ -f /etc/release ]; then
202- DISTRIB_ID="Solaris"
203- elif [ -r /etc/SuSE-release ]; then
204- DISTRIB_ID="$(grep -i suse /etc/SuSE-release)"
205- elif [ -f /etc/yellowdog-release ]; then
206- DISTRIB_ID="YellowDog Linux"
207- elif [ -f /etc/zenwalk-version ]; then
208- DISTRIB_ID="Zenwalk"
209- else
210- DISTRIB_ID="Unknown"
211- fi
212- fi
213-}
214-
215-# Detect desktop environment in use
216-detect_de()
217-{
218- if [ ! -z $GNOME_DESKTOP_SESSION_ID ]; then
219- DE=GNOME
220- elif [ "$KDE_SESSION_VERSION" = 4 ]; then
221- DE=KDE4
222- elif [ "$KDE_FULL_SESSION" = true ]; then
223- DE=KDE
224- elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1 ; then
225- DE=Xfce
226- else
227- DE=Unknown
228- fi
229-}
230-
231-# Detect graphics card
232-detect_video()
233-{
234- if lspci | grep -q VGA ; then
235- VIDEO=$(lspci | grep VGA | sed 's/.*: //')
236- else
237- VIDEO=$UNKNOWN # TODO abort?
238- fi
239-}
240-
241-XSET=$(command -v xset)
242-
243-# Detect location of the Xorg log file
244-if [ ! -z $XSET ]; then
245- XORG_LOG=$($XSET q | grep "Log file" | awk '{print $3}')
246-fi
247-
248-# Fallback Xorg log
249-if [ -z $XORG_LOG ]; then
250- if [ -f /var/log/Xorg.0.log ]; then
251- XORG_LOG=/var/log/Xorg.0.log
252- fi
253-fi
254-
255-# advise to look for proprietary drivers in Ubuntu
256-detect_driver_manager()
257-{
258- if [ $(echo "$DISTRIB_RELEASE" | sed 's/\.//g') -gt 710 ] && [ $DE = GNOME ] || [ $DE = Xfce ]; then
259- DRVS_MNGR=hardy-gtk
260- elif [ $(echo "$DISTRIB_RELEASE" | sed 's/\.//g') -gt 710 ] && [ $DE = KDE ]; then
261- DRVS_MNGR=hardy-kde
262- elif [ "$DISTRIB_RELEASE" = "7.10" ] && [ $DE = GNOME ] || [ $DE = Xfce ]; then
263- DRVS_MNGR=gutsy-gtk
264- elif [ "$DISTRIB_RELEASE" = "7.10" ] && [ $DE = KDE ]; then
265- DRVS_MNGR=gutsy-kde
266- elif [ "$DISTRIB_RELEASE" = "7.04" ] && [ $DE = GNOME ] || [ $DE = Xfce ]; then
267- DRVS_MNGR=feisty-gtk
268- fi
269-}
270-
271-# Drivers known to work with Compiz
272-WHITELIST="nvidia intel i810 ati radeon fglrx"
273-
274-# Drivers taken from Hardy's /usr/lib/xorg/modules/drivers/ directory
275-# plus radeonhd, vboxvideo, nouveau and the proprietary one's.
276-# Contact me, if your driver is not on this list.
277-KNOWN_DRIVERS="$WHITELIST apm ark chips cirrus cyrix fbdev glint i128
278- i740 imstt mga mtx neomagic newport nsc nv openchrome
279- rendition s3virge savage siliconmotion sis sisusb tdfx
280- tga trident tseng vesa vga via vmware vboxvideo voodoo
281- radeonhd s3 nouveau"
282-
283-# Detect driver in use.
284-# TODO not really satisfied with this. Just because the module is
285-# loaded doesn't necessarily mean the driver is properly working.
286-detect_driver()
287-{
288- if [ -z $XORG_LOG ]; then
289- DRV=$SKIPPING
290- CHECKS=$SKIP
291- SKIP_MESSAGE="Unable to locate your Xorg log"
292- return 1
293- elif [ ! -r $XORG_LOG ]; then
294- DRV=$SKIPPING
295- CHECKS=$SKIP
296- SKIP_MESSAGE="No permission to read $XORG_LOG"
297- return 1
298- fi
299-
300- for i in $KNOWN_DRIVERS ; do
301- if grep Loading $XORG_LOG | grep -q "${i}_drv\.so" &&
302- ! grep Unloading $XORG_LOG | grep -q "${i}_drv\.so" ; then
303- DRV=$i
304- fi
305- done
306-
307- if [ -z $DRV ]; then
308- DRV=$UNKNOWN
309- return 0
310- fi
311-
312-# glxinfo might kill X if vesa or vga are in use (LP#119341)
313-# 'LIBGL_ALWAYS_INDIRECT=1 glxinfo' kills X on openchrome driver
314-# according to user feedback (same for unichrome)
315-# nv driver blocks AIGLX
316- case $DRV in
317- vesa | vga | nv)
318- CHECKS=$SKIP
319- SKIP_MESSAGE="$DRV driver in use"
320- ERROR_MESSAGE="The $DRV driver is not capable of running Compiz, you need to install\n the proper driver for your graphics card."
321- if [ "$DISTRIB_ID" = Ubuntu ]; then
322- detect_driver_manager
323- fi
324- ;;
325- unichrome | openchrome)
326- CHECKS=$SKIP
327- SKIP_MESSAGE="$DRV driver in use" #TODO ERROR_MESSAGE
328- ;;
329- esac
330-}
331-
332-# Detect rendering method
333-detect_rendering()
334-{
335- XVINFO=$(command -v xvinfo)
336-
337- if [ ! -z $XVINFO ]; then
338- if $XVINFO | grep -q Xgl ; then
339- RENDER=Xgl
340- return 0
341- fi
342- fi
343-
344- if xdpyinfo | grep -q NV-GLX ; then
345- RENDER=Nvidia
346- return 0
347- fi
348-
349- AIGLX_STAT="AIGLX enabled\|AIGLX disabled"
350-
351- if [ -z $XORG_LOG ] || [ ! -r $XORG_LOG ]; then
352- RENDER=$SKIPPING
353- return 1
354- elif grep "$AIGLX_STAT" $XORG_LOG | tail -1 | grep -q "AIGLX enabled" ; then
355- RENDER=AIGLX
356- return 0
357- fi
358-
359- if [ -z $XVINFO ]; then
360- RENDER=$SKIPPING
361- CHECKS=$SKIP
362- SKIP_MESSAGE="Unable to check for Xgl, could not run xvinfo"
363- else
364- RENDER="\033[31mNone\033[0m"
365- CHECKS=$SKIP # Checks can be OK nonetheless
366- SKIP_MESSAGE="No rendering method in use (AIGLX, Xgl or Nvidia)"
367- fi
368-}
369-
370-GLXINFO=$(command -v glxinfo)
371-
372-# Check for texture_from_pixmap
373-check_tfp()
374-{
375- if [ "$RENDER" = Xgl ]; then
376- TFP=$SKIPPING
377- return 0
378- elif [ -z $GLXINFO ]; then
379- TFP=$SKIPPING
380- SKIP_MESSAGE="glxinfo not installed"
381- ERROR_MESSAGE="The program glxinfo is needed to perform a number of crucial tests."
382- if [ -e /etc/debian_version ]; then
383- DIST_HELP="You need to install the package \033[1mmesa-utils\033[0m\n Type e.g. \033[1msudo apt-get install mesa-utils\033[0m to install it."
384- elif [ -e /etc/mandriva-release ]; then
385- DIST_HELP="You need to install \033[1mmesa-demos\033[0m\n"
386- fi
387- return 0
388- fi
389-
390- if [ $(glxinfo 2>/dev/null | grep GLX_EXT_texture_from_pixmap -c) -gt 2 ]; then
391- TFP=$OK
392- elif [ $(LIBGL_ALWAYS_INDIRECT=1 glxinfo 2>/dev/null | grep GLX_EXT_texture_from_pixmap -c) -gt 2 ]; then
393- TFP=$OK
394- else
395- TFP=$FAIL
396- fi
397-}
398-
399-# Check for non power of two texture support
400-check_npo2()
401-{
402- if [ "$RENDER" = Xgl ] || [ -z $GLXINFO ]; then
403- NPO2=$SKIPPING
404- elif glxinfo 2>/dev/null | egrep -q '(GL_ARB_texture_non_power_of_two|GL_NV_texture_rectangle|GL_EXT_texture_rectangle|GL_ARB_texture_rectangle)' ; then
405- NPO2=$OK
406- else
407- NPO2=$FAIL
408- fi
409-}
410-
411-# Check for composite extension
412-check_composite()
413-{
414- if xdpyinfo -queryExtensions | grep -q Composite ; then
415- COMP=$OK
416- else
417- COMP=$FAIL
418- fi
419-}
420-
421-# Check for FBConfig
422-check_fbconfig()
423-{
424- if [ -z $GLXINFO ]; then
425- FBC=$SKIPPING
426- elif glxinfo 2>/dev/null | grep -q GLX.*fbconfig ; then
427- FBC=$OK
428- elif [ "$DRV" = via ]; then
429- FBC=$SKIPPING # 'glxinfo -i' kills X on some setups using the via driver
430- elif glxinfo -i 2>/dev/null | grep -q GLX.*fbconfig ; then
431- FBC=$OK
432- else
433- FBC=$FAIL
434- fi
435-}
436-
437-# Check if fglrx driver supports composite
438-check_fglrx()
439-{
440- if [ "$DRV" = fglrx ]; then
441- FGLRXINFO=$(command -v fglrxinfo)
442- if [ ! -z "$FGLRXINFO" ]; then
443- if $FGLRXINFO | grep -q mesa ; then
444- STATUS=$FAIL
445- ERROR="Fglrx driver not properly installed, you are using the Mesa driver."
446- return 0
447- else
448- DIGITS=$($FGLRXINFO | grep version | sed 's/[a-Z:(.)]//g')
449- for i in $DIGITS ; do
450- if [ $i -gt 100000 ]; then
451- FGLRX_VERSION=$i
452- fi
453- done
454- FGLRX_COMPOSITE=206958 # 2.0.6958 first release to support AIGLX
455- if [ ! -z $FGLRX_VERSION ]; then
456- if [ $FGLRX_VERSION -lt $FGLRX_COMPOSITE ] && [ "$RENDER" != Xgl ]; then
457- STATUS=$FAIL
458- ERROR="The version of fglrx in use needs Xgl to work with Compiz."
459- ERROR_MESSAGE="Older versions of fglrx do not support AIGLX, so you have to use Xgl in order\n to make Compiz run with this driver.\n You can either install Xgl or a newer version of the fglrx driver."
460- if [ "$DISTRIB_ID" = Ubuntu ]; then
461- if [ $(echo "$DISTRIB_RELEASE" | sed 's/\.//g') -gt 704 ]; then
462- DIST_HELP="Type \033[1msudo apt-get install xserver-xgl\033[0m to install Xgl."
463- fi
464- fi
465- return 0
466- fi
467- return 1
468- fi
469- STATUS=$SKIPPING
470- SKIP_MESSAGE="Unable to detect fglrx driver version in use."
471- return 0
472- fi
473- fi
474- STATUS=$FAIL
475- ERROR="Fglrx driver not properly installed. Could not run fglrxinfo."
476- return 0
477- fi
478-
479- return 1
480-}
481-
482-if [ -z $XDG_CONFIG_DIRS ]; then
483- XDG_CONFIG_DIRS=/etc/xdg
484-fi
485-
486-if [ -z $XDG_CONFIG_HOME ]; then
487- XDG_CONFIG_HOME=$HOME/.config
488-fi
489-
490-COMPIZ_MNGR_HOME=$XDG_CONFIG_HOME/compiz/compiz-manager
491-
492-# Check if checks are skipped (by compiz-manager, not here!)
493-check_skip()
494-{
495- OLD_IFS=$IFS
496- IFS=:
497- for m in $XDG_CONFIG_DIRS
498- do
499- test -r $m/compiz/compiz-manager && . $m/compiz/compiz-manager
500- done
501- IFS=$OLD_IFS
502- unset OLD_IFS
503-
504- if [ -r $COMPIZ_MNGR_HOME ]; then
505- . $COMPIZ_MNGR_HOME
506- fi
507-
508- if [ "$SKIP_CHECKS" = yes ]; then
509- return 1
510- fi
511-
512- return 0
513-}
514-
515-# Check max texture size compared to resolution in use
516-check_resolution()
517-{
518- if [ -z $GLXINFO ]; then
519- STATUS=$SKIPPING
520- return 0
521- fi
522-
523- TEXTURE_LIMIT=$(glxinfo -l 2>/dev/null | grep GL_MAX_TEXTURE_SIZE | sed 's/.*=[^0-9]//g')
524- RESOLUTION=$(xdpyinfo | grep -i dimensions: | sed 's/[^0-9]*pixels.*(.*).*//' | sed 's/[^0-9x]*//')
525- VRES=$(echo $RESOLUTION | sed 's/.*x//')
526- HRES=$(echo $RESOLUTION | sed 's/x.*//')
527-
528- if [ -z $TEXTURE_LIMIT ]; then
529- STATUS=$SKIPPING
530- SKIP_MESSAGE="Unable to detect maximum 3D texture size"
531- return 0
532- elif [ $VRES -gt $TEXTURE_LIMIT ] || [ $HRES -gt $TEXTURE_LIMIT ]; then
533- STATUS=$FAIL
534- ERROR="Your current resolution is too high to run Compiz."
535- ERROR_MESSAGE="Your resolution is \033[1m${RESOLUTION}\033[0m but the maximum 3D texture size that your\n graphics card is capable of is \033[1m${TEXTURE_LIMIT}x${TEXTURE_LIMIT}\033[0m. Thus Compiz will not be able to run\n on this setup. You have to decrease the resolution first (in case you are\n using a dual-head setup, try disabling one monitor and run the script again)."
536- return 0
537- fi
538-
539- return 1
540-}
541-
542-
543-# Check if there is already another compositing manager running
544-check_compositor()
545-{
546- XCOMPMGR_PID=$(ps -o pid= -C xcompmgr)
547- METACITY_PID=$(ps -o pid= -C metacity)
548- XFWM_PID=$(ps -o pid= -C xfwm4)
549-
550- if [ ! -z $XCOMPMGR_PID ]; then
551- OTHER_COMP=true
552- COMP_MSG="It has been detected, that you are currently running \033[1mxcompmgr\033[0m, which is a\n standalone compositing manager."
553- QUERY_XCOMPMGR=yes
554- elif [ ! -z $METACITY_PID ]; then
555- METACITY=$(command -v metacity)
556- if [ ! -z $METACITY ]; then
557- if [ $($METACITY --version | grep metacity | awk '{print $2}' | sed 's/\.//g') -gt 2200 ]; then
558- GCONFTOOL=$(command -v gconftool-2)
559- if [ ! -z $GCONFTOOL ]; then
560- if $GCONFTOOL -a /apps/metacity/general | grep -q compositing_manager &&
561- [ "$($GCONFTOOL -g /apps/metacity/general/compositing_manager)" = true ]; then
562- OTHER_COMP=true
563- WM_COMP=GNOME
564- QUERY_METACITY=yes
565- fi
566- fi
567- fi
568- fi
569- elif [ ! -z $XFWM_PID ]; then
570- if [ -r $XDG_CONFIG_HOME/xfce4/mcs_settings/wmtweaks.xml ]; then
571- if grep UseCompositing $XDG_CONFIG_HOME/xfce4/mcs_settings/wmtweaks.xml | grep -q 'value="1"' &&
572- ! ps -ef | grep xfwm4 | grep -q compositor=off ; then
573- OTHER_COMP=true
574- WM_COMP=Xfce
575- QUERY_XFWM=yes
576- fi
577- fi
578- fi
579-
580- if [ ! -z $OTHER_COMP ]; then
581- ERROR="Another compositing manager in use."
582- if [ ! -z $WM_COMP ]; then
583- COMP_MSG="The default window manager of $WM_COMP has its own compositing manager to\n provide basic desktop effects."
584- fi
585- ERROR_MESSAGE="${COMP_MSG}\n If this one is in use, Compiz will not be able to run."
586- return 0
587- fi
588-
589- return 1
590-}
591-
592-# Hardy blacklists laptops using ati/radeon driver (LP#201330)
593-check_laptop_ati()
594-{
595- if [ "$DISTRIB_ID $DISTRIB_RELEASE" = "Ubuntu 8.04" ]; then
596- if [ "$DRV" = ati ] || [ "$DRV" = radeon ] ; then
597- if laptop-detect && check_skip ; then
598- ERROR="Laptop using $DRV driver."
599- ERROR_MESSAGE="It has been detected, that you are running a laptop with an ATI chip.\n The $DRV driver supports Compiz out-of-the-box but because of a nasty bug\n in the driver that causes X to freeze on some cards, this particular\n combination had to be blacklisted in Ubuntu \"Hardy Heron\".\n\n In case you already used Compiz successfully on Ubuntu 7.10 (Gutsy), it is\n safe to skip the blacklist."
600- QUERY_SKIP=yes
601- return 0
602- fi
603- fi
604- fi
605-
606- return 1
607-}
608-
609-# Check if "Composite" has been disabled in the xorg.conf
610-check_cmpst_xorg()
611-{
612- if [ "$COMP" = "$OK" ]; then
613- return 1
614- fi
615-
616- # Detect location of the Xorg log file
617- if [ ! -z $XSET ]; then
618- XORG_CONF=$($XSET q | grep "Config file" | awk '{print $3}')
619- fi
620-
621- # Fallback xorg.conf
622- if [ -z $XORG_CONF ]; then
623- if [ -f /etc/X11/xorg.conf ]; then
624- XORG_CONF=/etc/X11/xorg.conf
625- else
626- return 1
627- fi
628- fi
629-
630- if [ ! -r $XORG_CONF ]; then
631- SKIP_MESSAGE="No permission to read $XORG_CONF"
632- return 1
633- else
634- CMPST=$(grep -i "Composite" $XORG_CONF)
635- if echo $CMPST | grep -qi "0" ; then
636- COMPST_STAT='"0"'
637- COMPST_FIX='"1"'
638- elif echo $CMPST | grep -qi "Disable" ; then
639- COMPST_STAT='"Disable"'
640- COMPST_FIX='"Enable"'
641- elif echo $CMPST | grep -qi "false" ; then
642- COMPST_STAT='"false"'
643- COMPST_FIX='"true"'
644- fi
645- fi
646-
647- case $DE in
648- GNOME)
649- EDITOR=gedit
650- ;;
651- KDE4 | KDE)
652- EDITOR=kate
653- ;;
654- Xfce)
655- EDITOR=mousepad
656- ;;
657- esac
658-
659- if [ ! -z $COMPST_STAT ]; then
660- ERROR="Composite manually disabled"
661- ERROR_MESSAGE="It has been detected that the \"Composite\" option of your ${XORG_CONF}\n has been set to $COMPST_STAT"
662- if [ "$DRV" = fglrx ] && [ $FGLRX_VERSION -lt $FGLRX_COMPOSITE ]; then
663- return 0
664- fi
665- if [ ! -z $EDITOR ] && [ -x $EDITOR ]; then
666- DIST_HELP="Open the file being root, e.g. \033[1msudo $EDITOR $XORG_CONF\033[0m\n Then change $COMPST_STAT to $COMPST_FIX and save. Finally restart X and try again."
667- else
668- DIST_HELP="Open the file being root and change $COMPST_STAT to $COMPST_FIX\n Then restart X and try again."
669- fi
670- return 0
671- fi
672-
673- return 1
674-}
675-
676-# Check for Software Rasterizer
677-check_rasterizer()
678-{
679- if glxinfo 2>/dev/null | grep -q 'OpenGL renderer string: Software Rasterizer' ; then
680- ERROR="Software Rasterizer in use" #TODO add $ERROR_MESSAGE
681- return 0
682- else
683- return 1
684- fi
685-}
686-
687-DISCLAIMER="You can skip this blacklist -- but keep in mind that you did so.\n Do not complain if you encounter any problems with Compiz afterwards."
688-
689-# Check if driver in use is on the whitelist
690-check_whitelist()
691-{
692- for i in $WHITELIST ; do
693- if [ "$DRV" = "$i" ]; then
694- return 1
695- fi
696- done
697-
698- if [ "$DRV" = "$UNKNOWN" ]; then
699- DRV_MSG="Unknown driver in use."
700- else
701- DRV_MSG="Detected driver is not on the whitelist."
702- fi
703-
704- if [ "$TFP" = "$OK" -o "$SKIPPING" ] && [ "$NPO2" = "$OK" -o "$SKIPPING" ] &&
705- [ "$COMP" = "$OK" ] && [ "$FBC" = "$OK" -o "$SKIPPING" ]; then
706- if ! check_skip ; then
707- return 1
708- fi
709- STATUS=$WARN
710- WARNING=$DRV_MSG
711- ERROR_MESSAGE="Your driver is not widely known to work with Compiz and thus may be\n blacklisted on certain distributions.\n\n $DISCLAIMER"
712- QUERY_SKIP=yes
713- return 0
714- elif [ "$DRV" = vmware ] || [ "$DRV" = vboxvideo ]; then
715- STATUS=$FAIL
716- ERROR="$DRV driver in use"
717- ERROR_MESSAGE="Compiz can not be run in a virtual environment."
718- return 0
719- fi
720-
721- STATUS=$FAIL
722- ERROR=$DRV_MSG
723- ERROR_MESSAGE="Your driver is not known (most probably not able) to work with Compiz.\n See http://wiki.compiz-fusion.org/Hardware for details."
724-
725- if [ "$DISTRIB_ID" = Ubuntu ]; then
726- detect_driver_manager
727- fi
728-
729- return 0
730-}
731-
732-# PCI IDs that may be blacklist on certain distributions
733-# List taken from Gutsy
734-GUTSY_BLACKLIST="1002:5954 1002:5854 1002:5955 1002:4153 8086:2982 8086:2992
735- 8086:29a2 8086:2a02 8086:2a12 8086:2972 1002:3152 1002:3150
736- 1002:5462 1002:5653"
737-# Blacklisted IDs on Intrepid
738-BLACKLISTED_PCIIDS="$GUTSY_BLACKLIST 8086:1132 8086:2e02 8086:3577 8086:2562"
739-
740-# My own private PCI IDs (added for testing reasons)
741-# Please let me know if I really was that stupid to let those in here.
742-#BLACKLISTED_PCIIDS="$BLACKLISTED_PCIIDS 1002:4152 1002:4e50"
743-
744-# Check if PCI ID in use is on the blacklist
745-check_pciid()
746-{
747- if [ "$DISTRIB_ID" = Ubuntu ] && [ "$DISTRIB_RELEASE" = "8.04" ]; then
748- return 1
749- fi
750-
751- for PCIID in $BLACKLISTED_PCIIDS ; do
752- if $(lspci -n | grep -q "$PCIID") && check_skip ; then
753- STATUS=$WARN
754- WARNING="PCI ID \033[1m${PCIID}\033[0m detected."
755- ERROR_MESSAGE="Your particular graphics chip may be blacklisted on certain distributions.\n However that does not necessarily mean you will not be able to run Compiz.\n\n $DISCLAIMER"
756- QUERY_SKIP=yes
757- return 0
758- fi
759- done
760-
761- return 1
762-}
763-
764-# Check for needed xdg files in Ubuntu
765-check_xdg()
766-{
767- if [ "$DISTRIB_ID" = Ubuntu ]; then
768- if [ $(echo "$DISTRIB_RELEASE" | sed 's/\.//g') -gt 704 ]; then
769- XDG_COMPIZ=/etc/xdg/compiz
770- if [ ! -e $XDG_COMPIZ/compiz-manager ] && [ -e /usr/bin/compiz.real ]; then
771- check_skip
772- if [ "$COMPIZ_BIN_PATH" = /usr/bin/ ] && [ "$COMPIZ_NAME" = compiz.real ] &&
773- [ "$PLUGIN_PATH" = /usr/lib/compiz/ ]; then
774- return 1
775- else
776- STATUS=$WARN
777- WARNING="No path to Compiz found."
778- ERROR_MESSAGE="In case you did not compile Compiz manually, this will result in Compiz\n failing to run."
779- if [ -d $XDG_COMPIZ ]; then
780- BACKUP=$(echo $(ls $XDG_COMPIZ | grep "compiz-manager\.") | awk '{print $1}')
781- fi
782- if [ ! -z $BACKUP ] ; then
783- DIST_HELP="You can try to fix this, by typing the following command in the terminal:\n\033[1msudo mv $XDG_COMPIZ/$BACKUP $XDG_COMPIZ/compiz-manager\033[0m"
784- fi
785- return 0
786- fi
787- fi
788- fi
789- fi
790-
791- return 1
792-}
793-
794-# Check if Nvidia card in use has enough memory
795-check_nvidia_mem()
796-{
797- if [ "$DRV" = nvidia ]; then
798- if [ "$RENDER" = Xgl ]; then
799- STATUS=$SKIPPING
800- SKIP_MESSAGE="Xgl on Nvidia chip."
801- return 0
802- fi
803- NVIDIA_SETTINGS=$(command -v nvidia-settings)
804- if [ ! -z $NVIDIA_SETTINGS ] ; then
805- MEM=$($NVIDIA_SETTINGS -q VideoRam | egrep Attribute\ \'VideoRam\'\ .*: | cut -d: -f3 | sed 's/[^0-9]//g')
806- NVIDIA_MEMORY=65536 # 64MB
807- if [ "$MEM" -lt $NVIDIA_MEMORY ] && check_skip ; then
808- STATUS=$WARN
809- WARNING="Nvidia card has not enough memory ($MEM KB) to run Compiz properly."
810- ERROR_MESSAGE="It is not recommended to run Compiz on a Nvidia chip with such a low amount\n of memory. Because of that, your hardware may be blacklisted on certain\n distributions.\n\n $DISCLAIMER"
811- QUERY_SKIP=yes
812- return 0
813- fi
814- return 1
815- fi
816- STATUS=$SKIPPING
817- SKIP_MESSAGE="Could not check the amount of memory on your Nvidia chip."
818- ERROR_MESSAGE="That does \033[1mnot\033[0m mean, you will not be able to use Compiz.\n If everything else went OK you are most probably fine.\n\n In case you want the script to check this step as well, install the program\n \033[1mnvidia-settings\033[0m on your system."
819- return 0
820- fi
821-
822- return 1
823-}
824-
825-# Check for proprietary driver (Ubuntu only)
826-check_prop_driver()
827-{
828- printf "Check if there's an alternate (proprietary) driver available? (Y/n) "
829- read REPLY
830- case $REPLY in
831- "" | y | Y | yes | Yes)
832- case $DRVS_MNGR in
833- hardy-gtk)
834- exec gksu jockey-gtk & exit 0
835- ;;
836- hardy-kde)
837- exec kdesu jockey-kde & exit 0
838- ;;
839- gutsy-gtk)
840- exec gksu restricted-manager & exit 0
841- ;;
842- gutsy-kde)
843- exec kdesu resrticted-manager-kde & exit 0
844- ;;
845- feisty-gtk)
846- exec gksu restricted-manager & exit 0
847- ;;
848- esac
849- ;;
850- n | N | no | No)
851- exit 0
852- ;;
853- *)
854- check_prop_driver
855- ;;
856- esac
857-}
858-
859-# Query if the user wants to skip checks in compiz-manager
860-query_skip_checks()
861-{
862- printf "Do you want to skip blacklist checks by Compiz? (y/N) "
863- read REPLY
864- case $REPLY in
865- y | Y | yes | Yes)
866- mkdir -p $XDG_CONFIG_HOME/compiz
867- echo SKIP_CHECKS=yes >> $COMPIZ_MNGR_HOME
868- ;;
869- "" | n | N | no | No)
870- exit 0
871- ;;
872- *)
873- query_skip_checks
874- ;;
875- esac
876-}
877-
878-# Query if the user wants to kill xcompmgr
879-query_xcompmgr()
880-{
881- printf "Do you want to disable xcompmgr? (Y/n) "
882- read REPLY
883- case $REPLY in
884- "" | y | Y | yes | Yes)
885- kill $XCOMPMGR_PID
886- ;;
887- n | N | no | No)
888- exit 0
889- ;;
890- *)
891- query_xcompmgr
892- ;;
893- esac
894-}
895-
896-# Query to disable Metacity's compositing manager
897-query_metacity_comp()
898-{
899- printf "Do you want to disable GNOME's compositing manager? (Y/n) "
900- read REPLY
901- case $REPLY in
902- "" | y | Y | yes | Yes)
903- $GCONFTOOL -s -t bool /apps/metacity/general/compositing_manager false
904- kill -9 $METACITY_PID 2>/dev/null
905- exec $METACITY --replace &
906- ;;
907- n | N | no | No)
908- exit 0
909- ;;
910- *)
911- query_metacity_comp
912- ;;
913- esac
914-}
915-
916-# Query if the user wants to disable Xfwm's compsitor
917-query_xfwm_comp()
918-{
919- printf "Do you want to disable Xfce's compositing manager? (Y/n) "
920- read REPLY
921- case $REPLY in
922- "" | y | Y | yes | Yes)
923- kill $XFWM_PID
924- sleep 1
925- exec xfwm4 --compositor=off --daemon &
926- exit 0
927- ;;
928- n | N | no | No)
929- exit 0
930- ;;
931- *)
932- query_xfwm_comp
933- ;;
934- esac
935-}
936-
937-# Ask user to print additional info (Starship Troopers style).
938-more_info()
939-{
940- printf "Would you like to know more? (Y/n) "
941- read REPLY
942- case $REPLY in
943- "" | y | Y | yes | Yes)
944- return 0
945- ;;
946- n | N | no | No)
947- return 1
948- ;;
949- *)
950- more_info
951- ;;
952- esac
953-}
954-
955-# --- Output starts here ---
956-
957-# System info
958-printf "\nGathering information about your system...\n\n"
959-detect_distro
960-printf " Distribution: %9s\033[1m${DISTRIB_ID} ${DISTRIB_RELEASE}\033[0m\n"
961-detect_de
962-printf " Desktop environment: %2s\033[1m${DE}\033[0m\n"
963-detect_video
964-printf " Graphics chip: %8s\033[1m${VIDEO}\033[0m\n"
965-detect_driver
966-printf " Driver in use: %8s\033[1m${DRV}\033[0m\n"
967-detect_rendering
968-printf " Rendering method: %5s\033[1m${RENDER}\033[0m\n"
969-
970-# System checks
971-printf "\nChecking if it's possible to run Compiz on your system..."
972-if [ "$CHECKS" = yes ]; then
973- printf "%2s[${SKIPPING}]\n\n"
974-else
975- printf "\n\n Checking for texture_from_pixmap..."
976- check_tfp
977- printf "%15s[${TFP}]\n"
978- printf " Checking for non power of two support..."
979- check_npo2
980- printf "%10s[${NPO2}]\n"
981- printf " Checking for composite extension..."
982- check_composite
983- printf "%15s[${COMP}]\n"
984- printf " Checking for FBConfig..."
985- check_fbconfig
986- printf "%26s[${FBC}]\n"
987-fi
988-
989-# Hardware checks
990-printf " Checking for hardware/setup problems..."
991-if [ "$CHECKS" = yes ]; then
992- printf "%11s[${SKIPPING}]\n\n"
993-elif check_compositor || check_laptop_ati || check_cmpst_xorg || check_rasterizer ; then
994- printf "%11s[${FAIL}]\n\n"
995-elif check_fglrx || check_whitelist || check_resolution || check_xdg || check_pciid || check_nvidia_mem ; then
996- printf "%11s[${STATUS}]\n\n"
997-else
998- printf "%11s[${OK}]\n\n"
999-fi
1000-
1001-# Print error or warning (if any)
1002-# The $ERROR, $WARNING and $SKIP_MESSAGE outputs are supposed to be a
1003-# short description of the respective error.
1004-if [ "x$ERROR" != "x" ]; then
1005- printf "There has been (at least) one error detected with your setup:\n \033[31mError:\033[0m $ERROR \n\n"
1006-elif [ "x$WARNING" != "x" ]; then
1007- printf "Something potential problematic has been detected with your setup:\n \033[33mWarning:\033[0m $WARNING \n\n"
1008-elif [ "x$SKIP_MESSAGE" != "x" ]; then
1009- printf "At least one check had to be skipped:\n \033[33mError:\033[0m $SKIP_MESSAGE \n\n"
1010-fi
1011-
1012-# Interactive output begins here
1013-if [ "x$ERROR_MESSAGE" != "x" ] && more_info ; then
1014- printf "\n $ERROR_MESSAGE \n\n"
1015- if [ ! -z $QUERY_SKIP ]; then
1016- query_skip_checks
1017- elif [ ! -z $QUERY_XCOMPMGR ]; then
1018- query_xcompmgr
1019- elif [ ! -z $QUERY_METACITY ]; then
1020- query_metacity_comp
1021- elif [ ! -z $QUERY_XFWM ]; then
1022- query_xfwm_comp
1023- elif [ "x$DRVS_MNGR" != "x" ]; then
1024- check_prop_driver
1025- elif [ "x$DIST_HELP" != "x" ]; then
1026- printf " $DIST_HELP \n\n"
1027- fi
1028-fi
1029-
1030-# If there was an error, return an error code
1031-if [ "x$ERROR" != "x" ]; then
1032- exit 1
1033-fi
1034-exit 0
1035
1036=== removed file 'scripts/run_compiz_check'
1037--- scripts/run_compiz_check 2009-09-23 18:48:22 +0000
1038+++ scripts/run_compiz_check 1970-01-01 00:00:00 +0000
1039@@ -1,27 +0,0 @@
1040-#!/usr/bin/python
1041-
1042-import re
1043-import sys
1044-import posixpath
1045-
1046-from subprocess import Popen, PIPE
1047-
1048-
1049-def main():
1050- """
1051- Run compiz check and return any error code
1052- """
1053- compiz_check = posixpath.join(posixpath.dirname(__file__), "compiz-check")
1054- # Answer 'n' to all questions
1055- command = "yes n | %s" % compiz_check
1056- process = Popen(command, shell=True, stdout=PIPE)
1057- output = process.communicate()[0]
1058-
1059- # Remove colored output (not handled correctly in checkbox report)
1060- output = re.sub(r"\[([0-8])?(;3[0-7])?(;4[0-7])?m", "", output)
1061- print output
1062-
1063- return process.returncode
1064-
1065-if __name__ == "__main__":
1066- sys.exit(main())

Subscribers

People subscribed via source and target branches