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

Side by Side Diff: src/scripts/clean_loopback_devices

Issue 1759015: Adds a script to unmount any mount points in your boards image dir and free loopback devices (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: Rename, add comment and fix ws Created 10 years, 7 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
« 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
(Empty)
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 #
5 # Force cleans loopback devices from within your chroot environment. This
6 # script is to help mitigate losing loopback devices on build_images
7 # failures. This script only affects mountpoints and loopback devices
8 # that were created within this chroot.
9
10 # Load common constants. This should be the first executable line.
11 # The path to common.sh should be relative to your script's location.
12 . "$(dirname "$0")/common.sh"
13
14 # Script must be run inside the chroot.
15 assert_inside_chroot
16
17 DEFINE_string output_root "$DEFAULT_BUILD_ROOT/images" \
18 "Directory in which to place image result directories (named by version)"
19 DEFINE_string board "$DEFAULT_BOARD" \
20 "The board to build an image for."
21
22 OUTPUT_DIR="${FLAGS_output_root}/${FLAGS_board}"
23
24 echo "This will unmount any directory under $OUTPUT_DIR:"
25 read -p "Are you sure (y/N)? " SURE
26 SURE="${SURE:0:1}" # Get just the first character
27 if [ "${SURE}" != "y" ]
28 then
29 echo "Ok, better safe than sorry."
30 exit 1
31 fi
32
33 sudo umount "$OUTPUT_DIR"/*/* 2> /dev/null
34 sudo losetup -d /dev/loop* 2> /dev/null
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