diff options
author | Hung-Te Lin <hungte@chromium.org> | 2011-06-28 01:21:49 +0800 |
---|---|---|
committer | Hung-Te Lin <hungte@chromium.org> | 2011-06-30 18:15:54 -0700 |
commit | c3b877d8cb2e413816d34ed685c6a35780e07bc8 (patch) | |
tree | e15e8149cd8bcdbf091ac9e6f3d995d82e06d725 /scripts/image_signing/common_minimal.sh | |
parent | fbb52dfa9cf1b38eedc119c84f1f64d5fa7f1fbb (diff) | |
download | vboot-c3b877d8cb2e413816d34ed685c6a35780e07bc8.tar.gz |
make_dev_ssd: fix ARM device names
BUG=chromium-os:15061
TEST=(on arm) ./make_dev_ssd.sh --remove_rootfs_verification # works
Change-Id: I0ed5e02cd566c89b2604a2e77b87413dc957471e
Reviewed-on: http://gerrit.chromium.org/gerrit/3375
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'scripts/image_signing/common_minimal.sh')
-rwxr-xr-x | scripts/image_signing/common_minimal.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/image_signing/common_minimal.sh b/scripts/image_signing/common_minimal.sh index 5063fcdc..a68502e7 100755 --- a/scripts/image_signing/common_minimal.sh +++ b/scripts/image_signing/common_minimal.sh @@ -108,6 +108,22 @@ trap "cleanup_temps_and_mounts" EXIT # Functions for partition management # ---------------------------------------------------------------------------- +# Construct a partition device name from a whole disk block device and a +# partition number. +# This works for [/dev/sda, 3] (-> /dev/sda3) as well as [/dev/mmcblk0, 2] +# (-> /dev/mmcblk0p2). +make_partition_dev() { + local block="$1" + local num="$2" + # If the disk block device ends with a number, we add a 'p' before the + # partition number. + if [ "${block%[0-9]}" = "${block}" ]; then + echo "${block}${num}" + else + echo "${block}p${num}" + fi +} + # Read GPT table to find the starting location of a specific partition. # Args: DEVICE PARTNUM # Returns: offset (in sectors) of partition PARTNUM |