OLD | NEW |
---|---|
(Empty) | |
1 #!/bin/sh | |
2 | |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
4 # Use of this source code is governed by a BSD-style license that can be | |
5 # found in the LICENSE file. | |
6 | |
7 BUILDTYPE=${BUILDTYPE:-"Debug"} | |
8 CHROME_SRC_DIR=${CHROME_SRC_DIR:-$(dirname $(readlink -fn $0))/..} | |
9 CHROME_OUT_DIR="${CHROME_SRC_DIR}/out/${BUILDTYPE}" | |
Lei Zhang
2012/06/05 23:03:18
There's some developers who have custom gyp settin
| |
10 chrome_sandbox_build_path="${CHROME_OUT_DIR}/chrome_sandbox" | |
11 # Make sure the path below is not on NFS! | |
Lei Zhang
2012/06/05 23:03:18
You can check this with:
stat -f -c %t /usr/local/
| |
12 chrome_sandbox_installed_path="/usr/local/sbin/chrome-devel-sandbox" | |
13 | |
14 if [ ! -d "$CHROME_OUT_DIR" ]; then | |
15 echo -n "$CHROME_OUT_DIR does not exist. Use \"BUILDTYPE=Release ${0}\" " | |
16 echo "If you are building in Release mode" | |
17 exit 1 | |
18 fi | |
19 | |
20 if [ ! -f "$chrome_sandbox_build_path" ]; then | |
21 echo -n "Could not find $chrome_sandbox_build_path, " | |
22 echo "please make sure you build the chrome_sandbox target" | |
23 exit 1 | |
24 fi | |
25 | |
26 installsandbox() { | |
27 sudo -- cp "$chrome_sandbox_build_path" "$chrome_sandbox_installed_path" && | |
28 sudo -- chown root:root "$chrome_sandbox_installed_path" && | |
29 sudo -- chmod 4755 "$chrome_sandbox_installed_path" | |
30 return $? | |
31 } | |
32 | |
33 if [ ! -f "$chrome_sandbox_installed_path" ]; then | |
34 echo -n "Could not find $chrome_sandbox_installed_path, " | |
35 echo "installing it now." | |
36 installsandbox | |
37 fi | |
38 | |
39 if [ ! -f "$chrome_sandbox_installed_path" ]; then | |
40 echo "Failed to install $chrome_sandbox_installed_path" | |
41 exit 1 | |
42 fi | |
43 | |
44 current_api=$($chrome_sandbox_build_path --get-api) | |
45 installed_api=$($chrome_sandbox_installed_path --get-api) | |
46 | |
47 if [ x$current_api != x$installed_api ]; then | |
Lei Zhang
2012/06/05 23:03:18
nit: if you use quotes here and on line 56, then y
| |
48 echo -n "Your installed setuid sandbox is too old, installing it now." | |
Lei Zhang
2012/06/05 23:03:18
nit: no need for the " -n"
| |
49 installsandbox | |
50 if [ ! $? = 0 ]; then | |
51 echo "Failed to install $chrome_sandbox_installed_path" | |
52 exit 1 | |
53 fi | |
54 else | |
55 echo "Your setuid sandbox is up to date" | |
56 if [ x$CHROME_DEVEL_SANDBOX != x"$chrome_sandbox_installed_path" ]; then | |
57 echo -n "Make sure you have \"export " | |
58 echo -n "CHROME_DEVEL_SANDBOX=$chrome_sandbox_installed_path\" " | |
59 echo "somewhere in your .bashrc" | |
60 echo "This variable is currently: ${CHROME_DEVEL_SANDBOX:-"empty"}" | |
61 fi | |
62 fi | |
OLD | NEW |