grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC/RFT 1/3] loader: Move arm64 linux loader to common code


From: Heinrich Schuchardt
Subject: Re: [PATCH RFC/RFT 1/3] loader: Move arm64 linux loader to common code
Date: Mon, 27 Apr 2020 01:01:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/26/20 9:40 PM, Atish Patra wrote:
> ARM64 linux loader code is written in such a way that it can be reused
> across different architectures without much change. Move it to common
> code so that RISC-V doesn't have to define a separate loader.
>
> Signed-off-by: Atish Patra <address@hidden>

Tested on Odroid-C2 (ARMv8) using GRUB master c543d678105037a plus this
patch series booting from U-Boot via GRUB to Debian Bullseye successfully.

Tested-by: Heinrich Schuchardt <address@hidden>

> ---
>  grub-core/Makefile.core.def             | 4 ++--
>  grub-core/loader/{arm64 => efi}/linux.c | 2 +-
>  include/grub/arm/linux.h                | 2 +-
>  include/grub/arm64/linux.h              | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>  rename grub-core/loader/{arm64 => efi}/linux.c (99%)
>
> diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
> index 48b82e76322f..57bb70d73764 100644
> --- a/grub-core/Makefile.core.def
> +++ b/grub-core/Makefile.core.def
> @@ -1813,9 +1813,9 @@ module = {
>    sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
>    ia64_efi = loader/ia64/efi/linux.c;
>    arm_coreboot = loader/arm/linux.c;
> -  arm_efi = loader/arm64/linux.c;
> +  arm_efi = loader/efi/linux.c;
>    arm_uboot = loader/arm/linux.c;
> -  arm64 = loader/arm64/linux.c;
> +  arm64 = loader/efi/linux.c;
>    riscv32 = loader/riscv/linux.c;
>    riscv64 = loader/riscv/linux.c;
>    common = loader/linux.c;
> diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/efi/linux.c
> similarity index 99%
> rename from grub-core/loader/arm64/linux.c
> rename to grub-core/loader/efi/linux.c
> index ef3e9f9444ca..8c7a4963f023 100644
> --- a/grub-core/loader/arm64/linux.c
> +++ b/grub-core/loader/efi/linux.c
> @@ -51,7 +51,7 @@ static grub_addr_t initrd_end;
>  grub_err_t
>  grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh)
>  {
> -  if (lh->magic != GRUB_LINUX_ARMXX_MAGIC_SIGNATURE)
> +  if (lh->magic != GRUB_LINUX_ARCH_MAGIC_SIGNATURE)
>      return grub_error(GRUB_ERR_BAD_OS, "invalid magic number");
>
>    if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC)
> diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h
> index 2e98a6689696..c924d15446af 100644
> --- a/include/grub/arm/linux.h
> +++ b/include/grub/arm/linux.h
> @@ -35,7 +35,7 @@ struct linux_arm_kernel_header {
>  };
>
>  #if defined(__arm__)
> -# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE
> +# define GRUB_LINUX_ARCH_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE
>  # define linux_arch_kernel_header linux_arm_kernel_header
>  #endif
>
> diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h
> index 4269adc6dae5..96aa3bae01ee 100644
> --- a/include/grub/arm64/linux.h
> +++ b/include/grub/arm64/linux.h
> @@ -37,7 +37,7 @@ struct linux_arm64_kernel_header
>  };
>
>  #if defined(__aarch64__)
> -# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE
> +# define GRUB_LINUX_ARCH_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE
>  # define linux_arch_kernel_header linux_arm64_kernel_header
>  #endif
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]