TIVI-248 & TIVI-267: remove -sharevts option from startx.
[profile/ivi/xorg-x11-server-misc.git] / arm-common / startx.in
1 #!/bin/sh
2
3 DISPLAY=":0"
4 LOGDIR="/opt/var/log"
5 XORG_CONF=" -config @DATADIR@/etc/X11/xorg.conf -configdir /opt/etc/X11/xorg.conf.d "
6 OTHER_OPTIONS=" -logfile ${LOGDIR}/Xorg.0.log -ac -noreset -r +accessx 0 "
7
8 udevadm trigger --subsystem-match=drm &
9 udevadm trigger --subsystem-match=input &
10
11 #check the existence of LOGDIR, if not create LOGDIR
12 if [ ! -d ${LOGDIR} ]; then
13         mkdir -p ${LOGDIR}
14 fi
15
16 #backup previous Xorg.0.log file
17 if [ -e ${LOGDIR}/Xorg.0.log ]; then
18         mv ${LOGDIR}/Xorg.0.log ${LOGDIR}/prev.Xorg.0.log
19 fi
20
21 #backup previous Xorg.0.log.old file
22 if [ -e ${LOGDIR}/Xorg.0.log.old ]; then
23         mv ${LOGDIR}/Xorg.0.log.old ${LOGDIR}/prev.Xorg.0.log.old
24 fi
25                 
26 if [ ! -e /opt/etc/X11/xorg.conf.d ]; then
27         ln -s /opt/etc/X11/xorg.conf.d.default /opt/etc/X11/xorg.conf.d
28 fi
29
30 if [ -e ~/.xinitrc ]; then
31         XINITRC=~/.xinitrc
32 else
33         XINITRC=@PREFIX@/etc/X11/xinitrc
34 fi
35
36 XSERVER_OPTIONS=" ${DISPLAY} ${OTHER_OPTIONS} ${XORG_CONF} "
37
38 if [ "$1" = "--gdb" ]; then
39         if [ -x /usr/bin/pvrsrvinit ]; then         
40                 pvrsrvinit start                    
41         fi
42         gdb --args Xorg ${XSERVER_OPTIONS}
43 else    
44         if [ "$1" = "--only" ]; then
45                 if [ -x /usr/bin/pvrsrvinit ]; then
46                         pvrsrvinit start
47                 fi
48
49                 Xorg ${XSERVER_OPTIONS} &
50         else
51                 xinit ${XINITRC} -- @PREFIX@/bin/Xorg ${XSERVER_OPTIONS} &
52         fi
53 fi    
54