OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium 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 # Let the wrapped binary know that it has been run through the wrapper. | 7 # Let the wrapped binary know that it has been run through the wrapper. |
8 export CHROME_WRAPPER="`readlink -f "$0"`" | 8 export CHROME_WRAPPER="`readlink -f "$0"`" |
9 | 9 |
10 HERE="`dirname "$CHROME_WRAPPER"`" | 10 HERE="`dirname "$CHROME_WRAPPER"`" |
11 | 11 |
12 # Check if the CPU supports SSE2. If not, try to pop up a dialog to explain the | |
13 # problem and exit. Otherwise the browser will just crash with a SIGILL. | |
14 # http://crbug.com/348761 | |
15 grep ^flags /proc/cpuinfo|grep -qs sse2 | |
16 if [ $? != 0 ]; then | |
17 SSE2_DEPRECATION_MSG="This computer can no longer run Google Chrome because \ | |
18 its hardware is no longer supported." | |
19 if which zenity &> /dev/null; then | |
20 zenity --warning --text="$SSE2_DEPRECATION_MSG" | |
21 elif which gmessage &> /dev/null; then | |
22 gmessage "$SSE2_DEPRECATION_MSG" | |
23 elif which xmessage &> /dev/null; then | |
24 xmessage "$SSE2_DEPRECATION_MSG" | |
25 else | |
26 echo "$SSE2_DEPRECATION_MSG" 1>&2 | |
Nico
2016/05/09 21:29:37
should we have a check for "can this computer run
| |
27 fi | |
28 exit 1 | |
29 fi | |
30 | |
31 # We include some xdg utilities next to the binary, and we want to prefer them | 12 # We include some xdg utilities next to the binary, and we want to prefer them |
32 # over the system versions when we know the system versions are very old. We | 13 # over the system versions when we know the system versions are very old. We |
33 # detect whether the system xdg utilities are sufficiently new to be likely to | 14 # detect whether the system xdg utilities are sufficiently new to be likely to |
34 # work for us by looking for xdg-settings. If we find it, we leave $PATH alone, | 15 # work for us by looking for xdg-settings. If we find it, we leave $PATH alone, |
35 # so that the system xdg utilities (including any distro patches) will be used. | 16 # so that the system xdg utilities (including any distro patches) will be used. |
36 if ! which xdg-settings &> /dev/null; then | 17 if ! which xdg-settings &> /dev/null; then |
37 # Old xdg utilities. Prepend $HERE to $PATH to use ours instead. | 18 # Old xdg utilities. Prepend $HERE to $PATH to use ours instead. |
38 export PATH="$HERE:$PATH" | 19 export PATH="$HERE:$PATH" |
39 else | 20 else |
40 # Use system xdg utilities. But first create mimeapps.list if it doesn't | 21 # Use system xdg utilities. But first create mimeapps.list if it doesn't |
(...skipping 25 matching lines...) Expand all Loading... | |
66 | 47 |
67 # Make sure that the profile directory specified in the environment, if any, | 48 # Make sure that the profile directory specified in the environment, if any, |
68 # overrides the default. | 49 # overrides the default. |
69 if [[ -n "$CHROME_USER_DATA_DIR" ]]; then | 50 if [[ -n "$CHROME_USER_DATA_DIR" ]]; then |
70 # Note: exec -a below is a bashism. | 51 # Note: exec -a below is a bashism. |
71 exec -a "$0" "$HERE/@@PROGNAME@@" @@DEFAULT_FLAGS@@ \ | 52 exec -a "$0" "$HERE/@@PROGNAME@@" @@DEFAULT_FLAGS@@ \ |
72 --user-data-dir="$CHROME_USER_DATA_DIR" "$@" | 53 --user-data-dir="$CHROME_USER_DATA_DIR" "$@" |
73 else | 54 else |
74 exec -a "$0" "$HERE/@@PROGNAME@@" @@DEFAULT_FLAGS@@ "$@" | 55 exec -a "$0" "$HERE/@@PROGNAME@@" @@DEFAULT_FLAGS@@ "$@" |
75 fi | 56 fi |
OLD | NEW |