From a9517d232ef74af25083cb340240541da23a48e0 Mon Sep 17 00:00:00 2001 From: Enrico Jörns Date: Tue, 4 Jun 2024 10:06:21 +0200 Subject: wic: bootimg-efi: fix error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we check for empty variables, it does not make sense to print their content in case they are empty. Additionally, the error message in the 'kernel' check attempted to print the wrong variable ('target') which was not even defined, yet. Also, raising WicError doesn't require an extra newline. (From OE-Core rev: a1cbf4d5ea5f852144d0cc70be99d6338c618fcd) Signed-off-by: Enrico Jörns Signed-off-by: Richard Purdie (cherry picked from commit f31cf475d0235f42d73aeec07694f79b9937fd76) Signed-off-by: Steve Sakoman --- scripts/lib/wic/plugins/source/bootimg-efi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/lib/wic/plugins/source/bootimg-efi.py') diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 13a9cddf4e..7cc5131541 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -428,10 +428,10 @@ class BootimgEFIPlugin(SourcePlugin): elif source_params['loader'] == 'uefi-kernel': kernel = get_bitbake_var("KERNEL_IMAGETYPE") if not kernel: - raise WicError("Empty KERNEL_IMAGETYPE %s\n" % target) + raise WicError("Empty KERNEL_IMAGETYPE") target = get_bitbake_var("TARGET_SYS") if not target: - raise WicError("Unknown arch (TARGET_SYS) %s\n" % target) + raise WicError("Empty TARGET_SYS") if re.match("x86_64", target): kernel_efi_image = "bootx64.efi" -- cgit v1.2.3-54-g00ecf