File: libfglrx.preinst

package info (click to toggle)
fglrx-driver 1%3A14.9%2Bga14.201-2
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie-kfreebsd
  • size: 353,324 kB
  • sloc: ansic: 14,889; xml: 4,141; sh: 2,402; makefile: 415
file content (210 lines) | stat: -rw-r--r-- 3,264 bytes parent folder | download
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#!/bin/sh
set -e

. /usr/share/debconf/confmodule

LEGACY_DRIVER="fglrx-legacy-driver"
LEGACY_PCIIDS="
10029400
10029401
10029402
10029403
10029405
1002940A
1002940B
1002940F
10029440
10029441
10029442
10029443
10029444
10029446
10029447
1002944A
1002944B
1002944C
1002944E
1002944F
10029450
10029451
10029452
10029456
1002945A
1002945B
1002945E
10029460
10029462
1002946A
1002946B
1002947A
1002947B
10029480
10029487
10029488
10029489
1002948A
1002948F
10029490
10029491
10029495
10029498
1002949C
1002949E
1002949F
100294A0
100294A1
100294A3
100294B1
100294B3
100294B4
100294B5
100294C0
100294C1
100294C3
100294C4
100294C5
100294C6
100294C7
100294C8
100294C9
100294CB
100294CC
10029500
10029501
10029504
10029505
10029506
10029507
10029508
10029509
1002950F
10029511
10029513
10029515
10029517
10029519
10029540
10029541
10029542
1002954E
1002954F
10029552
10029553
10029555
10029557
1002955F
10029580
10029581
10029583
10029586
10029587
10029588
10029589
1002958A
1002958B
1002958C
1002958D
1002958E
1002958F
10029590
10029591
10029593
10029595
10029596
10029597
10029598
10029599
1002959B
100295C0
100295C2
100295C4
100295C5
100295C6
100295C7
100295C9
100295CC
100295CD
100295CE
100295CF
10029610
10029611
10029612
10029613
10029614
10029615
10029616
10029710
10029711
10029712
10029713
10029714
10029715
"

find_unsupported_gpus()
{
	# Check for R6xx, R7xx, ... GPUs that are no longer supported starting with 12-6
	if lspci --version > /dev/null 2>&1; then
		lspci -mn \
		| awk '{ gsub("\"",""); if ($2 == "0300") { print $1 " " $3$4 } }' \
		| tr '[:lower:]' '[:upper:]' \
		| while read dev id
		do
			for x in $LEGACY_PCIIDS
			do
				if [ "$x" = "$id" ]; then
					echo "$dev"
					break
				fi
			done
		done
	fi
}


check_for_unsupported_gpus()
{
	# allow to disable the check via preseeding
	db_get fglrx-driver/check-for-unsupported-gpu
	test "$RET" = "true" || return 0

	UNSUPPORTED_DEVICES="$(find_unsupported_gpus)"

	test -n "$UNSUPPORTED_DEVICES" || return 0

	UNSUPPORTED="$(for dev in $UNSUPPORTED_DEVICES ; do lspci -nn -s "$dev" ; done)"

	db_subst fglrx-driver/install-even-if-unsupported-gpu-exists vendor "Fglrx"
	db_subst fglrx-driver/install-even-if-unsupported-gpu-exists driver "fglrx-driver"
	db_subst fglrx-driver/install-even-if-unsupported-gpu-exists legacy_driver "$LEGACY_DRIVER"
	db_subst fglrx-driver/install-even-if-unsupported-gpu-exists free_name "Radeon"
	db_subst fglrx-driver/install-even-if-unsupported-gpu-exists free_driver "xserver-xorg-video-radeon"
	db_subst fglrx-driver/install-even-if-unsupported-gpu-exists unsupported-device "$UNSUPPORTED"

	# ensure the question is asked again unless it was accepted previously
	db_get fglrx-driver/install-even-if-unsupported-gpu-exists
	if [ "$RET" = "false" ]; then
		db_fset fglrx-driver/install-even-if-unsupported-gpu-exists seen false
	fi

	db_input high fglrx-driver/install-even-if-unsupported-gpu-exists || true
	db_go

	echo "*** The following unsupported devices are present in the machine:"
	echo "$UNSUPPORTED"

	db_get fglrx-driver/install-even-if-unsupported-gpu-exists
	if [ "$RET" = "false" ]; then
		echo "Aborting fglrx installation."
		exit 1
	fi
}


if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then

	check_for_unsupported_gpus

fi

#DEBHELPER#