| 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/chromelogin.auth" | 8 XAUTH_FILE="/var/run/chromelogin.auth" |
| 9 SERVER_READY= | 9 SERVER_READY= |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 export USER=chronos | 22 export USER=chronos |
| 23 export DATA_DIR=/home/${USER} | 23 export DATA_DIR=/home/${USER} |
| 24 export LOGNAME=${USER} | 24 export LOGNAME=${USER} |
| 25 export SHELL=/bin/bash | 25 export SHELL=/bin/bash |
| 26 export HOME=${DATA_DIR}/user | 26 export HOME=${DATA_DIR}/user |
| 27 export DISPLAY=:0.0 | 27 export DISPLAY=:0.0 |
| 28 export PATH=/bin:/usr/bin:/usr/local/bin:/usr/bin/X11 | 28 export PATH=/bin:/usr/bin:/usr/local/bin:/usr/bin/X11 |
| 29 export GTK_IM_MODULE=ibus | 29 export GTK_IM_MODULE=ibus |
| 30 | 30 |
| 31 # Forces Chrome mini dumps that are sent to the crash server to also be written |
| 32 # locally. Chrome by default will create these mini dump files in |
| 33 # ~/.config/google-chrome/Crash Reports/ |
| 34 if [ -f /mnt/stateful_partition/etc/enable_chromium_minidumps ] ; then |
| 35 export CHROME_HEADLESS=1 |
| 36 # If possible we would like to have the crash reports located somewhere else |
| 37 if [ ! -f ~/.config/google-chrome/Crash\ Reports ] ; then |
| 38 mkdir -p /mnt/stateful_partition/var/minidumps/ |
| 39 chown chronos /mnt/stateful_partition/var/minidumps/ |
| 40 ln -s /mnt/stateful_partition/var/minidumps/ \ |
| 41 ~/.config/google-chrome/Crash\ Reports |
| 42 fi |
| 43 fi |
| 44 |
| 31 XAUTH_FILE=${DATA_DIR}/.Xauthority | 45 XAUTH_FILE=${DATA_DIR}/.Xauthority |
| 32 export XAUTHORITY=${XAUTH_FILE} | 46 export XAUTHORITY=${XAUTH_FILE} |
| 33 | 47 |
| 34 mkdir -p ${DATA_DIR} && chown ${USER}:${USER} ${DATA_DIR} | 48 mkdir -p ${DATA_DIR} && chown ${USER}:${USER} ${DATA_DIR} |
| 35 mkdir -p ${HOME} && chown ${USER}:${USER} ${HOME} | 49 mkdir -p ${HOME} && chown ${USER}:${USER} ${HOME} |
| 36 ${XAUTH} -q -f ${XAUTH_FILE} add :0 . ${MCOOKIE} && \ | 50 ${XAUTH} -q -f ${XAUTH_FILE} add :0 . ${MCOOKIE} && \ |
| 37 chown ${USER}:${USER} ${XAUTH_FILE} | 51 chown ${USER}:${USER} ${XAUTH_FILE} |
| 38 | 52 |
| 39 # temporary hack to tell cryptohome that we're doing chrome-login | 53 # temporary hack to tell cryptohome that we're doing chrome-login |
| 40 touch /tmp/doing-chrome-login | 54 touch /tmp/doing-chrome-login |
| (...skipping 19 matching lines...) Expand all Loading... |
| 60 # For test automation. If file exists, do not remember last username and skip | 74 # For test automation. If file exists, do not remember last username and skip |
| 61 # out-of-box-experience windows except the login window | 75 # out-of-box-experience windows except the login window |
| 62 if [ -f /root/.forget_usernames ] ; then | 76 if [ -f /root/.forget_usernames ] ; then |
| 63 rm -f "${DATA_DIR}/Local State" | 77 rm -f "${DATA_DIR}/Local State" |
| 64 SKIP_OOBE="--login-screen=login" | 78 SKIP_OOBE="--login-screen=login" |
| 65 fi | 79 fi |
| 66 | 80 |
| 67 # Enables gathering of chrome dumps. In stateful partition so testers | 81 # Enables gathering of chrome dumps. In stateful partition so testers |
| 68 # can enable getting core dumps after build time. | 82 # can enable getting core dumps after build time. |
| 69 if [ -f /mnt/stateful_partition/etc/enable_chromium_coredumps ] ; then | 83 if [ -f /mnt/stateful_partition/etc/enable_chromium_coredumps ] ; then |
| 70 mkdir -p /mnt/stateful_partition/var/crash/ | 84 mkdir -p /mnt/stateful_partition/var/coredumps/ |
| 71 # Chrome runs and chronos so we need to change the permissions of this folder | 85 # Chrome runs and chronos so we need to change the permissions of this folder |
| 72 # so it can write there when it crashes | 86 # so it can write there when it crashes |
| 73 chown chronos /mnt/stateful_partition/var/crash/ | 87 chown chronos /mnt/stateful_partition/var/coredumps/ |
| 74 ulimit -c unlimited | 88 ulimit -c unlimited |
| 75 echo "/mnt/stateful_partition/var/crash/core.%e.%p" > \ | 89 echo "/mnt/stateful_partition/var/coredumps/core.%e.%p" > \ |
| 76 /proc/sys/kernel/core_pattern | 90 /proc/sys/kernel/core_pattern |
| 77 fi | 91 fi |
| 78 | 92 |
| 79 exec /sbin/session_manager --uid=${USER_ID} --login -- \ | 93 exec /sbin/session_manager --uid=${USER_ID} --login -- \ |
| 80 $CHROME --enable-gview \ | 94 $CHROME --enable-gview \ |
| 81 --enable-sync \ | 95 --enable-sync \ |
| 82 --log-level=0 \ | 96 --log-level=0 \ |
| 83 --main-menu-url="http://welcome-cros.appspot.com/menu" \ | 97 --main-menu-url="http://welcome-cros.appspot.com/menu" \ |
| 84 --no-first-run \ | 98 --no-first-run \ |
| 85 --user-data-dir=/home/$USER \ | 99 --user-data-dir=/home/$USER \ |
| 86 --profile=user \ | 100 --profile=user \ |
| 87 "--cookie-pipe=$COOKIE_PIPE" \ | 101 "--cookie-pipe=$COOKIE_PIPE" \ |
| 88 "${SKIP_OOBE}" | 102 "${SKIP_OOBE}" |
| OLD | NEW |