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

Side by Side Diff: src/scripts/prep_usb.sh

Issue 1644001: Tool for mounting USB sticks formatted with --statefuldev (Closed)
Patch Set: remove -n from mount command, fix typpo Created 10 years, 8 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 #!/bin/bash
2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Load common constants. This should be the first executable line.
8 # The path to common.sh should be relative to your script's location.
9 . "$(dirname "$0")/common.sh"
10
11 DEFINE_boolean "unmount" $FLAGS_FALSE "unmount USB partitions" "u"
12 DEFINE_string "device" "/dev/sdc" \
13 "The device on which the mountable partitions live." "d"
14 DEFINE_string "rootfs_mountpt" "/tmp/m" "Mount point for rootfs" "r"
15 DEFINE_string "stateful_mountpt" "/tmp/s" \
16 "Mount point for stateful partition" "s"
17
18 # Parse command line.
19 FLAGS "$@" || exit 1
20 eval set -- "${FLAGS_ARGV}"
21
22 mkdir -p "${FLAGS_rootfs_mountpt}"
23 mkdir -p "${FLAGS_stateful_mountpt}"
24
25 if [[ $FLAGS_unmount -eq $FLAGS_FALSE ]]; then
26 sudo mount "${FLAGS_device}3" "${FLAGS_rootfs_mountpt}"
27 sudo mount "${FLAGS_device}1" "${FLAGS_stateful_mountpt}"
28 sudo mount --bind "${FLAGS_stateful_mountpt}/var" \
29 "${FLAGS_rootfs_mountpt}/var"
30 echo "RootFS of bootable medium mounted at ${FLAGS_rootfs_mountpt}."
31 else
32 echo "Attempting to unmount ${FLAGS_stateful_mountpt} " \
33 "and ${FLAGS_rootfs_mountpt}"
34 sudo umount "${FLAGS_rootfs_mountpt}/var"
35 sudo umount "${FLAGS_stateful_mountpt}"
36 sudo umount "${FLAGS_rootfs_mountpt}"
37 fi
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