Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: build/update-linux-sandbox.sh

Issue 10541017: Add update-linux-sandbox.sh to build/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify if statement Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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}"
10 chrome_sandbox_build_path="${CHROME_OUT_DIR}/chrome_sandbox"
11 # Make sure the path below is not on NFS!
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)
Lei Zhang 2012/06/05 23:07:05 Please double quote $chrome_sandbox_build_path her
45 installed_api=$($chrome_sandbox_installed_path --get-api)
46
47 if [ x$current_api != x$installed_api ]; then
48 echo "Your installed setuid sandbox is too old, installing it now."
49 if ! installsandbox; then
50 echo "Failed to install $chrome_sandbox_installed_path"
51 exit 1
52 fi
53 else
54 echo "Your setuid sandbox is up to date"
55 if [ x$CHROME_DEVEL_SANDBOX != x"$chrome_sandbox_installed_path" ]; then
56 echo -n "Make sure you have \"export "
57 echo -n "CHROME_DEVEL_SANDBOX=$chrome_sandbox_installed_path\" "
58 echo "somewhere in your .bashrc"
59 echo "This variable is currently: ${CHROME_DEVEL_SANDBOX:-"empty"}"
60 fi
61 fi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698