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

Side by Side Diff: src/platform/dev/stateful_update

Issue 2392002: Quiet down stateful_update & add timeout for downloads. (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: fixes to autoupdate to work with memento_updater and autotest. Created 10 years, 6 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 | « src/platform/dev/autoupdate.py ('k') | 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 scripts performs update of stateful partition directories useful for 7 # This scripts performs update of stateful partition directories useful for
8 # dev_mode. 8 # dev_mode.
9 9
10 # Die on error. 10 # Die on error.
(...skipping 17 matching lines...) Expand all
28 28
29 # Prepare directories for update. 29 # Prepare directories for update.
30 rm -rf "$STATEFUL_DIR/var_new" "$STATEFUL_DIR/dev_image_new" 30 rm -rf "$STATEFUL_DIR/var_new" "$STATEFUL_DIR/dev_image_new"
31 31
32 # Prepare and mount new stateful partition. 32 # Prepare and mount new stateful partition.
33 rm -rf "$STATEFUL_MOUNT_POINT" 33 rm -rf "$STATEFUL_MOUNT_POINT"
34 mkdir -p "$STATEFUL_MOUNT_POINT" 34 mkdir -p "$STATEFUL_MOUNT_POINT"
35 35
36 # Unzip mount and copy the relevant directories. 36 # Unzip mount and copy the relevant directories.
37 # Get the update. 37 # Get the update.
38 eval "wget -O - \"$STATEFUL_UPDATE_URL\"" | gzip -d > $STATEFUL_IMAGE 38 eval "wget -qS -T 300 -O - \"$STATEFUL_UPDATE_URL\"" | \
39 gzip -d > $STATEFUL_IMAGE
40 echo "Successfully downloaded update"
39 trap "rm -f \"$STATEFUL_IMAGE\"" EXIT 41 trap "rm -f \"$STATEFUL_IMAGE\"" EXIT
40 mount -n -o loop "$STATEFUL_IMAGE" "$STATEFUL_MOUNT_POINT" 42 mount -n -o loop "$STATEFUL_IMAGE" "$STATEFUL_MOUNT_POINT"
41 if [ -d "$STATEFUL_MOUNT_POINT/var" ] && \ 43 if [ -d "$STATEFUL_MOUNT_POINT/var" ] && \
42 [ -d "$STATEFUL_MOUNT_POINT/dev_image" ] ; then 44 [ -d "$STATEFUL_MOUNT_POINT/dev_image" ] ; then
43 cp -rf "$STATEFUL_MOUNT_POINT/var" "$STATEFUL_DIR/var_new" 45 cp -rf "$STATEFUL_MOUNT_POINT/var" "$STATEFUL_DIR/var_new"
44 cp -rf "$STATEFUL_MOUNT_POINT/dev_image" "$STATEFUL_DIR/dev_image_new" 46 cp -rf "$STATEFUL_MOUNT_POINT/dev_image" "$STATEFUL_DIR/dev_image_new"
45 touch "$STATEFUL_DIR/.update_available" 47 touch "$STATEFUL_DIR/.update_available"
46 else 48 else
47 echo "No update available" 49 echo "No update available"
48 fi 50 fi
49 51
50 umount -n -d "$STATEFUL_MOUNT_POINT" 52 umount -n -d "$STATEFUL_MOUNT_POINT"
51 53
52 rm -f "$STATEFUL_IMAGE" 54 rm -f "$STATEFUL_IMAGE"
53 55
54 trap - EXIT 56 trap - EXIT
OLDNEW
« no previous file with comments | « src/platform/dev/autoupdate.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698