backuptool: Support tab-delimited fstab
Change-Id: Ib3fcde92d0c1ebb8754b11c577e4885d8dd02624
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh
index 8a3e349..01e84bf 100755
--- a/prebuilt/common/bin/backuptool.sh
+++ b/prebuilt/common/bin/backuptool.sh
@@ -104,7 +104,7 @@
}
get_block_for_mount_point() {
- grep -v "^#" /etc/recovery.fstab | grep " $1 " | tail -n1 | tr -s ' ' | cut -d' ' -f1
+ grep -v "^#" /etc/recovery.fstab | grep "[[:blank:]]$1[[:blank:]]" | tail -n1 | tr -s [:blank:] ' ' | cut -d' ' -f1
}
find_block() {
diff --git a/prebuilt/common/bin/backuptool_ab.sh b/prebuilt/common/bin/backuptool_ab.sh
index 8e1bebe..eb881b4 100755
--- a/prebuilt/common/bin/backuptool_ab.sh
+++ b/prebuilt/common/bin/backuptool_ab.sh
@@ -96,7 +96,7 @@
### Mount helpers ###
#####################
get_block_for_mount_point() {
- grep -v "^#" /vendor/etc/fstab.$(getprop ro.boot.hardware) | grep " $1 " | tail -n1 | tr -s ' ' | cut -d' ' -f1
+ grep -v "^#" /vendor/etc/fstab.$(getprop ro.boot.hardware) | grep "[[:blank:]]$1[[:blank:]]" | tail -n1 | tr -s [:blank:] ' ' | cut -d' ' -f1
}
find_block() {