diff mbox series

[v5,6/8] arm64: efi: enable generic EFI compressed boot

Message ID 20220910081152.2238369-7-ardb@kernel.org
State Accepted
Commit c37b830fef1396f9f2ad79a65700e152ec362543
Headers show
Series efi: implement generic compressed boot support | expand

Commit Message

Ard Biesheuvel Sept. 10, 2022, 8:11 a.m. UTC
Wire up the generic EFI zboot support for arm64.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/arm64/Makefile        | 9 +++++++--
 arch/arm64/boot/.gitignore | 1 +
 arch/arm64/boot/Makefile   | 6 ++++++
 3 files changed, 14 insertions(+), 2 deletions(-)

Comments

Ard Biesheuvel Sept. 17, 2022, 4:36 p.m. UTC | #1
On Sat, 10 Sept 2022 at 10:12, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> Wire up the generic EFI zboot support for arm64.
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

I've queued up most of this now for 6.1 - Catalin, Will, any
objections if I queue this one as well via the efi tree?

> ---
>  arch/arm64/Makefile        | 9 +++++++--
>  arch/arm64/boot/.gitignore | 1 +
>  arch/arm64/boot/Makefile   | 6 ++++++
>  3 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 6d9d4a58b898..a82bb3599094 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -151,12 +151,17 @@ libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
>
>  # Default target when executing plain make
>  boot           := arch/arm64/boot
> +
> +ifeq ($(CONFIG_EFI_ZBOOT),)
>  KBUILD_IMAGE   := $(boot)/Image.gz
> +else
> +KBUILD_IMAGE   := $(boot)/vmlinuz.efi
> +endif
>
> -all:   Image.gz
> +all:   $(notdir $(KBUILD_IMAGE))
>
>
> -Image: vmlinux
> +Image vmlinuz.efi: vmlinux
>         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
>
>  Image.%: Image
> diff --git a/arch/arm64/boot/.gitignore b/arch/arm64/boot/.gitignore
> index 9a7a9009d43a..af5dc61f8b43 100644
> --- a/arch/arm64/boot/.gitignore
> +++ b/arch/arm64/boot/.gitignore
> @@ -1,3 +1,4 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  Image
>  Image.gz
> +vmlinuz*
> diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile
> index a0e3dedd2883..c65aee088410 100644
> --- a/arch/arm64/boot/Makefile
> +++ b/arch/arm64/boot/Makefile
> @@ -38,3 +38,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE
>
>  $(obj)/Image.zst: $(obj)/Image FORCE
>         $(call if_changed,zstd)
> +
> +EFI_ZBOOT_PAYLOAD      := Image
> +EFI_ZBOOT_BFD_TARGET   := elf64-littleaarch64
> +EFI_ZBOOT_MACH_TYPE    := ARM64
> +
> +include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot
> --
> 2.35.1
>
Catalin Marinas Sept. 20, 2022, 9:55 a.m. UTC | #2
On Sat, Sep 17, 2022 at 06:36:38PM +0200, Ard Biesheuvel wrote:
> On Sat, 10 Sept 2022 at 10:12, Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > Wire up the generic EFI zboot support for arm64.
> >
> > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> 
> I've queued up most of this now for 6.1 - Catalin, Will, any
> objections if I queue this one as well via the efi tree?

No objections.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
diff mbox series

Patch

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 6d9d4a58b898..a82bb3599094 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -151,12 +151,17 @@  libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
 
 # Default target when executing plain make
 boot		:= arch/arm64/boot
+
+ifeq ($(CONFIG_EFI_ZBOOT),)
 KBUILD_IMAGE	:= $(boot)/Image.gz
+else
+KBUILD_IMAGE	:= $(boot)/vmlinuz.efi
+endif
 
-all:	Image.gz
+all:	$(notdir $(KBUILD_IMAGE))
 
 
-Image: vmlinux
+Image vmlinuz.efi: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 Image.%: Image
diff --git a/arch/arm64/boot/.gitignore b/arch/arm64/boot/.gitignore
index 9a7a9009d43a..af5dc61f8b43 100644
--- a/arch/arm64/boot/.gitignore
+++ b/arch/arm64/boot/.gitignore
@@ -1,3 +1,4 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
 Image
 Image.gz
+vmlinuz*
diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile
index a0e3dedd2883..c65aee088410 100644
--- a/arch/arm64/boot/Makefile
+++ b/arch/arm64/boot/Makefile
@@ -38,3 +38,9 @@  $(obj)/Image.lzo: $(obj)/Image FORCE
 
 $(obj)/Image.zst: $(obj)/Image FORCE
 	$(call if_changed,zstd)
+
+EFI_ZBOOT_PAYLOAD	:= Image
+EFI_ZBOOT_BFD_TARGET	:= elf64-littleaarch64
+EFI_ZBOOT_MACH_TYPE	:= ARM64
+
+include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot