summaryrefslogtreecommitdiff
path: root/recipes/xserver-common/xserver-common-1.30/0024-Xserver-move-nearly-whole-functionality-to-xserver-c.patch
blob: d00e1a72d1653f195959e355ba3e72b7882eaab3 (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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
From dc0efcbc35a7e0c5b5f908fb4d27a76c4ee304ac Mon Sep 17 00:00:00 2001
From: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Date: Mon, 31 Aug 2009 12:05:17 +0200
Subject: [PATCH 1/1] Xserver: move nearly whole functionality to xserver-common

/etc/X11/Xserver script now use /etc/X11/xserver-common one to get
values for XSERVER, ARGS, DPI variables.

This split allows to use xserver-common for other X11 startup systems.
---
 X11/Xserver        |  188 +--------------------------------------------------
 X11/xserver-common |  191 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 192 insertions(+), 187 deletions(-)
 create mode 100644 X11/xserver-common

diff --git a/X11/Xserver b/X11/Xserver
index 583cd0d..d53e1c9 100755
--- a/X11/Xserver
+++ b/X11/Xserver
@@ -1,194 +1,8 @@
 #!/bin/sh
 #
 
-XSERVER=Xfbdev
-BINDIR=/usr/bin
+. /etc/X11/xserver-common
 
-if [ -f $BINDIR/Xepson ]; then
-  XSERVER=Xepson
-fi
-if [ -f $BINDIR/Xorg ]; then
-  XSERVER=Xorg
-fi
-if [ -f $BINDIR/Xomap ]; then
-  XSERVER=Xomap
-fi
-if [ -f $BINDIR/Xw100 ]; then
-  XSERVER=Xw100
-fi
-if [ -f $BINDIR/Xvesa ]; then
-  XSERVER=Xvesa
-fi
-if [ -f $BINDIR/Ximageon ]; then
-  XSERVER=Ximageon
-fi
-if [ -f $BINDIR/Xglamo ]; then
-  XSERVER=Xglamo
-fi
-
-if [ -f /etc/profile ]; then
-  . /etc/profile
-fi
-
-. /etc/init.d/functions
-
-fallback_screen_arg() {
-    geom=`fbset | grep geometry`
-    w=`echo $geom | awk '{ print $2 }'`
-    h=`echo $geom | awk '{ print $3 }'`
-    b=`echo $geom | awk '{ print $6 }'`
-    echo -n "${w}x${h}x${b}"
-}
-
-SCREEN_SIZE=`fallback_screen_arg`
-export USER=root
-export XSERVER_DEFAULT_ORIENTATION=normal
-
-ARGS="-br -pn $INPUT_EXTRA_ARGS"
-DPI="100"
-MOUSE=""
-
-# use ucb 1x00 touchscreen if present
-if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ]; then
-  MOUSE="-mouse /dev/touchscreen/ucb1x00"
-fi
-
-# kdrive 1.4 onwards needs -mouse args
-# Xorg doesn't support "-mouse" option, and uses /dev/input/mice automatically
-if [ -e "$TSLIB_TSDEVICE" ] ; then
-  MOUSE="-mouse tslib"
-else
-  if  [ -e /dev/input/mice ] && [ "$XSERVER" != "Xorg" ] ; then
-    MOUSE="-mouse mouse"
-  fi
-fi
-
-if [ -e /etc/default/xserver ] ; then
-    . /etc/default/xserver
-else
-    # start off server in conventional location.
-    case `machine_id` in
-	    "aml_m8050")
-		    ARGS="$ARGS  -screen 320x240@270"
-		    DPI="100" ;;
-	    "hp_ipaq_h3100" | "hp_ipaq_h3800")
-		    ARGS="$ARGS -rgba vrgb -screen 320x240@90"
-		    DPI="100" ;;
-	    "hp_ipaq_h3600" | "hp_ipaq_h3700" | "hp_ipaq_h3900")
-		    ARGS="$ARGS -rgba vbgr -screen 320x240@270"
-		    DPI="100" ;;
-	    "hp_ipaq_h5400" | "hp_ipaq_h2200")
-		    ARGS="$ARGS -rgba rgb"
-		    DPI="100" ;;
-	    "hp_ipaq_hx4700")
-		    DPI="200" ;;
-	    "ramses")
-		    # What is this "vt2" in aid of?
-		    ARGS="$ARGS -rgba vrgb -screen 320x240@90 vt2"
-		    DPI="100" ;;
-	    *poodle)
-		    ARGS="$ARGS -rgba vrgb -screen 320x240@270"
-		    DPI="100" ;;
-	    # both 'Sharp-Collie' and just 'Collie' have been reported
-	    *collie)
-		    ARGS="$ARGS -rgba vrgb -screen 320x240@270"
-		    DPI="100" ;;
-	    "sharp_shepherd" | "sharp_husky" | "sharp_corgi")
-		    ARGS="$ARGS -rgba rgb"
-		    DPI="200" ;;
-	    "sharp_spitz" | "sharp_akita" | "sharp_borzoi")
-		    export XSERVER_DEFAULT_ORIENTATION="normal"
-		    ARGS="$ARGS -rgba rgb -screen 480x640"
-		    DPI="200" ;;
-	    "simpad")
-		    ARGS="$ARGS -rgba rgb"
-		    DPI="100" ;;
-	    "generic_omap1510/1610/1710")
-		    MOUSE="-mouse /dev/input/event0"
-		    DPI="220" ;;
-	    "ti-osk")
-		    DPI="100" ;;
-	    "cellon_c8000_board")
-		    ARGS="$ARGS -screen ${SCREEN_SIZE},10,1"
-		    DPI="100" ;;
-	    "htc_magician")
-		    DPI="142" ;;
-	    "htc_universal")
-		    ARGS="$ARGS -screen 480x640@270"
-		    DPI="100" ;;
-	    "htc_tornado")
-		    ARGS="$ARGS -hide-cursor"
-		    DPI="100" ;;
-	    "generic_omap1510/1610/1710")
-		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
-		    DPI="225" ;;
-	    "nokia_n800" | "nokia_rx-44" | "nokia_n770")
-		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
-		    DPI="225" ;;
-	    "gta01" )
-		    DPI="285"
-		    if [ "$XSERVER" != "Xorg" ] ; then
-			    ARGS="$ARGS -screen 480x640"
-		    fi
-		    ;;
-	    "gta02")
-		    DPI="285"
-		    if [ "$XSERVER" != "Xorg" ] ; then
-			    ARGS="$ARGS -screen ${SCREEN_SIZE}"
-		    fi
-		    ;;
-	    "motorola_ezx_platform")
-		    ARGS="$ARGS -screen 240x320"
-		    DPI="170" ;;
-	    "arm-integratorcp" | "arm-versatile_pb")
-		    ARGS="$ARGS -rgba vrgb" ;;
-	    "compulab_cm-x270")
-		    modprobe mbxfb
-		    ARGS="$ARGS -fb /dev/fb1" ;;
-	    "boundary_devices_neon_board")
-		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
-		    DPI="100" ;;
-	    "hoeft&wessel_hw90350")
-		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
-		    DPI="100" ;;
-	    "hoeft&wessel_hw90250")
-		    ARGS="$ARGS -screen 240x320@90"
-		    DPI="100" ;;
-	    "mini2440")
-		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
-		    DPI="100" ;;
-	    "palm_treo_650")
-	            DPI="181"
-		    ARGS="$ARGS -screen 320x320 -hide-cursor" ;;
-	    "glofiish_m800")
-	            DPI="285"
-		    ARGS="$ARGS -screen ${SCREEN_SIZE} -hide-cursor vt1" ;;
-	    "freescale_mx21ads")
-	    # That's what /proc/cpuinfo shows as hardware on the chumby
-	            DPI="121"
-		    ARGS="$ARGS -screen 320x240 -hide-cursor" ;;
-
-            # this is to rotate X display properly, tested with display TX09D71VM1CCA
-            ronetix*pm9261*  | ronetix*pm9263*)
-         	    ARGS="$ARGS -screen 240/54x320/81@90x16" ;;
-	    # This is a fallback for PCs
-	    "")
-		    if [ -f $BINDIR/Xvesa ]; then
-			    ARGS="$ARGS -mode 0x0114"
-		    else
-			# It is a device we do not know about, in which case we force
-			# kdrive to use the current framebuffer geometry -- otherwise
-			# it will default to trying to achieve 1024x768
-			if [ "$XSERVER" != "Xorg" ] ; then
-			    ARGS="$ARGS -screen ${SCREEN_SIZE}"
-			fi
-		    fi
-    esac
-fi
-
-if [ "$XSERVER" != "Xorg" ] ; then
-    ARGS="$ARGS $MOUSE"
-fi
 
 echo "tslib: $TSLIB_TSDEVICE"
 echo "exec $XSERVER $ARGS -dpi $DPI $*"
