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 # Script to build a bootable keyfob-based chromeos system image from within | 7 # Script to build a bootable keyfob-based chromeos system image from within |
8 # a chromiumos setup. This assumes that all needed packages have been built into | 8 # a chromiumos setup. This assumes that all needed packages have been built into |
9 # the given target's root with binary packages turned on. This script will | 9 # the given target's root with binary packages turned on. This script will |
10 # build the Chrome OS image using only pre-built binary packages. | 10 # build the Chrome OS image using only pre-built binary packages. |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 # Turn die on error back on. | 327 # Turn die on error back on. |
328 set -e | 328 set -e |
329 } | 329 } |
330 | 330 |
331 delete_prompt() { | 331 delete_prompt() { |
332 echo "An error occurred in your build so your latest output directory" \ | 332 echo "An error occurred in your build so your latest output directory" \ |
333 "is invalid." | 333 "is invalid." |
334 | 334 |
335 # Only prompt if both stdin and stdout are a tty. If either is not a tty, | 335 # Only prompt if both stdin and stdout are a tty. If either is not a tty, |
336 # then the user may not be present, so we shouldn't bother prompting. | 336 # then the user may not be present, so we shouldn't bother prompting. |
337 if tty -s && tty -s <&1; then | 337 if tty -s && tty -s <&1 && [ "${USER}" -ne 'chrome-bot' ]; then |
338 read -p "Would you like to delete the output directory (y/N)? " SURE | 338 read -p "Would you like to delete the output directory (y/N)? " SURE |
339 SURE="${SURE:0:1}" # Get just the first character. | 339 SURE="${SURE:0:1}" # Get just the first character. |
340 else | 340 else |
341 SURE="y" | 341 SURE="y" |
342 echo "Running in non-interactive mode so deleting output directory." | 342 echo "Running in non-interactive mode so deleting output directory." |
343 fi | 343 fi |
344 if [ "${SURE}" == "y" ] ; then | 344 if [ "${SURE}" == "y" ] ; then |
345 sudo rm -rf "${OUTPUT_DIR}" | 345 sudo rm -rf "${OUTPUT_DIR}" |
346 echo "Deleted ${OUTPUT_DIR}" | 346 echo "Deleted ${OUTPUT_DIR}" |
347 else | 347 else |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" | 815 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" |
816 fi | 816 fi |
817 | 817 |
818 print_time_elapsed | 818 print_time_elapsed |
819 | 819 |
820 echo "To copy to USB keyfob, do something like:" | 820 echo "To copy to USB keyfob, do something like:" |
821 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" | 821 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" |
822 echo "To convert to VMWare image, INSIDE the chroot, do something like:" | 822 echo "To convert to VMWare image, INSIDE the chroot, do something like:" |
823 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}" | 823 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}" |
824 echo "from the scripts directory where you entered the chroot." | 824 echo "from the scripts directory where you entered the chroot." |
OLD | NEW |