Skip to content

Commit

Permalink
boot-patcher: Use awk script to remove verity/verity=? instead
Browse files Browse the repository at this point in the history
In Android Oreo, we need to be compatible with alternative
verity metadata locations.

Signed-off-by: James Christopher Adduono <[email protected]>
  • Loading branch information
jcadduono committed Nov 10, 2017
1 parent b7675fe commit ef21733
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions nethunter-installer/boot-patcher/patch.d/02-no-verity-opt-encrypt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ef21733

Please sign in to comment.