From 076e748dc364ba987c05ed9264a02d10fd702533 Mon Sep 17 00:00:00 2001 From: Alexander Winkowski Date: Fri, 4 Mar 2022 10:59:38 +0300 Subject: [PATCH] AK3: Fix patch_fstab function (#66) Patching system partition entry won't work if system_ext partition is present. Fix this by adding [[:space:]] to the end of the pattern. Note that grep -w can't be used in this case because there is still a possibility of erroneous matches from grep using / as a whole word delimiter, e.g., logical vendor partition (that is just "vendor") and "/vendor/dsp". --- tools/ak3-core.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index fe77722..6b42e87 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -615,7 +615,7 @@ replace_file() { # patch_fstab block|mount|fstype|options|flags patch_fstab() { local entry part newpart newentry; - entry=$(grep "$2" $1 | grep "$3"); + entry=$(grep "$2[[:space:]]" $1 | grep "$3"); if [ ! "$(echo "$entry" | grep "$6")" -o "$6" == " " -o ! "$6" ]; then case $4 in block) part=$(echo "$entry" | awk '{ print $1 }');;