| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS 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 sets up an Ubuntu chroot environment. The ideas come | 7 # This script sets up an Ubuntu chroot environment. The ideas come |
| 8 # from https://wiki.ubuntu.com/DebootstrapChroot and conversations with | 8 # from https://wiki.ubuntu.com/DebootstrapChroot and conversations with |
| 9 # tedbo. The script is passed the path to an empty folder, which will be | 9 # tedbo. The script is passed the path to an empty folder, which will be |
| 10 # populated with the files to form an Ubuntu Jaunty system with the packages | 10 # populated with the files to form an Ubuntu Jaunty system with the packages |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 fi | 186 fi |
| 187 | 187 |
| 188 # Install additional packages | 188 # Install additional packages |
| 189 echo "Installing additional packages..." | 189 echo "Installing additional packages..." |
| 190 in_chroot apt-get update | 190 in_chroot apt-get update |
| 191 bash_chroot "export DEBIAN_FRONTEND=noninteractive LANG=C && \ | 191 bash_chroot "export DEBIAN_FRONTEND=noninteractive LANG=C && \ |
| 192 apt-get --yes --force-yes install $COMPONENTS" | 192 apt-get --yes --force-yes install $COMPONENTS" |
| 193 | 193 |
| 194 echo "Installing chromiumos-build tool..." | 194 echo "Installing chromiumos-build tool..." |
| 195 bash_chroot "cd $CHROOT_TRUNK_DIR/tools/chromiumos-build && \ | 195 bash_chroot "cd $CHROOT_TRUNK_DIR/tools/chromiumos-build && \ |
| 196 debuild -us -uc && sudo dpkg -i ../*.deb" | 196 debuild -us -uc && \ |
| 197 sudo dpkg -i ../chromiumos-build_*.deb && \ |
| 198 rm ../chromiumos-build_*.{dsc,tar.gz,deb,build,changes}" |
| 197 | 199 |
| 198 | 200 |
| 199 # Clean up the chroot mounts | 201 # Clean up the chroot mounts |
| 200 trap - EXIT | 202 trap - EXIT |
| 201 cleanup | 203 cleanup |
| 202 | 204 |
| 203 if [ "$FLAGS_chroot" = "$DEFAULT_CHROOT_DIR" ] | 205 if [ "$FLAGS_chroot" = "$DEFAULT_CHROOT_DIR" ] |
| 204 then | 206 then |
| 205 CHROOT_EXAMPLE_OPT="" | 207 CHROOT_EXAMPLE_OPT="" |
| 206 else | 208 else |
| 207 CHROOT_EXAMPLE_OPT="--chroot=$FLAGS_chroot" | 209 CHROOT_EXAMPLE_OPT="--chroot=$FLAGS_chroot" |
| 208 fi | 210 fi |
| 209 | 211 |
| 210 echo "All set up. To enter the chroot, run:" | 212 echo "All set up. To enter the chroot, run:" |
| 211 echo " $SCRIPTS_DIR/enter_chroot.sh $CHROOT_EXAMPLE_OPT" | 213 echo " $SCRIPTS_DIR/enter_chroot.sh $CHROOT_EXAMPLE_OPT" |
| 212 echo "" | 214 echo "" |
| 213 echo "CAUTION: Do *NOT* rm -rf the chroot directory; if there are stale bind" | 215 echo "CAUTION: Do *NOT* rm -rf the chroot directory; if there are stale bind" |
| 214 echo "mounts you may end up deleting your source tree too. To unmount and" | 216 echo "mounts you may end up deleting your source tree too. To unmount and" |
| 215 echo "delete the chroot cleanly, use:" | 217 echo "delete the chroot cleanly, use:" |
| 216 echo " $0 --delete $CHROOT_EXAMPLE_OPT" | 218 echo " $0 --delete $CHROOT_EXAMPLE_OPT" |
| OLD | NEW |