diff mbox series

[ImageBuilder,v2] uboot-script-gen: fix arm64 xen u-boot image generation

Message ID 20250416165014.2263305-1-grygorii_strashko@epam.com (mailing list archive)
State New
Headers show
Series [ImageBuilder,v2] uboot-script-gen: fix arm64 xen u-boot image generation | expand

Commit Message

Grygorii Strashko April 16, 2025, 4:50 p.m. UTC
From: Grygorii Strashko <grygorii_strashko@epam.com>

The current code in generate_uboot_images() does not detect arm64 properly
and always generates ARM u-boot image, because below command
 file -L $XEN
returns string which may contain "Aarch64" or "ARM64", and, in the later
case, the current code will mistakenly identify Xen binary as "ARM".
This causes Xen boot issues.

Fix it by searching for "ARM64|Aarch64" for AArch64 binary detection.

- mkimage -l xen.ub
Before:
 Image Type:   ARM Linux Kernel Image (uncompressed)

After:
 Image Type:   AArch64 Linux Kernel Image (uncompressed)

Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
---
changes in v2:
- check for "Aarch64" in addition to "ARM64"

 scripts/uboot-script-gen | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stefano Stabellini April 16, 2025, 9:55 p.m. UTC | #1
On Wed, 16 Apr 2025, Grygorii Strashko wrote:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
> 
> The current code in generate_uboot_images() does not detect arm64 properly
> and always generates ARM u-boot image, because below command
>  file -L $XEN
> returns string which may contain "Aarch64" or "ARM64", and, in the later
> case, the current code will mistakenly identify Xen binary as "ARM".
> This causes Xen boot issues.
> 
> Fix it by searching for "ARM64|Aarch64" for AArch64 binary detection.
> 
> - mkimage -l xen.ub
> Before:
>  Image Type:   ARM Linux Kernel Image (uncompressed)
> 
> After:
>  Image Type:   AArch64 Linux Kernel Image (uncompressed)
> 
> Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> changes in v2:
> - check for "Aarch64" in addition to "ARM64"
> 
>  scripts/uboot-script-gen | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
> index 527b70dfdc4b..f3ca787e557f 100755
> --- a/scripts/uboot-script-gen
> +++ b/scripts/uboot-script-gen
> @@ -824,13 +824,13 @@ function linux_config()
>  
>  generate_uboot_images()
>  {
> -    local arch=$(file -L $XEN | grep "ARM")
> +    local arch=$(file -L $XEN | grep -E 'ARM64|Aarch64')
>  
>      if test "$arch"
>      then
> -        arch=arm
> -    else
>          arch=arm64
> +    else
> +        arch=arm
>      fi
>  
>      mkimage -A $arch -T kernel -C none -a $memaddr -e $memaddr -d $XEN "$XEN".ub
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 527b70dfdc4b..f3ca787e557f 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -824,13 +824,13 @@  function linux_config()
 
 generate_uboot_images()
 {
-    local arch=$(file -L $XEN | grep "ARM")
+    local arch=$(file -L $XEN | grep -E 'ARM64|Aarch64')
 
     if test "$arch"
     then
-        arch=arm
-    else
         arch=arm64
+    else
+        arch=arm
     fi
 
     mkimage -A $arch -T kernel -C none -a $memaddr -e $memaddr -d $XEN "$XEN".ub