diff mbox series

scripts/Makefile.lib: print error when no public key is specified

Message ID 20231027074326.3357618-1-masahisa.kojima@linaro.org
State Accepted
Commit f32fee03595684ebf362832fb56ad01e97b01925
Headers show
Series scripts/Makefile.lib: print error when no public key is specified | expand

Commit Message

Masahisa Kojima Oct. 27, 2023, 7:43 a.m. UTC
The current build system embeds the EFI Signature List(ESL)
into the dtb to be used in the EFI capsule authentication.
This ESL file is specified through the CONFIG_EFI_CAPSULE_ESL_FILE
Kconfig option. If CONFIG_EFI_CAPSULE_ESL_FILE is not specified,
U-boot build ends up with failure but the cause of failure is not
easily understandable. Current error message is as follows.

FATAL ERROR: Error reading file into data: Is a directoryCheck /home/ubuntu/src/ledge/u-boot/arch/arm/dts/.synquacer-sc2a11-developerbox.dtb.pre.tmp for errors
make[2]: *** [scripts/Makefile.lib:355: arch/arm/dts/synquacer-sc2a11-developerbox.dtb] Error 1
make[1]: *** [dts/Makefile:44: arch-dtbs] Error 2
make: *** [Makefile:1165: dts/dt.dtb] Error 2
make: *** Waiting for unfinished jobs....

This commit shows the error message that CONFIG_EFI_CAPSULE_ESL_FILE
must be specified when the EFI capsule authentication is enabled, then
terminate the build with error.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
---
 scripts/Makefile.lib | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Weizhao Ouyang Nov. 2, 2023, 8:44 a.m. UTC | #1
On Fri, Oct 27, 2023 at 3:45 PM Masahisa Kojima
<masahisa.kojima@linaro.org> wrote:
>
> The current build system embeds the EFI Signature List(ESL)
> into the dtb to be used in the EFI capsule authentication.
> This ESL file is specified through the CONFIG_EFI_CAPSULE_ESL_FILE
> Kconfig option. If CONFIG_EFI_CAPSULE_ESL_FILE is not specified,
> U-boot build ends up with failure but the cause of failure is not
> easily understandable. Current error message is as follows.
>
> FATAL ERROR: Error reading file into data: Is a directoryCheck /home/ubuntu/src/ledge/u-boot/arch/arm/dts/.synquacer-sc2a11-developerbox.dtb.pre.tmp for errors
> make[2]: *** [scripts/Makefile.lib:355: arch/arm/dts/synquacer-sc2a11-developerbox.dtb] Error 1
> make[1]: *** [dts/Makefile:44: arch-dtbs] Error 2
> make: *** [Makefile:1165: dts/dt.dtb] Error 2
> make: *** Waiting for unfinished jobs....
>
> This commit shows the error message that CONFIG_EFI_CAPSULE_ESL_FILE
> must be specified when the EFI capsule authentication is enabled, then
> terminate the build with error.
>
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> ---
>  scripts/Makefile.lib | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 8dc6ec82cd..16bbc277a9 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -339,7 +339,12 @@ cmd_capsule_esl_gen = \
>         $(shell sed "s:ESL_BIN_FILE:$(capsule_esl_path):" $(capsule_esl_input_file) > $@)
>
>  $(obj)/.capsule_esl.dtsi: FORCE
> +ifeq ($(CONFIG_EFI_CAPSULE_ESL_FILE),"")
> +       $(error "CONFIG_EFI_CAPSULE_ESL_FILE is empty, EFI capsule authentication \
> +       public key must be specified when CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled")
> +else
>         $(call cmd_capsule_esl_gen)
> +endif
>
>  capsule_esl_input_file=$(srctree)/lib/efi_loader/capsule_esl.dtsi.in
>  capsule_esl_dtsi = .capsule_esl.dtsi
> --
> 2.34.1
>

Reviewed-by: Weizhao Ouyang <o451686892@gmail.com>
diff mbox series

Patch

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8dc6ec82cd..16bbc277a9 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -339,7 +339,12 @@  cmd_capsule_esl_gen = \
 	$(shell sed "s:ESL_BIN_FILE:$(capsule_esl_path):" $(capsule_esl_input_file) > $@)
 
 $(obj)/.capsule_esl.dtsi: FORCE
+ifeq ($(CONFIG_EFI_CAPSULE_ESL_FILE),"")
+	$(error "CONFIG_EFI_CAPSULE_ESL_FILE is empty, EFI capsule authentication \
+	public key must be specified when CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled")
+else
 	$(call cmd_capsule_esl_gen)
+endif
 
 capsule_esl_input_file=$(srctree)/lib/efi_loader/capsule_esl.dtsi.in
 capsule_esl_dtsi = .capsule_esl.dtsi