xref: /OK3568_Linux_fs/external/xserver/debian/xserver-xorg-core.bug.script (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2
3PATH="/sbin:$PATH"
4CONFIG_DIR=/etc/X11
5SERVER_BINARY=/usr/bin/Xorg
6SERVER_SYMLINK="$CONFIG_DIR/X"
7XORGCONFIG="$CONFIG_DIR/xorg.conf"
8XORGCONFIG_DIR="$CONFIG_DIR/xorg.conf.d"
9CONFIG_AUX_DIR=/var/lib/x11
10X11R6_LIBS=/usr/X11R6/lib
11LOCAL_LIBS=/usr/local/lib
12
13# Pretty echo, underline the specified string:
14pecho() {
15    echo "$@"
16    echo "$@"|sed 's/./-/g'
17}
18
19exec >&3
20
21if [ -e "$SERVER_SYMLINK" ]; then
22    pecho "X server symlink status:"
23    ls -dl "$SERVER_SYMLINK"
24    ls -dl "$(readlink "$SERVER_SYMLINK")"
25else
26    echo "$SERVER_SYMLINK does not exist."
27fi
28
29if ! [ -L "$SERVER_SYMLINK" ]; then
30    echo "$SERVER_SYMLINK is not a symlink."
31fi
32
33if ! [ -x "$SERVER_SYMLINK" ]; then
34    echo "$SERVER_SYMLINK is not executable."
35fi
36
37echo
38
39if ldd "$SERVER_BINARY" | grep -qs "$LOCAL_LIBS"; then
40   pecho "The server is using local libraries!"
41   ldd "$SERVER_BINARY" | grep "$LOCAL_LIBS"
42   echo
43fi
44
45if ldd "$SERVER_BINARY" | grep -qs "$X11R6_LIBS"; then
46   pecho "The server is using obsolete libraries!"
47   ldd "$SERVER_BINARY" | grep "$X11R6_LIBS"
48   echo
49fi
50
51if dpkg-divert --list | grep -qs -i libgl; then
52    pecho "Diversions concerning libGL are in place"
53    dpkg-divert --list | grep -i libgl
54    echo
55fi
56
57if which lspci > /dev/null 2>&1; then
58    pecho "VGA-compatible devices on PCI bus:"
59    LC_ALL=C lspci -nn | grep 'VGA compatible controller'
60else
61    echo "The lspci command was not found; not including PCI data."
62fi
63
64echo
65
66if [ -e "$XORGCONFIG" ]; then
67    pecho "Xorg X server configuration file status:"
68    ls -dl "$XORGCONFIG"
69    echo
70    pecho "Contents of $XORGCONFIG:"
71    iconv -c -t ascii "$XORGCONFIG"
72else
73    echo "$XORGCONFIG does not exist."
74fi
75
76echo
77
78if [ -d "$XORGCONFIG_DIR" ]; then
79    pecho "Contents of $XORGCONFIG_DIR:"
80    ls -l "$XORGCONFIG_DIR"
81else
82    echo "$XORGCONFIG_DIR does not exist."
83fi
84
85echo
86
87KMS_CONFS_DIR=/etc/modprobe.d
88KMS_CONFS=$(ls $KMS_CONFS_DIR/*-kms.conf 2>/dev/null)
89
90if [ -n "$KMS_CONFS" ]; then
91    pecho "KMS configuration files:"
92    for CONF in $KMS_CONFS; do
93      echo "$CONF:"
94      # Indent, and get rid of empty lines:
95      sed 's/^/  /' < "$CONF"|egrep -v '^\s*$'
96    done
97else
98    echo "$KMS_CONFS_DIR contains no KMS configuration files."
99fi
100
101echo
102
103KERNEL_VERSION=/proc/version
104
105if [ -e "$KERNEL_VERSION" ]; then
106    pecho "Kernel version ($KERNEL_VERSION):"
107    cat /proc/version
108else
109    echo "No kernel version found (missing $KERNEL_VERSION)."
110fi
111
112echo
113
114XORG_LOGS=$(ls -dt /var/log/Xorg.*.log $HOME/.local/share/xorg/Xorg.*.log 2>/dev/null)
115
116if [ -n "$XORG_LOGS" ]; then
117    pecho "Xorg X server log files on system:"
118    ls -dlrt /var/log/Xorg.*.log $HOME/.local/share/xorg/Xorg.*.log 2>/dev/null
119    echo
120    for LOG in $XORG_LOGS; do
121        if [ -f "$LOG" ]; then
122            pecho "Contents of most recent Xorg X server log file ($LOG):"
123            cat "$LOG"
124            # the log files are large; only show the most recent
125            break
126        fi
127    done
128else
129    echo "No Xorg X server log files found."
130fi
131
132echo
133
134if [ -x /bin/udevadm ]; then
135    pecho "udev information:"
136    /bin/udevadm info --export-db | awk -F '\n' -v RS='\n\n' '/E: ID_INPUT/ { print; print "" }'
137    echo
138fi
139
140if [ -x /bin/dmesg ]; then
141    pecho "DRM Information from dmesg:"
142    dmesg | egrep -i 'drm|agp'
143    echo
144fi
145
146# vim:set ai et sts=4 sw=4 tw=0:
147