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

Side by Side Diff: build/install-chroot.sh

Issue 3775010: Detect available lib64readline version before trying to install in chroot. (Closed)
Patch Set: review cleanups Created 10 years, 2 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
« 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
1 #!/bin/bash -e 1 #!/bin/bash -e
2 2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # This script installs Debian-derived distributions in a chroot environment. 7 # This script installs Debian-derived distributions in a chroot environment.
8 # It can for example be used to have an accurate 32bit build and test 8 # It can for example be used to have an accurate 32bit build and test
9 # environment when otherwise working on a 64bit machine. 9 # environment when otherwise working on a 64bit machine.
10 # N. B. it is unlikely that this script will ever work on anything other than a 10 # N. B. it is unlikely that this script will ever work on anything other than a
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 echo '"'$(id -nu) ALL=(ALL) ALL'"' >>/etc/sudoers' 249 echo '"'$(id -nu) ALL=(ALL) ALL'"' >>/etc/sudoers'
250 250
251 # Install a few more commonly used packages 251 # Install a few more commonly used packages
252 sudo schroot -c "${target%bit}" -p -- apt-get -y install \ 252 sudo schroot -c "${target%bit}" -p -- apt-get -y install \
253 autoconf automake1.9 dpkg-dev g++-multilib gcc-multilib gdb less libtool \ 253 autoconf automake1.9 dpkg-dev g++-multilib gcc-multilib gdb less libtool \
254 strace 254 strace
255 255
256 # If running a 32bit environment on a 64bit machine, install a few binaries 256 # If running a 32bit environment on a 64bit machine, install a few binaries
257 # as 64bit. 257 # as 64bit.
258 if [ "${arch}" = 32bit ] && file /bin/bash 2>/dev/null | grep -q x86-64; then 258 if [ "${arch}" = 32bit ] && file /bin/bash 2>/dev/null | grep -q x86-64; then
259 readlinepkg=$(sudo schroot -c "${target%bit}" -p -- sh -c \
260 'apt-cache search "lib64readline.\$" | sort | tail -n 1 | cut -d " " -f 1')
259 sudo schroot -c "${target%bit}" -p -- apt-get -y install \ 261 sudo schroot -c "${target%bit}" -p -- apt-get -y install \
260 lib64expat1 lib64ncurses5 lib64readline6 lib64z1 262 lib64expat1 lib64ncurses5 ${readlinepkg} lib64z1
261 dep= 263 dep=
262 for i in binutils gdb strace; do 264 for i in binutils gdb strace; do
263 [ -d /usr/share/doc/"$i" ] || dep="$dep $i" 265 [ -d /usr/share/doc/"$i" ] || dep="$dep $i"
264 done 266 done
265 [ -n "$dep" ] && sudo apt-get -y install $dep 267 [ -n "$dep" ] && sudo apt-get -y install $dep
266 sudo cp /usr/bin/gdb "/var/lib/chroot/${target}/usr/local/bin/" 268 sudo cp /usr/bin/gdb "/var/lib/chroot/${target}/usr/local/bin/"
267 sudo cp /usr/bin/ld "/var/lib/chroot/${target}/usr/local/bin/" 269 sudo cp /usr/bin/ld "/var/lib/chroot/${target}/usr/local/bin/"
268 for i in libbfd libpython; do 270 for i in libbfd libpython; do
269 lib="$({ ldd /usr/bin/ld; ldd /usr/bin/gdb; } | 271 lib="$({ ldd /usr/bin/ld; ldd /usr/bin/gdb; } |
270 grep "$i" | awk '{ print $3 }')" 272 grep "$i" | awk '{ print $3 }')"
(...skipping 18 matching lines...) Expand all
289 291
290 Successfully installed ${distname} ${arch} 292 Successfully installed ${distname} ${arch}
291 293
292 You can run programs inside of the chroot by invoking the "${target%bit}" 294 You can run programs inside of the chroot by invoking the "${target%bit}"
293 command. 295 command.
294 296
295 Your home directory is shared between the host and the chroot. But I configured 297 Your home directory is shared between the host and the chroot. But I configured
296 $HOME/chroot to be private to the chroot environment. You can use it 298 $HOME/chroot to be private to the chroot environment. You can use it
297 for files that need to differ between environments. 299 for files that need to differ between environments.
298 EOF 300 EOF
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