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

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: Address review comments 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 BUILDTYPE=${BUILDTYPE:-"Debug"}
cmp 2012/06/05 22:54:20 nit: really the empty line should happen before BU
jln (very slow on Chromium) 2012/06/05 23:01:44 I think there was a race condition, I had already
7 CHROME_SRC_DIR=${CHROME_SRC_DIR:-$(dirname $(readlink -fn $0))/..}
8 CHROME_OUT_DIR="${CHROME_SRC_DIR}/out/${BUILDTYPE}"
9 chrome_sandbox_build_path="${CHROME_OUT_DIR}/chrome_sandbox"
10 # Make sure the path below is not on NFS!
11 chrome_sandbox_installed_path="/usr/local/sbin/chrome-devel-sandbox"
12
13 if [ ! -d "$CHROME_OUT_DIR" ]; then
14 echo -n "$CHROME_OUT_DIR does not exist. Use \"BUILDTYPE=Release ${0}\" "
15 echo "If you are building in Release mode"
16 exit 1
17 fi
18
19 if [ ! -f "$chrome_sandbox_build_path" ]; then
20 echo -n "Could not find $chrome_sandbox_build_path, "
21 echo "please make sure you build the chrome_sandbox target"
22 exit 1
23 fi
24
25 installsandbox() {
26 sudo -- cp "$chrome_sandbox_build_path" "$chrome_sandbox_installed_path" &&
27 sudo -- chown root:root "$chrome_sandbox_installed_path" &&
28 sudo -- chmod 4755 "$chrome_sandbox_installed_path"
29 return $?
30 }
31
32 if [ ! -f "$chrome_sandbox_installed_path" ]; then
33 echo -n "Could not find $chrome_sandbox_installed_path, "
34 echo "installing it now."
35 installsandbox
36 fi
37
38 if [ ! -f "$chrome_sandbox_installed_path" ]; then
39 echo "Failed to install $chrome_sandbox_installed_path"
40 exit 1
41 fi
42
43 current_api=$($chrome_sandbox_build_path --get-api)
44 installed_api=$($chrome_sandbox_installed_path --get-api)
45
46 if [ x$current_api != x$installed_api ]; then
47 echo -n "Your installed setuid sandbox is too old, installing it now."
48 installsandbox
49 if [ ! $? = 0 ]; then
cmp 2012/06/05 22:54:20 i believe lines 48-49 can be simplified as: if ! i
jln (very slow on Chromium) 2012/06/05 23:01:44 Done, thanks.
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