Finalize verified 2720 Flip release source and untrack image outputs
This commit is contained in:
1 parent
2a3078e42c
commit
1c011b360a
121 files changed
+8467
-686
No files matched your search
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Produce a config/frp image with the OEM allow-unlock flag set.
|
||||
|
||||
aboot's read_allow_oem_unlock() checks the LSB of the last byte of the
|
||||
"config" (or "frp") partition. Setting it allows 'fastboot oem unlock-go'
|
||||
to write the authoritative RPMB devinfo on VB1/secure-boot devices.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("locked")
|
||||
parser.add_argument("unlocked")
|
||||
args = parser.parse_args()
|
||||
data = bytearray(open(args.locked, "rb").read())
|
||||
if not data:
|
||||
print("FAIL: input is empty")
|
||||
return 1
|
||||
print("locked : last byte=%d" % data[-1])
|
||||
data[-1] |= 1
|
||||
with open(args.unlocked, "wb") as handle:
|
||||
handle.write(data)
|
||||
print("unlocked: last byte=%d -> %s (%d bytes)" %
|
||||
(data[-1], args.unlocked, len(data)))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in new issue
Block a user