summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2020-08-14 15:31:25 +0800
committerCommit Bot <commit-bot@chromium.org>2020-09-23 01:19:25 +0000
commit6c15b6cfb29082147e93b3c9e510a796a8d85a75 (patch)
tree03c429b88a0a3e6558b32d785e5425c772b845c6
parent07cd40854b31ad018657a173d4ff422d575a1f8f (diff)
downloadvboot-6c15b6cfb29082147e93b3c9e510a796a8d85a75.tar.gz
make_dev_ssd.sh: Correct root partition regular expression
Discovered by CL:2353632, the regular expression for extracting rootfs partition should include non-digit character first otherwise we won't get correct number when the partition number is longer than one digit (e.g., >=10). BUG=None TEST=./make_dev_ssd.sh BRANCH=none Change-Id: I155e04beec47c55df4d09cb78168ab0a7407c697 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2353776 Reviewed-by: Kuang-che Wu <kcwu@chromium.org>
-rwxr-xr-xscripts/image_signing/make_dev_ssd.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/image_signing/make_dev_ssd.sh b/scripts/image_signing/make_dev_ssd.sh
index 1fdbfaf7..ed102a6b 100755
--- a/scripts/image_signing/make_dev_ssd.sh
+++ b/scripts/image_signing/make_dev_ssd.sh
@@ -27,7 +27,7 @@ DEFAULT_BACKUP_FOLDER="${DEFAULT_BACKUP_FOLDER}/cros_sign_backups"
# TODO(hungte) The default image selection is no longer a SSD, so the script
# works more like "make_dev_image". We may change the file name in future.
ROOTDEV="$(rootdev -s 2>/dev/null)"
-ROOTDEV_PARTITION="$(echo $ROOTDEV | sed -n 's/.*\([0-9][0-9]*\)$/\1/p')"
+ROOTDEV_PARTITION="$(echo $ROOTDEV | sed -n 's/.*[^0-9]\([0-9][0-9]*\)$/\1/p')"
ROOTDEV_DISK="$(rootdev -s -d 2>/dev/null)"
ROOTDEV_KERNEL="$((ROOTDEV_PARTITION - 1))"