kernel-fit-image: remove fatal error when .crt file is missing
PATCH v2 1/1 kernel-fit-image: remove fatal error when .crt file is missing
Fixes [YOCTO #16427]
The minimal requirement of mkimage for signing a fitImage is a private key file (.key -> using -k). Passing a public key file (.crt) is only necessary when a key-destination is provided (-K). The -K option is optional in the kernel-fit-image signing process and can be passed only by the user via UBOOT_MKIMAGE_SIGN_ARGS. Therefore, providing a private .crt key file is optional and should not cause a fatal error when missing.
changes in v2:
- fix shortlog format
Signed-off-by Tobias Pistora <[email protected]>
--- meta/lib/oe/fitimage.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
meta/lib/oe/fitimage.py +5 -2
@@ -593,8 +593,11 @@ class ItsNodeRootKernel(ItsNode): if not os.path.exists(key_path + '.pem'): bb.fatal("ECDSA signing requires '%s.pem'" % key_path) else: - if not os.path.exists(key_path + '.key') or not os.path.exists(key_path + '.crt'): - bb.fatal("%s.key or .crt does not exist" % key_path) + if not os.path.exists(key_path + '.key'): + bb.fatal("%s.key (private key) does not exist" % key_path) + # public key is only necessary when passing -K option to mkimage + if not os.path.exists(key_path + '.crt'): + bb.debug(1, "%s.crt (public key) does not exist" % key_path) def run_mkimage_sign(self, fitfile): if not self._sign_enable:
Signature · 1 line
2.47.3