From aa1377c9abc6f991a28c4e54e87adc55d84c9aa7 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Fri, 22 Sep 2017 01:35:51 -0300 Subject: [PATCH] AK2: fix patch_fstab substring replacement - the 'original string' ($5) was not being used, instead the entire part was always being replaced with the 'replacement string' ($6) - replace the target 'original string' of the entry part with 'replacement string' as expected/intended NOTE: any properly written patch_fstab commands with original string as the complete original part WILL remain working as this is a backwards compatible change --- tools/ak2-core.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ak2-core.sh b/tools/ak2-core.sh index 6114232..55abb1c 100755 --- a/tools/ak2-core.sh +++ b/tools/ak2-core.sh @@ -364,7 +364,8 @@ patch_fstab() { options) part=$(echo "$entry" | awk '{ print $4 }');; flags) part=$(echo "$entry" | awk '{ print $5 }');; esac; - newentry=$(echo "$entry" | sed "s;${part};${6};"); + newpart=$(echo "$part" | sed "s;${5};${6};"); + newentry=$(echo "$entry" | sed "s;${part};${newpart};"); sed -i "s;${entry};${newentry};" $1; fi; }