Chromium Code Reviews| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 mkdir -p ${LOGIN_PROFILE_DIR} | 60 mkdir -p ${LOGIN_PROFILE_DIR} |
| 61 mount -n -t tmpfs -onodev,noexec,nosuid loginprofile ${LOGIN_PROFILE_DIR} | 61 mount -n -t tmpfs -onodev,noexec,nosuid loginprofile ${LOGIN_PROFILE_DIR} |
| 62 chown ${USER}:${USER} ${LOGIN_PROFILE_DIR} | 62 chown ${USER}:${USER} ${LOGIN_PROFILE_DIR} |
| 63 | 63 |
| 64 # temporary hack to tell cryptohome that we're doing chrome-login | 64 # temporary hack to tell cryptohome that we're doing chrome-login |
| 65 touch /tmp/doing-chrome-login | 65 touch /tmp/doing-chrome-login |
| 66 | 66 |
| 67 CHROME_DIR="/opt/google/chrome" | 67 CHROME_DIR="/opt/google/chrome" |
| 68 CHROME="$CHROME_DIR/chrome" | 68 CHROME="$CHROME_DIR/chrome" |
| 69 COOKIE_PIPE="/tmp/cookie_pipe" | 69 COOKIE_PIPE="/tmp/cookie_pipe" |
| 70 SEND_METRICS="/etc/send_metrics" | |
| 71 CONSENT_FILE="$DATA_DIR/Consent To Send Stats" | |
|
djmm
2010/03/18 19:48:53
Filename with spaces?
Chris Masone
2010/03/18 19:57:07
Yup.
That's what Chrome expects.
| |
| 70 | 72 |
| 71 # xdg-open is used to open downloaded files. | 73 # xdg-open is used to open downloaded files. |
| 72 # It runs sensible-browser, which uses $BROWSER. | 74 # It runs sensible-browser, which uses $BROWSER. |
| 73 export BROWSER=${CHROME} | 75 export BROWSER=${CHROME} |
| 74 | 76 |
| 75 USER_ID=$(/usr/bin/id -u ${USER}) | 77 USER_ID=$(/usr/bin/id -u ${USER}) |
| 76 | 78 |
| 77 SKIP_OOBE= | 79 SKIP_OOBE= |
| 78 # For test automation. If file exists, do not remember last username and skip | 80 # For test automation. If file exists, do not remember last username and skip |
| 79 # out-of-box-experience windows except the login window | 81 # out-of-box-experience windows except the login window |
| 80 if [ -f /root/.forget_usernames ] ; then | 82 if [ -f /root/.forget_usernames ] ; then |
| 81 rm -f "${DATA_DIR}/Local State" | 83 rm -f "${DATA_DIR}/Local State" |
| 82 SKIP_OOBE="--login-screen=login" | 84 SKIP_OOBE="--login-screen=login" |
| 83 fi | 85 fi |
| 84 | 86 |
| 85 # Enables gathering of chrome dumps. In stateful partition so testers | 87 # Enables gathering of chrome dumps. In stateful partition so testers |
| 86 # can enable getting core dumps after build time. | 88 # can enable getting core dumps after build time. |
| 87 if [ -f /mnt/stateful_partition/etc/enable_chromium_coredumps ] ; then | 89 if [ -f /mnt/stateful_partition/etc/enable_chromium_coredumps ] ; then |
| 88 mkdir -p /mnt/stateful_partition/var/coredumps/ | 90 mkdir -p /mnt/stateful_partition/var/coredumps/ |
| 89 # Chrome runs and chronos so we need to change the permissions of this folder | 91 # Chrome runs and chronos so we need to change the permissions of this folder |
| 90 # so it can write there when it crashes | 92 # so it can write there when it crashes |
| 91 chown chronos /mnt/stateful_partition/var/coredumps/ | 93 chown chronos /mnt/stateful_partition/var/coredumps/ |
| 92 ulimit -c unlimited | 94 ulimit -c unlimited |
| 93 echo "/mnt/stateful_partition/var/coredumps/core.%e.%p" > \ | 95 echo "/mnt/stateful_partition/var/coredumps/core.%e.%p" > \ |
| 94 /proc/sys/kernel/core_pattern | 96 /proc/sys/kernel/core_pattern |
| 95 fi | 97 fi |
| 96 | 98 |
| 99 if [ -f "$SEND_METRICS" ]; then | |
| 100 if [ ! -f "$CONSENT_FILE" ]; then | |
| 101 # Automatically opt-in to Chrome OS stats collecting. This does | |
| 102 # not have to be a cryptographically random string, but we do need | |
| 103 # a 32 byte, printable string. | |
| 104 head -c 8 /dev/random | openssl md5 > "$CONSENT_FILE" | |
| 105 fi | |
| 106 fi | |
| 107 | |
| 97 while [ -z ${SERVER_READY} ]; do | 108 while [ -z ${SERVER_READY} ]; do |
| 98 sleep .1 | 109 sleep .1 |
| 99 done | 110 done |
| 100 | 111 |
| 101 # TODO: consider moving this when we start X in a different way. | 112 # TODO: consider moving this when we start X in a different way. |
| 102 /sbin/initctl emit x-started& | 113 /sbin/initctl emit x-started& |
| 103 | 114 |
| 104 exec /sbin/session_manager --uid=${USER_ID} --login -- \ | 115 exec /sbin/session_manager --uid=${USER_ID} --login -- \ |
| 105 $CHROME --enable-gview \ | 116 $CHROME --enable-gview \ |
| 106 --enable-sync \ | 117 --enable-sync \ |
| 107 --log-level=0 \ | 118 --log-level=0 \ |
| 108 --main-menu-url="http://welcome-cros.appspot.com/menu" \ | 119 --main-menu-url="http://welcome-cros.appspot.com/menu" \ |
| 109 --no-first-run \ | 120 --no-first-run \ |
| 110 --user-data-dir=/home/$USER \ | 121 --user-data-dir=/home/$USER \ |
| 111 --profile=user \ | 122 --profile=user \ |
| 112 "--cookie-pipe=$COOKIE_PIPE" \ | 123 "--cookie-pipe=$COOKIE_PIPE" \ |
| 113 "${SKIP_OOBE}" | 124 "${SKIP_OOBE}" |
| OLD | NEW |