Issue #91: allow unsigned vendor_boot.img

pull/94/head
cfig 3 years ago
parent 4e7bdf6c47
commit d2719ae39e
No known key found for this signature in database
GPG Key ID: B104C307F0FDABB7

@ -218,7 +218,11 @@ data class VendorBoot(
} }
val tab = AsciiTable().let { val tab = AsciiTable().let {
it.addRule() it.addRule()
it.addRow("re-packed $imageName", "$imageName.signed") if (File("$imageName.signed").exists()) {
it.addRow("re-packed $imageName", "$imageName.signed")
} else {
it.addRow("re-packed $imageName", "$imageName.clear")
}
it.addRule() it.addRule()
it it
} }
@ -313,7 +317,13 @@ data class VendorBoot(
fun sign(): VendorBoot { fun sign(): VendorBoot {
val avbtool = String.format(Helper.prop("avbtool"), "v1.2") val avbtool = String.format(Helper.prop("avbtool"), "v1.2")
Signer.signAVB(info.output, this.info.imageSize, avbtool) File(Avb.getJsonFileName(info.output)).let {
if (it.exists()) {
Signer.signAVB(info.output, this.info.imageSize, avbtool)
} else {
log.warn("skip signing of ${info.output}")
}
}
return this return this
} }
@ -415,11 +425,13 @@ data class VendorBoot(
} }
it.addRule() it.addRule()
Avb.getJsonFileName(info.output).let { jsonFile -> Avb.getJsonFileName(info.output).let { jsonFile ->
it.addRow("AVB info", Avb.getJsonFileName(info.output))
if (File(jsonFile).exists()) { if (File(jsonFile).exists()) {
it.addRow("AVB info", jsonFile)
mapper.readValue(File(jsonFile), AVBInfo::class.java).let { ai -> mapper.readValue(File(jsonFile), AVBInfo::class.java).let { ai ->
it.addRow("\\-- signing key", Avb.inspectKey(ai)) it.addRow("\\-- signing key", Avb.inspectKey(ai))
} }
} else {
it.addRow("AVB info", "none")
} }
it.addRule() it.addRule()
} }

@ -131,6 +131,7 @@ class BootImgParser : IPackable {
override fun pull(fileName: String, deviceName: String) { override fun pull(fileName: String, deviceName: String) {
super.pull(fileName, deviceName) super.pull(fileName, deviceName)
super.pull("vbmeta.img", "vbmeta")
} }
fun clear(fileName: String) { fun clear(fileName: String) {

@ -53,6 +53,7 @@ class VendorBootParser : IPackable {
override fun pull(fileName: String, deviceName: String) { override fun pull(fileName: String, deviceName: String) {
super.pull(fileName, deviceName) super.pull(fileName, deviceName)
super.pull("vbmeta.img", "vbmeta")
} }
fun clear(fileName: String) { fun clear(fileName: String) {

Loading…
Cancel
Save