Forked from https://android.googlesource.com/platform/bootable/recovery