aboutsummaryrefslogtreecommitdiffstats
path: root/meta/packages/xserver-kdrive-common/xserver-kdrive-common/etc/X11/Xserver
blob: 8828f60434783cbc3b0a86546e8229418b3718ef (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
#!/bin/sh
#

# note xinit needs full server path
XSERVER=/usr/bin/Xipaq
if [ -f /usr/bin/Xfbdev ]; then
  XSERVER=/usr/bin/Xfbdev
fi
if [ -f /usr/bin/Xepson ]; then
  XSERVER=/usr/bin/Xepson
fi
if [ -f /usr/bin/Xorg ]; then
  XSERVER=/usr/bin/Xorg
fi
if [ -f /usr/bin/Xomap ]; then
  XSERVER=/usr/bin/Xomap
fi

. /etc/profile

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}"
} 

module_id() {
    ## used to read from assets, but sometimes assets is corrupted
    # grep "Module ID" /proc/hal/assets | sed "s/.*://"
    ## used to read from /proc/hal/model, but that is removed in 2.6
    # echo ' iPAQ' `cat /proc/hal/model`
    awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
}

export USER=root

ARGS=" -br -pn"

# use ucb 1x00 touchscreen if present
if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/touchscreen/ucb1x00 ]; then
  ARGS="$ARGS -mouse /dev/touchscreen/ucb1x00"
fi

# use usb mouse if present
# Xorg doesn't support "-mouse" option, and uses /dev/input/mice automatically
if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/input/mice ] && [ "$XSERVER" != "Xorg" ]; then
  ARGS="$ARGS -mouse /dev/input/mice"
fi

# start off server in conventional location.
case `module_id` in
	"HP iPAQ H3100" | "HP iPAQ H3800")
		ARGS="$ARGS -dpi 100 -screen 320x240@90 -rgba vrgb" ;;
	"HP iPAQ H3600" | "HP iPAQ H3700" | "HP iPAQ H3900")
		ARGS="$ARGS -dpi 100 -screen 320x240@270 -rgba vbgr" ;;
	"HP iPAQ H5400" | "HP iPAQ H2200")
		ARGS="$ARGS -dpi 100 -rgba rgb" ;;
	"Ramses")
		# What is this "vt2" in aid of?
		ARGS="$ARGS -dpi 100 -screen 320x240@90 -rgba vrgb vt2" ;;
	# both 'Sharp-Collie' and just 'Collie' have been reported
	*Poodle)
		ARGS="$ARGS -screen 320x240@270 -rgba vrgb" ;;
	*Collie)
		ARGS="$ARGS -dpi 100 -screen 320x240@270 -rgba vrgb"
		# Horrible hack required to enable resuming after suspend
		rm -f /dev/apm_bios
		killall -9 apmd
		;;
	"SHARP Shepherd" | "SHARP Husky" | "SHARP Corgi")
		ARGS="$ARGS -dpi 150 -rgba rgb" ;;
	"SHARP Spitz" | "SHARP Akita" | "SHARP Borzoi")
		ARGS="$ARGS -dpi 150 -rgba rgb -screen 480x640@270" ;;
	"Simpad")
		ARGS="$ARGS -rgba rgb" ;;
	"Generic OMAP1510/1610/1710")
		ARGS="$ARGS -mouse /dev/input/event0" ;;
	"ARM-IntegratorCP" | "ARM-Versatile PB")
		ARGS="$ARGS -rgba vrgb" ;;
	"Compulab CM-x270")
                modprobe mbxfb
	        ARGS="$ARGS -fb /dev/fb1"
                ;;
        *)
		# Its a device we dont know about - in which case force
                # kdrive to use the current framebuffer geometry otherwise
		# it will defualt to trying to achieve 1024x768 
		S=`fallback_screen_arg`
		ARGS="$ARGS -screen $S"
		;;
esac

DISPLAY=':0'

exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $*