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

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


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Wed, 16 Apr 2025 13:44:15 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N6O72mmPpn6wz0QsBJK+VKv7oc9K5Gdtio31aQecTo4=; b=HObTeuOF9njo3GMkuRzwevXBGLOzTuIIGIiyfeo+zLHe8eTVJliue02ig/afpr2Bd+G7mGhX2m38k98y9PMtdzj1oHB/Q0HI+TSif4sDnjT2NL7TP+nthrtuIKS3d8JQGYlWu2BBqMqJZl1NmHiE27dpYz7BXzy/gklqkLER4qoixOD4i9jKJ2UjNHTXU0TmqQkUjTuHiAUjkzcKEedIdUYUVvXMD0rbxYeMuOCUpAjht9rnCQvm8akHcmIKorvK9Ec7FtNXPfyVfVvurgCbLbg1WDXrOYjyfdsFbAz9Nw6ny7i9DWWYbcZQxTgSFP+YQvG3MezB57H21iDAKdtjjg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Grsy6YyQ5cT8pE0PlQVDXT+VBFFBoaPKsLlAmyjt6Va2siQDWmpSjo34FhFqtpCK1IXW7lRLJjKqcam5v2UaFO0RiCWGKWgqhDjKCYV84tP5F1wNZC6+ti+Mzfg/Yb102mlOysONDbmz65Yd/WLQJjkecVBkeuTFz8BX1LWRLuyqq93c7FAAfs5fTx53/G2B/dJk2qGCGfp235TPuPwY6pg23dz+faEbPj4fxLHhzvPZ20/Y+SE6p4R/5l5SyuHBPjiKIiCcGjOaqJGOGstyo/IrFFr9Fz7zwV/XZ7P3g3q64biczdBjeRTRQI64eA+3ZDX+qby4Y4SB3C5N2XK70Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 16 Apr 2025 10:44:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 16.04.25 04:03, Stefano Stabellini wrote:
On Mon, 14 Apr 2025, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

The current code in generate_uboot_images() does not detect arm64 properly
and always generates ARM u-boot image. This causes Xen boot issues.

Fix it by searching for "ARM64" 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@xxxxxxxx>
---
  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 a9f698f00fd1..c4d26caf5e0e 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -815,13 +815,13 @@ function linux_config()
generate_uboot_images()
  {
-    local arch=$(file -L $XEN | grep "ARM")
+    local arch=$(file -L $XEN | grep -o "ARM64")

My file -L gives:

for arm32: ARM OpenFirmware [...]
for arm64: Aarch64

So the ARM64 grep wouldn't work as intended. Is the version of `file'
that you are using really printing ARM64?

Hm, yes.

        file -L xen
        xen: Linux kernel ARM64 boot executable Image, little-endian, 4K pages

        file -v
        file-5.41

u-boot boot command:
         bootm 0x4EA00000 - 0x4EE00000


 If so, we can do:

   file -L $XEN | grep -E 'ARM64|Aarch64'

sure. I'll update.



      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


--
Best regards,
-grygorii



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.