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

Side by Side Diff: user_tools/linux/recovery.sh

Issue 5705005: Applied Bill's patch to use the "raw" version of a disk if it's there. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 10 years 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/sh 1 #!/bin/sh
2 # 2 #
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 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 attempts to guide linux users through the process of putting a recovery 7 # This attempts to guide linux users through the process of putting a recovery
8 # image onto a removeable USB drive. 8 # image onto a removeable USB drive.
9 # 9 #
10 # We may not need root privileges if we have the right permissions. 10 # We may not need root privileges if we have the right permissions.
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 " 815 "
816 816
817 # Unmount anything on that device. 817 # Unmount anything on that device.
818 echo "unmounting..." 818 echo "unmounting..."
819 for tmp in $(mount | grep ^"/dev/${user_choice}" | cut -d' ' -f1); do 819 for tmp in $(mount | grep ^"/dev/${user_choice}" | cut -d' ' -f1); do
820 unmount_partition "$tmp" 820 unmount_partition "$tmp"
821 done 821 done
822 822
823 # Write it. 823 # Write it.
824 echo "copying... (this may take several minutes)" 824 echo "copying... (this may take several minutes)"
825
826 # Many BSD variants provide both normal /dev/FOO and raw /dev/rFOO devices,
827 # with the raw path being much faster. If that device exists, we'll use it.
828 if [ -e /dev/r${user_choice} ]; then
829 user_choice="r${user_choice}"
830 fi
825 dd bs=4194304 of=/dev/${user_choice} if="$image_file" conv=sync || 831 dd bs=4194304 of=/dev/${user_choice} if="$image_file" conv=sync ||
826 ufatal "Unable to write the image." 832 ufatal "Unable to write the image."
827 sync 833 sync
828 834
829 echo " 835 echo "
830 836
831 Done. Remove the USB drive and insert it in your Chrome notebook. 837 Done. Remove the USB drive and insert it in your Chrome notebook.
832 838
833 " 839 "
834 840
835 prompt "Shall I remove the temporary files now? [y/n] " 841 prompt "Shall I remove the temporary files now? [y/n] "
836 read tmp 842 read tmp
837 case $tmp in 843 case $tmp in
838 [Yy]*) 844 [Yy]*)
839 cd 845 cd
840 \rm -rf ${WORKDIR} 846 \rm -rf ${WORKDIR}
841 ;; 847 ;;
842 esac 848 esac
843 849
844 exit 0 850 exit 0
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