| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 XAUTH=/usr/bin/xauth | 7 XAUTH=/usr/bin/xauth |
| 8 XAUTH_FILE="/var/run/factory_ui.auth" | 8 XAUTH_FILE="/var/run/factory_ui.auth" |
| 9 SERVER_READY= | 9 SERVER_READY= |
| 10 DISPLAY=":0" | 10 DISPLAY=":0" |
| 11 | 11 |
| 12 user1_handler () { | 12 user1_handler () { |
| 13 echo "X server ready..." 1>&2 | 13 echo "X server ready..." 1>&2 |
| 14 SERVER_READY=y | 14 SERVER_READY=y |
| 15 } | 15 } |
| 16 | 16 |
| 17 trap user1_handler USR1 | 17 trap user1_handler USR1 |
| 18 MCOOKIE=$(head -c 8 /dev/urandom | openssl md5) | 18 MCOOKIE=$(head -c 8 /dev/urandom | openssl md5) |
| 19 ${XAUTH} -q -f ${XAUTH_FILE} add ${DISPLAY} . ${MCOOKIE} | 19 ${XAUTH} -q -f ${XAUTH_FILE} add ${DISPLAY} . ${MCOOKIE} |
| 20 | 20 |
| 21 /sbin/xstart.sh ${XAUTH_FILE} & | 21 /bin/sh -c "\ |
| 22 trap '' USR1 TTOU TTIN |
| 23 exec /usr/bin/X11/X -nolisten tcp vt01 -auth ${XAUTH_FILE} \ |
| 24 -s 0 -p 0 -dpms 2> /dev/null" & |
| 22 | 25 |
| 23 while [ -z ${SERVER_READY} ]; do | 26 while [ -z ${SERVER_READY} ]; do |
| 24 sleep .1 | 27 sleep .1 |
| 25 done | 28 done |
| 26 | 29 |
| 27 /sbin/initctl emit factory-ui-started | 30 /sbin/initctl emit factory-ui-started |
| 28 cat /proc/uptime > /tmp/uptime-x-started | 31 cat /proc/uptime > /tmp/uptime-x-started |
| 29 | 32 |
| 30 echo "DISPLAY=${DISPLAY}; export DISPLAY" | 33 echo "export DISPLAY=${DISPLAY}" |
| 31 echo "XAUTHORITY=${XAUTH_FILE}; export XAUTHORITY" | 34 echo "export XAUTHORITY=${XAUTH_FILE}" |
| OLD | NEW |