diff options
author | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 23:57:48 +0000 |
---|---|---|
committer | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 23:57:48 +0000 |
commit | 1bf2ac9712f06f3fac3f25f7abccd31e300687c5 (patch) | |
tree | 7c70615ac6d3d5aa12798b3bd08c21a57fb87728 /build/install-build-deps.sh | |
parent | 985fd8650045c9fb7b27c208fda2f250b2620416 (diff) | |
download | chromium_src-1bf2ac9712f06f3fac3f25f7abccd31e300687c5.zip chromium_src-1bf2ac9712f06f3fac3f25f7abccd31e300687c5.tar.gz chromium_src-1bf2ac9712f06f3fac3f25f7abccd31e300687c5.tar.bz2 |
Don't screw up /usr/bin/ld if you can't write to current dir as root.
BUG=http://crbug.com/15700
TEST=make sure ld is not gold, make sure root can't write to your nfs home directory, copy this script there, run it, let it install gold, verify it aborts early without torching /usr/bin/ld
Review URL: http://codereview.chromium.org/151113
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19683 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/install-build-deps.sh')
-rwxr-xr-x | build/install-build-deps.sh | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index 9b61d8b..de293f9 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh @@ -8,6 +8,15 @@ install_gold() { # Gold is optional; it's a faster replacement for ld, # and makes life on 2GB machines much more pleasant. + # First make sure root can access this directory, as that's tripped up some folks. + if sudo touch xyz.$$ + then + sudo rm xyz.$$ + else + echo root cannot write to the current directory, not installing gold + return + fi + BINUTILS=binutils-2.19.1 BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2 BINUTILS_SHA1=88c91e36cde93433e4c4c2b2e3417777aad84526 @@ -46,16 +55,19 @@ __EOF__ patch -p1 < ../binutils-fix.patch ./configure --prefix=/usr/local/gold --enable-gold make -j3 - sudo make install - - # Still need to figure out graceful way of pointing gyp to use - # /usr/local/gold/bin/ld without requiring him to set environment - # variables. That will go into bootstrap-linux.sh when it's ready. - echo "Installing gold as /usr/bin/ld." - echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'" - test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig - sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold - sudo ln -fs /usr/bin/ld.gold /usr/bin/ld + if sudo make install + then + # Still need to figure out graceful way of pointing gyp to use + # /usr/local/gold/bin/ld without requiring him to set environment + # variables. That will go into bootstrap-linux.sh when it's ready. + echo "Installing gold as /usr/bin/ld." + echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'" + test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig + sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold + sudo ln -fs /usr/bin/ld.gold /usr/bin/ld + else + echo "make install failed, not installing gold" + fi } if ! egrep -q "Ubuntu 8.04|Ubuntu 8.10|Ubuntu 9.04" /etc/issue; then @@ -216,7 +228,7 @@ if [ "$(uname -m)" = x86_64 ]; then Dir::State::Lists "${tmp}/apt/lists/"; Dir::State::status "${tmp}/status"; EOF - + # Download 32bit packages echo "Computing list of available 32bit packages..." apt-get -c="${tmp}/apt/apt.conf" update |