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

Side by Side Diff: scripts/image_signing/common.sh

Issue 3145008: A utility for updating /etc/lsb-release values. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: address review comments Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | scripts/image_signing/set_lsb_release.sh » ('j') | 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 # Determine script directory 7 # Determine script directory
8 SCRIPT_DIR=$(dirname $0) 8 SCRIPT_DIR=$(dirname $0)
9 PROG=$(basename $0)
9 GPT=cgpt 10 GPT=cgpt
10 11
11 # Read GPT table to find the starting location of a specific partition. 12 # Read GPT table to find the starting location of a specific partition.
12 # Args: DEVICE PARTNUM 13 # Args: DEVICE PARTNUM
13 # Returns: offset (in sectors) of partition PARTNUM 14 # Returns: offset (in sectors) of partition PARTNUM
14 partoffset() { 15 partoffset() {
15 sudo $GPT show -b -i $2 $1 16 sudo $GPT show -b -i $2 $1
16 } 17 }
17 18
18 # Read GPT table to find the size of a specific partition. 19 # Read GPT table to find the size of a specific partition.
(...skipping 17 matching lines...) Expand all
36 # Args: IMAGE PARTNUM OUTPUTFILE 37 # Args: IMAGE PARTNUM OUTPUTFILE
37 extract_image_partition() { 38 extract_image_partition() {
38 local image=$1 39 local image=$1
39 local partnum=$2 40 local partnum=$2
40 local output_file=$3 41 local output_file=$3
41 local offset=$(partoffset "$image" "$partnum") 42 local offset=$(partoffset "$image" "$partnum")
42 local size=$(partsize "$image" "$partnum") 43 local size=$(partsize "$image" "$partnum")
43 dd if=$image of=$output_file bs=512 skip=$offset count=$size 44 dd if=$image of=$output_file bs=512 skip=$offset count=$size
44 } 45 }
45 46
OLDNEW
« no previous file with comments | « no previous file | scripts/image_signing/set_lsb_release.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698