Permalink
Browse files

boot-patcher: Use awk script to remove verity/verity=? instead

In Android Oreo, we need to be compatible with alternative
verity metadata locations.

Signed-off-by: James Christopher Adduono <jc@adduono.com>
  • Loading branch information...
jcadduono committed Nov 10, 2017
1 parent b7675fe commit ef2173345a150c3ffc2a439b977a13808ee80619
Showing with 21 additions and 8 deletions.
  1. +21 −8 nethunter-installer/boot-patcher/patch.d/02-no-verity-opt-encrypt
@@ -9,15 +9,28 @@ found_fstab=false
for fstab in fstab.*; do
[ -f "$fstab" ] || continue
print "Found fstab: $fstab"
sed -i "
s/,verify\b//g
s/\bverify,//g
s/\bverify\b//g
s/,support_scfs\b//g
s/\bsupport_scfs,//g
s/\bsupport_scfs\b//g
sed "
s/\b\(forceencrypt\|forcefdeorfbe\)=/encryptable=/g
" "$fstab"
" "$fstab" | awk '
$1 ~ /^\// {
n = split($5, flags, ",")
newflags=""
for (i = 1; i <= n; i++) {
if (flags[i] == "")
continue
if (flags[i] ~ /^verify/)
continue
if (flags[i] ~ /^support_scfs/)
continue
if (i > 1) newflags = newflags ","
newflags = newflags flags[i]
}
if ($5 != newflags) $5 = newflags
if ($5 == "") $5 = "defaults"
}
{ print }
' > "$fstab-"
replace_file "$fstab" "$fstab-"
found_fstab=true
done

0 comments on commit ef21733

Please sign in to comment.