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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 echo | 656 echo |
657 # We prefer running the script in-place, but this might not be | 657 # We prefer running the script in-place, but this might not be |
658 # possible, if it lives on a network filesystem that denies | 658 # possible, if it lives on a network filesystem that denies |
659 # access to root. | 659 # access to root. |
660 tmp_script= | 660 tmp_script= |
661 if ! sudo "${target%bit}" sh -c "[ -x '${script}' ]" >&/dev/null; then | 661 if ! sudo "${target%bit}" sh -c "[ -x '${script}' ]" >&/dev/null; then |
662 tmp_script="/tmp/${script##*/}" | 662 tmp_script="/tmp/${script##*/}" |
663 cp "${script}" "${tmp_script}" | 663 cp "${script}" "${tmp_script}" |
664 fi | 664 fi |
665 # Some distributions automatically start an instance of the system- | 665 # Some distributions automatically start an instance of the system- |
666 # wide dbus daemon or of the logging daemon, when installing the Chrome | 666 # wide dbus daemon, cron daemon or of the logging daemon, when |
667 # build depencies. This prevents the chroot session from being closed. | 667 # installing the Chrome build depencies. This prevents the chroot |
668 # So, we always try to shut down any running instance of dbus and | 668 # session from being closed. So, we always try to shut down any running |
669 # rsyslog. | 669 # instance of dbus and rsyslog. |
670 sudo "${target%bit}" sh -c "${script} --no-lib32; | 670 sudo /usr/local/bin/"${target%bit}" sh -c "${script} --no-lib32; |
671 rc=$?; | 671 rc=$?; |
| 672 /etc/init.d/cron stop >/dev/null 2>&1 || :; |
672 /etc/init.d/rsyslog stop >/dev/null 2>&1 || :; | 673 /etc/init.d/rsyslog stop >/dev/null 2>&1 || :; |
673 /etc/init.d/dbus stop >/dev/null 2>&1 || :; | 674 /etc/init.d/dbus stop >/dev/null 2>&1 || :; |
674 exit $rc" | 675 exit $rc" |
675 rc=$? | 676 rc=$? |
676 [ -n "${tmp_script}" ] && rm -f "${tmp_script}" | 677 [ -n "${tmp_script}" ] && rm -f "${tmp_script}" |
677 [ $rc -ne 0 ] && exit $rc | 678 [ $rc -ne 0 ] && exit $rc |
678 break | 679 break |
679 ;; | 680 ;; |
680 n|N) | 681 n|N) |
681 break | 682 break |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 | 799 |
799 For Chrome, this probably means you want to make your "out" directory a | 800 For Chrome, this probably means you want to make your "out" directory a |
800 symbolic link that points somewhere inside of "${HOME}/chroot". | 801 symbolic link that points somewhere inside of "${HOME}/chroot". |
801 | 802 |
802 You still need to run "gclient runhooks" whenever you switch from building | 803 You still need to run "gclient runhooks" whenever you switch from building |
803 outside of the chroot to inside of the chroot. But you will find that you | 804 outside of the chroot to inside of the chroot. But you will find that you |
804 don't have to repeatedly erase and then completely rebuild all your object | 805 don't have to repeatedly erase and then completely rebuild all your object |
805 and binary files. | 806 and binary files. |
806 | 807 |
807 EOF | 808 EOF |
OLD | NEW |