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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 632 } |
633 | 633 |
634 # Configure "sudo" package | 634 # Configure "sudo" package |
635 sudo "/usr/local/bin/${target%bit}" /bin/sh -c ' | 635 sudo "/usr/local/bin/${target%bit}" /bin/sh -c ' |
636 egrep -qs '"'^$(id -nu) '"' /etc/sudoers || | 636 egrep -qs '"'^$(id -nu) '"' /etc/sudoers || |
637 echo '"'$(id -nu) ALL=(ALL) ALL'"' >>/etc/sudoers' | 637 echo '"'$(id -nu) ALL=(ALL) ALL'"' >>/etc/sudoers' |
638 | 638 |
639 # Install a few more commonly used packages | 639 # Install a few more commonly used packages |
640 sudo "/usr/local/bin/${target%bit}" apt-get -y install \ | 640 sudo "/usr/local/bin/${target%bit}" apt-get -y install \ |
641 autoconf automake1.9 dpkg-dev g++-multilib gcc-multilib gdb less libtool \ | 641 autoconf automake1.9 dpkg-dev g++-multilib gcc-multilib gdb less libtool \ |
642 strace | 642 lsof strace |
643 | 643 |
644 # If running a 32bit environment on a 64bit machine, install a few binaries | 644 # If running a 32bit environment on a 64bit machine, install a few binaries |
645 # as 64bit. This is only done automatically if the chroot distro is the same as | 645 # as 64bit. This is only done automatically if the chroot distro is the same as |
646 # the host, otherwise there might be incompatibilities in build settings or | 646 # the host, otherwise there might be incompatibilities in build settings or |
647 # runtime dependencies. The user can force it with the '-c' flag. | 647 # runtime dependencies. The user can force it with the '-c' flag. |
648 host_distro=$(grep -s DISTRIB_CODENAME /etc/lsb-release | \ | 648 host_distro=$(grep -s DISTRIB_CODENAME /etc/lsb-release | \ |
649 cut -d "=" -f 2) | 649 cut -d "=" -f 2) |
650 if [ "${copy_64}" = "y" -o \ | 650 if [ "${copy_64}" = "y" -o \ |
651 "${host_distro}" = "${distname}" -a "${arch}" = 32bit ] && \ | 651 "${host_distro}" = "${distname}" -a "${arch}" = 32bit ] && \ |
652 file /bin/bash 2>/dev/null | grep -q x86-64; then | 652 file /bin/bash 2>/dev/null | grep -q x86-64; then |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 | 843 |
844 For Chrome, this probably means you want to make your "out" directory a | 844 For Chrome, this probably means you want to make your "out" directory a |
845 symbolic link that points somewhere inside of "${HOME}/chroot". | 845 symbolic link that points somewhere inside of "${HOME}/chroot". |
846 | 846 |
847 You still need to run "gclient runhooks" whenever you switch from building | 847 You still need to run "gclient runhooks" whenever you switch from building |
848 outside of the chroot to inside of the chroot. But you will find that you | 848 outside of the chroot to inside of the chroot. But you will find that you |
849 don't have to repeatedly erase and then completely rebuild all your object | 849 don't have to repeatedly erase and then completely rebuild all your object |
850 and binary files. | 850 and binary files. |
851 | 851 |
852 EOF | 852 EOF |
OLD | NEW |