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

Side by Side Diff: cros_generate_update_payload

Issue 4892002: cros_generate_upload_payload --patch_kernel should mount from the source (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 10 years, 1 month 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) 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 # Script to generate a Chromium OS update for use by the update engine. 7 # Script to generate a Chromium OS update for use by the update engine.
8 # If a source .bin is specified, the update is assumed to be a delta update. 8 # If a source .bin is specified, the update is assumed to be a delta update.
9 9
10 # Load common constants. This should be the first executable line. 10 # Load common constants. This should be the first executable line.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 patch_kernel() { 80 patch_kernel() {
81 local IMAGE="$1" 81 local IMAGE="$1"
82 local KERN_FILE="$2" 82 local KERN_FILE="$2"
83 83
84 STATE_LOOP_DEV=$(sudo losetup -f) 84 STATE_LOOP_DEV=$(sudo losetup -f)
85 [ -n "$STATE_LOOP_DEV" ] || die "no free loop device" 85 [ -n "$STATE_LOOP_DEV" ] || die "no free loop device"
86 local offset=$(partoffset "${IMAGE}" 1) 86 local offset=$(partoffset "${IMAGE}" 1)
87 offset=$(($offset * 512)) 87 offset=$(($offset * 512))
88 sudo losetup -o "$offset" "$STATE_LOOP_DEV" "$IMAGE" 88 sudo losetup -o "$offset" "$STATE_LOOP_DEV" "$IMAGE"
89 STATE_MNT=$(mktemp -d /tmp/state.XXXXXX) 89 STATE_MNT=$(mktemp -d /tmp/state.XXXXXX)
90 sudo mount "$STATE_LOOP_DEV" "$STATE_MNT" 90 sudo mount --read-only "$STATE_LOOP_DEV" "$STATE_MNT"
91 dd if="$STATE_MNT"/vmlinuz_hd.vblock of="$KERN_FILE" conv=notrunc 91 dd if="$STATE_MNT"/vmlinuz_hd.vblock of="$KERN_FILE" conv=notrunc
92 sudo umount "$STATE_MNT" 92 sudo umount "$STATE_MNT"
93 STATE_MNT="" 93 STATE_MNT=""
94 sudo losetup -d "$STATE_LOOP_DEV" 94 sudo losetup -d "$STATE_LOOP_DEV"
95 STATE_LOOP_DEV="" 95 STATE_LOOP_DEV=""
96 } 96 }
97 97
98 extract_kern_root() { 98 extract_kern_root() {
99 local bin_file="$1" 99 local bin_file="$1"
100 local kern_out="$2" 100 local kern_out="$2"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 GENERATOR="$(dirname "$0")/mk_memento_images.sh" 239 GENERATOR="$(dirname "$0")/mk_memento_images.sh"
240 240
241 CROS_GENERATE_UPDATE_PAYLOAD_CALLED=1 "$GENERATOR" "$DST_KERNEL" "$DST_ROOT" 241 CROS_GENERATE_UPDATE_PAYLOAD_CALLED=1 "$GENERATOR" "$DST_KERNEL" "$DST_ROOT"
242 mv "$(dirname "$DST_KERNEL")/update.gz" "$FLAGS_output" 242 mv "$(dirname "$DST_KERNEL")/update.gz" "$FLAGS_output"
243 243
244 trap - INT TERM EXIT 244 trap - INT TERM EXIT
245 cleanup noexit 245 cleanup noexit
246 echo "Done generating full update." 246 echo "Done generating full update."
247 fi 247 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