diff --git a/X11/xserver-common b/X11/xserver-common
new file mode 100644
index 0000000..29d152f
--- /dev/null
+++ b/X11/xserver-common
@@ -0,0 +1,191 @@
+#!/bin/sh
+#
+
+XSERVER=Xfbdev
+BINDIR=/usr/bin
+
+if [ -f $BINDIR/Xepson ]; then
+  XSERVER=Xepson
+fi
+if [ -f $BINDIR/Xorg ]; then
+  XSERVER=Xorg
+fi
+if [ -f $BINDIR/Xomap ]; then
+  XSERVER=Xomap
+fi
+if [ -f $BINDIR/Xw100 ]; then
+  XSERVER=Xw100
+fi
+if [ -f $BINDIR/Xvesa ]; then
+  XSERVER=Xvesa
+fi
+if [ -f $BINDIR/Ximageon ]; then
+  XSERVER=Ximageon
+fi
+if [ -f $BINDIR/Xglamo ]; then
+  XSERVER=Xglamo
+fi
+
+if [ -f /etc/profile ]; then
+  . /etc/profile
+fi
+
+. /etc/init.d/functions
+
+fallback_screen_arg() {
+    geom=`fbset | grep geometry`
+    w=`echo $geom | awk '{ print $2 }'`
+    h=`echo $geom | awk '{ print $3 }'`
+    b=`echo $geom | awk '{ print $6 }'`
+    echo -n "${w}x${h}x${b}"
+}
+
+SCREEN_SIZE=`fallback_screen_arg`
+export USER=root
+export XSERVER_DEFAULT_ORIENTATION=normal
+
+ARGS="-br -pn $INPUT_EXTRA_ARGS"
+DPI="100"
+MOUSE=""
+
+# use ucb 1x00 touchscreen if present
+if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ]; then
+  MOUSE="-mouse /dev/touchscreen/ucb1x00"
+fi
+
+# kdrive 1.4 onwards needs -mouse args
+# Xorg doesn't support "-mouse" option, and uses /dev/input/mice automatically
+if [ -e "$TSLIB_TSDEVICE" ] ; then
+  MOUSE="-mouse tslib"
+else
+  if  [ -e /dev/input/mice ] && [ "$XSERVER" != "Xorg" ] ; then
+    MOUSE="-mouse mouse"
+  fi
+fi
+
+if [ -e /etc/default/xserver ] ; then
+    . /etc/default/xserver
+else
+    # start off server in conventional location.
+    case `machine_id` in
+	    "aml_m8050")
+		    ARGS="$ARGS  -screen 320x240@270"
+		    DPI="100" ;;
+	    "hp_ipaq_h3100" | "hp_ipaq_h3800")
+		    ARGS="$ARGS -rgba vrgb -screen 320x240@90"
+		    DPI="100" ;;
+	    "hp_ipaq_h3600" | "hp_ipaq_h3700" | "hp_ipaq_h3900")
+		    ARGS="$ARGS -rgba vbgr -screen 320x240@270"
+		    DPI="100" ;;
+	    "hp_ipaq_h5400" | "hp_ipaq_h2200")
+		    ARGS="$ARGS -rgba rgb"
+		    DPI="100" ;;
+	    "hp_ipaq_hx4700")
+		    DPI="200" ;;
+	    "ramses")
+		    # What is this "vt2" in aid of?
+		    ARGS="$ARGS -rgba vrgb -screen 320x240@90 vt2"
+		    DPI="100" ;;
+	    *poodle)
+		    ARGS="$ARGS -rgba vrgb -screen 320x240@270"
+		    DPI="100" ;;
+	    # both 'Sharp-Collie' and just 'Collie' have been reported
+	    *collie)
+		    ARGS="$ARGS -rgba vrgb -screen 320x240@270"
+		    DPI="100" ;;
+	    "sharp_shepherd" | "sharp_husky" | "sharp_corgi")
+		    ARGS="$ARGS -rgba rgb"
+		    DPI="200" ;;
+	    "sharp_spitz" | "sharp_akita" | "sharp_borzoi")
+		    export XSERVER_DEFAULT_ORIENTATION="normal"
+		    ARGS="$ARGS -rgba rgb -screen 480x640"
+		    DPI="200" ;;
+	    "simpad")
+		    ARGS="$ARGS -rgba rgb"
+		    DPI="100" ;;
+	    "generic_omap1510/1610/1710")
+		    MOUSE="-mouse /dev/input/event0"
+		    DPI="220" ;;
+	    "ti-osk")
+		    DPI="100" ;;
+	    "cellon_c8000_board")
+		    ARGS="$ARGS -screen ${SCREEN_SIZE},10,1"
+		    DPI="100" ;;
+	    "htc_magician")
+		    DPI="142" ;;
+	    "htc_universal")
+		    ARGS="$ARGS -screen 480x640@270"
+		    DPI="100" ;;
+	    "htc_tornado")
+		    ARGS="$ARGS -hide-cursor"
+		    DPI="100" ;;
+	    "generic_omap1510/1610/1710")
+		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
+		    DPI="225" ;;
+	    "nokia_n800" | "nokia_rx-44" | "nokia_n770")
+		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
+		    DPI="225" ;;
+	    "gta01" )
+		    DPI="285"
+		    if [ "$XSERVER" != "Xorg" ] ; then
+			    ARGS="$ARGS -screen 480x640"
+		    fi
+		    ;;
+	    "gta02")
+		    DPI="285"
+		    if [ "$XSERVER" != "Xorg" ] ; then
+			    ARGS="$ARGS -screen ${SCREEN_SIZE}"
+		    fi
+		    ;;
+	    "motorola_ezx_platform")
+		    ARGS="$ARGS -screen 240x320"
+		    DPI="170" ;;
+	    "arm-integratorcp" | "arm-versatile_pb")
+		    ARGS="$ARGS -rgba vrgb" ;;
+	    "compulab_cm-x270")
+		    modprobe mbxfb
+		    ARGS="$ARGS -fb /dev/fb1" ;;
+	    "boundary_devices_neon_board")
+		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
+		    DPI="100" ;;
+	    "hoeft&wessel_hw90350")
+		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
+		    DPI="100" ;;
+	    "hoeft&wessel_hw90250")
+		    ARGS="$ARGS -screen 240x320@90"
+		    DPI="100" ;;
+	    "mini2440")
+		    ARGS="$ARGS -screen ${SCREEN_SIZE}"
+		    DPI="100" ;;
+	    "palm_treo_650")
+	            DPI="181"
+		    ARGS="$ARGS -screen 320x320 -hide-cursor" ;;
+	    "glofiish_m800")
+	            DPI="285"
+		    ARGS="$ARGS -screen ${SCREEN_SIZE} -hide-cursor vt1" ;;
+	    "freescale_mx21ads")
+	    # That's what /proc/cpuinfo shows as hardware on the chumby
+	            DPI="121"
+		    ARGS="$ARGS -screen 320x240 -hide-cursor" ;;
+
+            # this is to rotate X display properly, tested with display TX09D71VM1CCA
+            ronetix*pm9261*  | ronetix*pm9263*)
+         	    ARGS="$ARGS -screen 240/54x320/81@90x16" ;;
+	    # This is a fallback for PCs
+	    "")
+		    if [ -f $BINDIR/Xvesa ]; then
+			    ARGS="$ARGS -mode 0x0114"
+		    else
+			# It is a device we do not know about, in which case we force
+			# kdrive to use the current framebuffer geometry -- otherwise
+			# it will default to trying to achieve 1024x768
+			if [ "$XSERVER" != "Xorg" ] ; then
+			    ARGS="$ARGS -screen ${SCREEN_SIZE}"
+			fi
+		    fi
+    esac
+fi
+
+if [ "$XSERVER" != "Xorg" ] ; then
+    ARGS="$ARGS $MOUSE"
+fi
-- 
1.6.3.3