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

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: Warn before using sudo as per Markus request 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!
Lei Zhang 2012/06/06 07:39:33 So do you want to stat /usr/local/sbin ?
jln (very slow on Chromium) 2012/06/06 19:59:08 This comment was more for someone modifying the co
12 CHROME_SANDBOX_INSTALLED_PATH="/usr/local/sbin/chrome-devel-sandbox"
13
14 installsandbox() {
15 echo "(using sudo so you may be asked for your password)"
16 sudo -- cp "${CHROME_SANDBOX_BUILD_PATH}" \
17 "${CHROME_SANDBOX_INSTALLED_PATH}" &&
18 sudo -- chown root:root "${CHROME_SANDBOX_INSTALLED_PATH}" &&
19 sudo -- chmod 4755 "${CHROME_SANDBOX_INSTALLED_PATH}"
20 return $?
21 }
22
23 if [ ! -d "${CHROME_OUT_DIR}" ]; then
24 echo -n "${CHROME_OUT_DIR} does not exist. Use \"BUILDTYPE=Release ${0}\" "
25 echo "If you are building in Release mode"
26 exit 1
27 fi
28
29 if [ ! -f "${CHROME_SANDBOX_BUILD_PATH}" ]; then
30 echo -n "Could not find ${CHROME_SANDBOX_BUILD_PATH}, "
31 echo "please make sure you build the chrome_sandbox target"
32 exit 1
33 fi
34
35 if [ ! -f "${CHROME_SANDBOX_INSTALLED_PATH}" ]; then
36 echo -n "Could not find ${CHROME_SANDBOX_INSTALLED_PATH}, "
37 echo "installing it now."
38 installsandbox
39 fi
40
41 if [ ! -f "${CHROME_SANDBOX_INSTALLED_PATH}" ]; then
42 echo "Failed to install ${CHROME_SANDBOX_INSTALLED_PATH}"
43 exit 1
44 fi
45
46 CURRENT_API=$("${CHROME_SANDBOX_BUILD_PATH}" --get-api)
47 INSTALLED_API=$("${CHROME_SANDBOX_INSTALLED_PATH}" --get-api)
48
49 if [ "${CURRENT_API}" -ne "${INSTALLED_API}" ]; then
Lei Zhang 2012/06/06 07:39:33 nit: Unlike $?, these variables are not guaranteed
jln (very slow on Chromium) 2012/06/06 19:59:08 Done.
50 echo "Your installed setuid sandbox is too old, installing it now."
51 if ! installsandbox; then
52 echo "Failed to install ${CHROME_SANDBOX_INSTALLED_PATH}"
53 exit 1
54 fi
55 else
56 echo "Your setuid sandbox is up to date"
57 if [ "${CHROME_DEVEL_SANDBOX}" != "${CHROME_SANDBOX_INSTALLED_PATH}" ]; then
58 echo -n "Make sure you have \"export "
59 echo -n "CHROME_DEVEL_SANDBOX=${CHROME_SANDBOX_INSTALLED_PATH}\" "
60 echo "somewhere in your .bashrc"
61 echo "This variable is currently: ${CHROME_DEVEL_SANDBOX:-empty}"
62 fi
63 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