From aaf88b189522d1a93af47de1736c0ea53c266cfb Mon Sep 17 00:00:00 2001 From: osm0sis Date: Thu, 4 Jul 2019 03:17:14 -0300 Subject: [PATCH] BootSigner: add ability to change target name - supports signing /recovery images - add as final argument and default to /boot if not supplied so installer scripts remain the same --- .../main/java/com/topjohnwu/signing/BootSigner.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/signing/src/main/java/com/topjohnwu/signing/BootSigner.java b/signing/src/main/java/com/topjohnwu/signing/BootSigner.java index 6a7c3f91b..f9210e964 100644 --- a/signing/src/main/java/com/topjohnwu/signing/BootSigner.java +++ b/signing/src/main/java/com/topjohnwu/signing/BootSigner.java @@ -18,13 +18,17 @@ public class BootSigner { } else if (args.length > 0 && "-sign".equals(args[0])) { InputStream cert = null; InputStream key = null; + String name = "/boot"; if (args.length >= 3) { cert = new FileInputStream(args[1]); key = new FileInputStream(args[2]); } + if (args.length >= 4) { + name = args[3]; + } - boolean success = SignBoot.doSignature("/boot", System.in, System.out, cert, key); + boolean success = SignBoot.doSignature(name, System.in, System.out, cert, key); System.exit(success ? 0 : 1); } else { System.err.println( @@ -34,8 +38,9 @@ public class BootSigner { "Actions:\n" + " -verify [x509.pem]\n" + " verify image, cert is optional\n" + - " -sign [x509.pem] [pk8]\n" + - " sign image, cert and key pair is optional\n" + " -sign [x509.pem] [pk8] [name]\n" + + " sign image, name, cert and key pair are optional\n" + + " name should be /boot (default) or /recovery\n" ); } }