OLD | NEW |
1 #!/bin/bash -e | 1 #!/bin/bash -e |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 # the host, otherwise there might be incompatibilities in build settings or | 652 # the host, otherwise there might be incompatibilities in build settings or |
653 # runtime dependencies. The user can force it with the '-c' flag. | 653 # runtime dependencies. The user can force it with the '-c' flag. |
654 host_distro=$(grep -s DISTRIB_CODENAME /etc/lsb-release | \ | 654 host_distro=$(grep -s DISTRIB_CODENAME /etc/lsb-release | \ |
655 cut -d "=" -f 2) | 655 cut -d "=" -f 2) |
656 if [ "${copy_64}" = "y" -o \ | 656 if [ "${copy_64}" = "y" -o \ |
657 "${host_distro}" = "${distname}" -a "${arch}" = 32bit ] && \ | 657 "${host_distro}" = "${distname}" -a "${arch}" = 32bit ] && \ |
658 file /bin/bash 2>/dev/null | grep -q x86-64; then | 658 file /bin/bash 2>/dev/null | grep -q x86-64; then |
659 readlinepkg=$(sudo "/usr/local/bin/${target%bit}" sh -c \ | 659 readlinepkg=$(sudo "/usr/local/bin/${target%bit}" sh -c \ |
660 'apt-cache search "lib64readline.\$" | sort | tail -n 1 | cut -d " " -f 1') | 660 'apt-cache search "lib64readline.\$" | sort | tail -n 1 | cut -d " " -f 1') |
661 sudo "/usr/local/bin/${target%bit}" apt-get -y install \ | 661 sudo "/usr/local/bin/${target%bit}" apt-get -y install \ |
662 lib64expat1 lib64ncurses5 ${readlinepkg} lib64z1 | 662 lib64expat1 lib64ncurses5 ${readlinepkg} lib64z1 lib64stdc++6 |
663 dep= | 663 dep= |
664 for i in binutils gdb; do | 664 for i in binutils gdb; do |
665 [ -d /usr/share/doc/"$i" ] || dep="$dep $i" | 665 [ -d /usr/share/doc/"$i" ] || dep="$dep $i" |
666 done | 666 done |
667 [ -n "$dep" ] && sudo apt-get -y install $dep | 667 [ -n "$dep" ] && sudo apt-get -y install $dep |
668 sudo mkdir -p "/var/lib/chroot/${target}/usr/local/lib/amd64" | 668 sudo mkdir -p "/var/lib/chroot/${target}/usr/local/lib/amd64" |
669 for i in libbfd libpython; do | 669 for i in libbfd libpython; do |
670 lib="$({ ldd /usr/bin/ld; ldd /usr/bin/gdb; } | | 670 lib="$({ ldd /usr/bin/ld; ldd /usr/bin/gdb; } | |
671 grep -s "$i" | awk '{ print $3 }')" | 671 grep -s "$i" | awk '{ print $3 }')" |
672 if [ -n "$lib" -a -r "$lib" ]; then | 672 if [ -n "$lib" -a -r "$lib" ]; then |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 | 849 |
850 For Chrome, this probably means you want to make your "out" directory a | 850 For Chrome, this probably means you want to make your "out" directory a |
851 symbolic link that points somewhere inside of "${HOME}/chroot". | 851 symbolic link that points somewhere inside of "${HOME}/chroot". |
852 | 852 |
853 You still need to run "gclient runhooks" whenever you switch from building | 853 You still need to run "gclient runhooks" whenever you switch from building |
854 outside of the chroot to inside of the chroot. But you will find that you | 854 outside of the chroot to inside of the chroot. But you will find that you |
855 don't have to repeatedly erase and then completely rebuild all your object | 855 don't have to repeatedly erase and then completely rebuild all your object |
856 and binary files. | 856 and binary files. |
857 | 857 |
858 EOF | 858 EOF |
OLD | NEW |