media/webrtc/trunk/build/update-linux-sandbox.sh

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 #!/bin/sh
michael@0 2
michael@0 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
michael@0 4 # Use of this source code is governed by a BSD-style license that can be
michael@0 5 # found in the LICENSE file.
michael@0 6
michael@0 7 BUILDTYPE="${BUILDTYPE:-Debug}"
michael@0 8 CHROME_SRC_DIR="${CHROME_SRC_DIR:-$(dirname -- $(readlink -fn -- "$0"))/..}"
michael@0 9 CHROME_OUT_DIR="${CHROME_SRC_DIR}/out/${BUILDTYPE}"
michael@0 10 CHROME_SANDBOX_BUILD_PATH="${CHROME_OUT_DIR}/chrome_sandbox"
michael@0 11 CHROME_SANDBOX_INST_PATH="/usr/local/sbin/chrome-devel-sandbox"
michael@0 12 CHROME_SANDBOX_INST_DIR=$(dirname -- "$CHROME_SANDBOX_INST_PATH")
michael@0 13
michael@0 14 TARGET_DIR_TYPE=$(stat -f -c %t -- "${CHROME_SANDBOX_INST_DIR}" 2>/dev/null)
michael@0 15 if [ $? -ne 0 ]; then
michael@0 16 echo "Could not get status of ${CHROME_SANDBOX_INST_DIR}"
michael@0 17 exit 1
michael@0 18 fi
michael@0 19
michael@0 20 # Make sure the path is not on NFS.
michael@0 21 if [ "${TARGET_DIR_TYPE}" = "6969" ]; then
michael@0 22 echo "Please make sure ${CHROME_SANDBOX_INST_PATH} is not on NFS!"
michael@0 23 exit 1
michael@0 24 fi
michael@0 25
michael@0 26 installsandbox() {
michael@0 27 echo "(using sudo so you may be asked for your password)"
michael@0 28 sudo -- cp "${CHROME_SANDBOX_BUILD_PATH}" \
michael@0 29 "${CHROME_SANDBOX_INST_PATH}" &&
michael@0 30 sudo -- chown root:root "${CHROME_SANDBOX_INST_PATH}" &&
michael@0 31 sudo -- chmod 4755 "${CHROME_SANDBOX_INST_PATH}"
michael@0 32 return $?
michael@0 33 }
michael@0 34
michael@0 35 if [ ! -d "${CHROME_OUT_DIR}" ]; then
michael@0 36 echo -n "${CHROME_OUT_DIR} does not exist. Use \"BUILDTYPE=Release ${0}\" "
michael@0 37 echo "If you are building in Release mode"
michael@0 38 exit 1
michael@0 39 fi
michael@0 40
michael@0 41 if [ ! -f "${CHROME_SANDBOX_BUILD_PATH}" ]; then
michael@0 42 echo -n "Could not find ${CHROME_SANDBOX_BUILD_PATH}, "
michael@0 43 echo "please make sure you build the chrome_sandbox target"
michael@0 44 exit 1
michael@0 45 fi
michael@0 46
michael@0 47 if [ ! -f "${CHROME_SANDBOX_INST_PATH}" ]; then
michael@0 48 echo -n "Could not find ${CHROME_SANDBOX_INST_PATH}, "
michael@0 49 echo "installing it now."
michael@0 50 installsandbox
michael@0 51 fi
michael@0 52
michael@0 53 if [ ! -f "${CHROME_SANDBOX_INST_PATH}" ]; then
michael@0 54 echo "Failed to install ${CHROME_SANDBOX_INST_PATH}"
michael@0 55 exit 1
michael@0 56 fi
michael@0 57
michael@0 58 CURRENT_API=$("${CHROME_SANDBOX_BUILD_PATH}" --get-api)
michael@0 59 INSTALLED_API=$("${CHROME_SANDBOX_INST_PATH}" --get-api)
michael@0 60
michael@0 61 if [ "${CURRENT_API}" != "${INSTALLED_API}" ]; then
michael@0 62 echo "Your installed setuid sandbox is too old, installing it now."
michael@0 63 if ! installsandbox; then
michael@0 64 echo "Failed to install ${CHROME_SANDBOX_INST_PATH}"
michael@0 65 exit 1
michael@0 66 fi
michael@0 67 else
michael@0 68 echo "Your setuid sandbox is up to date"
michael@0 69 if [ "${CHROME_DEVEL_SANDBOX}" != "${CHROME_SANDBOX_INST_PATH}" ]; then
michael@0 70 echo -n "Make sure you have \"export "
michael@0 71 echo -n "CHROME_DEVEL_SANDBOX=${CHROME_SANDBOX_INST_PATH}\" "
michael@0 72 echo "somewhere in your .bashrc"
michael@0 73 echo "This variable is currently: ${CHROME_DEVEL_SANDBOX:-empty}"
michael@0 74 fi
michael@0 75 fi

mercurial