summaryrefslogtreecommitdiff
path: root/debian/xserver-xorg-core.bug.script
blob: e994d43c2680d183cf9d5b44c83a78994b178d4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/sh

# $Id$

PATH="/sbin:$PATH"
CONFIG_DIR=/etc/X11
SERVER_SYMLINK="$CONFIG_DIR/X"
XORGCONFIG="$CONFIG_DIR/xorg.conf"
CONFIG_AUX_DIR=/var/lib/x11
SERVER_SYMLINK_CHECKSUM="$CONFIG_AUX_DIR/${SERVER_SYMLINK##*/}.md5sum"
SERVER_SYMLINK_ROSTER="$CONFIG_AUX_DIR/${SERVER_SYMLINK##*/}.roster"
XORGCONFIG_CHECKSUM="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.md5sum"
XORGCONFIG_ROSTER="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.roster"

exec >&3

if [ -e "$SERVER_SYMLINK_ROSTER" ]; then
    printf "Contents of $SERVER_SYMLINK_ROSTER:\n"
    cat "$SERVER_SYMLINK_ROSTER"
else
    printf "$SERVER_SYMLINK_ROSTER does not exist.\n"
fi

printf "\n"

if [ -e "$SERVER_SYMLINK" ]; then
    if [ -e "$SERVER_SYMLINK_CHECKSUM" ]; then
        if [ "$(readlink "$SERVER_SYMLINK" | md5sum)" = \
             "$(cat "$SERVER_SYMLINK_CHECKSUM")" ]; then
            printf "%s target unchanged from checksum in %s.\n" \
              "$SERVER_SYMLINK" "$SERVER_SYMLINK_CHECKSUM"
        else
            printf "%s target does not match checksum in %s.\n" \
              "$SERVER_SYMLINK" "$SERVER_SYMLINK_CHECKSUM"
        fi
    else
        printf "$SERVER_SYMLINK_CHECKSUM does not exist.\n"
    fi
    printf "\n"
    printf "X server symlink status:\n"
    ls -dl "$SERVER_SYMLINK"
    ls -dl "$(readlink "$SERVER_SYMLINK")"
else
    printf "$SERVER_SYMLINK does not exist.\n"
fi

if ! [ -L "$SERVER_SYMLINK" ]; then
    printf "$SERVER_SYMLINK is not a symlink.\n"
fi

if ! [ -x "$SERVER_SYMLINK" ]; then
    printf "$SERVER_SYMLINK is not executable.\n"
fi

printf "\n"

if [ -e "$XORGCONFIG_ROSTER" ]; then
    printf "Contents of $XORGCONFIG_ROSTER:\n"
    cat "$XORGCONFIG_ROSTER"
else
    printf "$XORGCONFIG_ROSTER does not exist.\n"
fi

printf "\n"

if which lspci > /dev/null 2>&1; then
    printf "VGA-compatible devices on PCI bus:\n"
    LC_ALL=C lspci | grep 'VGA compatible controller:'
    LC_ALL=C lspci -n | grep 'Class 0300:'
else
    printf "The lspci command was not found; not including PCI data.\n"
fi

printf "\n"

if [ -e "$XORGCONFIG" ]; then
    if [ -e "$XORGCONFIG_CHECKSUM" ]; then
        if [ "$(md5sum "$XORGCONFIG")" = "$(cat "$XORGCONFIG_CHECKSUM")" ]; then
            printf "%s unchanged from checksum in %s.\n" "$XORGCONFIG" \
              "$XORGCONFIG_CHECKSUM"
        else
            printf "%s does not match checksum in %s.\n" "$XORGCONFIG" \
              "$XORGCONFIG_CHECKSUM"
        fi
    else
        printf "$XORGCONFIG_CHECKSUM does not exist.\n"
    fi
    printf "\n"
    printf "Xorg X server configuration file status:\n"
    ls -dl "$XORGCONFIG"
    printf "\n"
    printf "Contents of $XORGCONFIG:\n"
    iconv -c -t ascii "$XORGCONFIG"
    printf "\n"
else
    printf "$XORGCONFIG does not exist.\n"
fi

printf "\n"

XORG_LOGS=$(ls -dt /var/log/Xorg.*.log 2>/dev/null)

if [ -n "$XORG_LOGS" ]; then
    printf "Xorg X server log files on system:\n"
    ls -dlrt /var/log/Xorg.*.log 2>/dev/null
    printf "\n"
    for LOG in $XORG_LOGS; do
        if [ -f "$LOG" ]; then
            printf "Contents of most recent Xorg X server log file\n"
            printf "%s:\n" "$LOG"
            cat "$LOG"
            # the log files are large; only show the most recent
            break
        fi
    done
else
    printf "No Xorg X server log files found.\n"
fi

if [ -x /usr/bin/lshal ]; then
    printf "\nHAL Information (lshal):\n"
    for udi in `(hal-find-by-capability --capability input.keys;
                 hal-find-by-capability --capability input.mouse;
                 hal-find-by-capability --capability input.touchpad;
                 hal-find-by-capability --capability input.tablet
                )|sort -u`;
    do
        lshal -u "$udi"
    done
fi

if [ -x /bin/dmesg ]; then
    printf "DRM Information from dmesg:\n"
    dmesg | egrep -i 'drm|agp'
fi

printf "\n"

# vim:set ai et sts=4 sw=4 tw=0: