Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Side by Side Diff: build_image

Issue 3373003: Issue 6577: remove confirmation to delete output directory (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: detect non-interactive mode and delete output dir Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 ESP_LOOP_DEV= 312 ESP_LOOP_DEV=
313 fi 313 fi
314 314
315 # Turn die on error back on. 315 # Turn die on error back on.
316 set -e 316 set -e
317 } 317 }
318 318
319 delete_prompt() { 319 delete_prompt() {
320 echo "An error occurred in your build so your latest output directory" \ 320 echo "An error occurred in your build so your latest output directory" \
321 "is invalid." 321 "is invalid."
322 read -p "Would you like to delete the output directory (y/N)? " SURE 322
323 SURE="${SURE:0:1}" # Get just the first character. 323 # Only prompt if both stdin and stdout are a tty. If either is not a tty,
324 # then the user may not be present, so we shouldn't bother prompting.
325 if tty -s && tty -s <&1; then
326 read -p "Would you like to delete the output directory (y/N)? " SURE
327 SURE="${SURE:0:1}" # Get just the first character.
328 else
329 SURE="y"
330 echo "Running in non-interactive mode so deleting output directory."
331 fi
324 if [ "${SURE}" == "y" ] ; then 332 if [ "${SURE}" == "y" ] ; then
325 sudo rm -rf "${OUTPUT_DIR}" 333 sudo rm -rf "${OUTPUT_DIR}"
326 echo "Deleted ${OUTPUT_DIR}" 334 echo "Deleted ${OUTPUT_DIR}"
327 else 335 else
328 echo "Not deleting ${OUTPUT_DIR}. Note dev server updates will not work" \ 336 echo "Not deleting ${OUTPUT_DIR}."
329 "until you successfully build another image or delete this directory"
330 fi 337 fi
331 } 338 }
332 339
333 # $1 - Directory where developer rootfs is mounted. 340 # $1 - Directory where developer rootfs is mounted.
334 # $2 - Directory where developer stateful_partition is mounted. 341 # $2 - Directory where developer stateful_partition is mounted.
335 # $3 - Directory where the ESP partition is mounted. 342 # $3 - Directory where the ESP partition is mounted.
336 mount_gpt_cleanup() { 343 mount_gpt_cleanup() {
337 local rootfs="${1-$ROOT_FS_DIR}" 344 local rootfs="${1-$ROOT_FS_DIR}"
338 local statefs="${2-$STATEFUL_FS_DIR}" 345 local statefs="${2-$STATEFUL_FS_DIR}"
339 local espfs="${3-$ESP_FS_DIR}" 346 local espfs="${3-$ESP_FS_DIR}"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}" 757 echo "Developer image created as ${DEVELOPER_IMAGE_NAME}"
751 fi 758 fi
752 759
753 print_time_elapsed 760 print_time_elapsed
754 761
755 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:" 762 echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:"
756 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" 763 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX"
757 echo "To convert to VMWare image, INSIDE the chroot, do something like:" 764 echo "To convert to VMWare image, INSIDE the chroot, do something like:"
758 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}" 765 echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}"
759 echo "from the scripts directory where you entered the chroot." 766 echo "from the scripts directory where you entered the chroot."
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698