| OLD | NEW |
| 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 PROG=$(basename $0) |
| 10 GPT=cgpt | 10 GPT=cgpt |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 # Extract a partition to a file | 36 # Extract a partition to a file |
| 37 # Args: IMAGE PARTNUM OUTPUTFILE | 37 # Args: IMAGE PARTNUM OUTPUTFILE |
| 38 extract_image_partition() { | 38 extract_image_partition() { |
| 39 local image=$1 | 39 local image=$1 |
| 40 local partnum=$2 | 40 local partnum=$2 |
| 41 local output_file=$3 | 41 local output_file=$3 |
| 42 local offset=$(partoffset "$image" "$partnum") | 42 local offset=$(partoffset "$image" "$partnum") |
| 43 local size=$(partsize "$image" "$partnum") | 43 local size=$(partsize "$image" "$partnum") |
| 44 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 |
| 45 } | 45 } |
| 46 | |
| OLD | NEW |