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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 exit 1 | 107 exit 1 |
108 fi | 108 fi |
109 fi | 109 fi |
110 | 110 |
111 # Create the destination directory | 111 # Create the destination directory |
112 mkdir -p "$FLAGS_chroot" | 112 mkdir -p "$FLAGS_chroot" |
113 | 113 |
114 # Run debootstrap to create the base chroot environment | 114 # Run debootstrap to create the base chroot environment |
115 echo "Running debootstrap..." | 115 echo "Running debootstrap..." |
116 echo "You may need to enter password for sudo now..." | 116 echo "You may need to enter password for sudo now..." |
117 sudo debootstrap --arch=i386 "$FLAGS_suite" "$FLAGS_chroot" "$FLAGS_mirror" | 117 sudo debootstrap --arch=i386 --exclude=rsyslog,ubuntu-minimal \ |
| 118 "$FLAGS_suite" "$FLAGS_chroot" "$FLAGS_mirror" |
118 echo "Done running debootstrap." | 119 echo "Done running debootstrap." |
119 | 120 |
120 # Set up necessary mounts | 121 # Set up necessary mounts |
121 sudo mount none -t proc "$FLAGS_chroot/proc" | 122 sudo mount none -t proc "$FLAGS_chroot/proc" |
122 sudo mount none -t devpts "$FLAGS_chroot/dev/pts" | 123 sudo mount none -t devpts "$FLAGS_chroot/dev/pts" |
123 # ...and make sure we clean them up on exit | 124 # ...and make sure we clean them up on exit |
124 trap cleanup EXIT | 125 trap cleanup EXIT |
125 | 126 |
126 # Set up sudoers. Inside the chroot, the user can sudo without a password. | 127 # Set up sudoers. Inside the chroot, the user can sudo without a password. |
127 # (Safe enough, since the only way into the chroot is to 'sudo chroot', so | 128 # (Safe enough, since the only way into the chroot is to 'sudo chroot', so |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 CHROOT_EXAMPLE_OPT="--chroot=$FLAGS_chroot" | 207 CHROOT_EXAMPLE_OPT="--chroot=$FLAGS_chroot" |
207 fi | 208 fi |
208 | 209 |
209 echo "All set up. To enter the chroot, run:" | 210 echo "All set up. To enter the chroot, run:" |
210 echo " $SCRIPTS_DIR/enter_chroot.sh $CHROOT_EXAMPLE_OPT" | 211 echo " $SCRIPTS_DIR/enter_chroot.sh $CHROOT_EXAMPLE_OPT" |
211 echo "" | 212 echo "" |
212 echo "CAUTION: Do *NOT* rm -rf the chroot directory; if there are stale bind" | 213 echo "CAUTION: Do *NOT* rm -rf the chroot directory; if there are stale bind" |
213 echo "mounts you may end up deleting your source tree too. To unmount and" | 214 echo "mounts you may end up deleting your source tree too. To unmount and" |
214 echo "delete the chroot cleanly, use:" | 215 echo "delete the chroot cleanly, use:" |
215 echo " $0 --delete $CHROOT_EXAMPLE_OPT" | 216 echo " $0 --delete $CHROOT_EXAMPLE_OPT" |
OLD | NEW |