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

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Wed, 16 Apr 2025 16:50:15 +0000
  • Accept-language: en-US
  • 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=sQiuKA+zddsVl/h5lOfnW7qtl1lldnQeW9ZSeD8NWFg=; b=hgvkaRN2SAsLAHmQdBSrrf5nUMhP3JOy5EhC43/nbDRQZI5JEtaPfKioGzG7DbNPD3HC3MLChyoBMT0YF61yu0lhuMxbsla93P6zh6aM0hPaCUhsOOS5dfRCvDCoE/2uRZUpFA8BiQS/Ve61smYe0KrjyOxJHxyQGWuy7tnCkja5wa8mwCYEkFxhU+jh7TQ93/8Ez3wSapUrxQkKFw3VMsNf21bLxbg51ltiJGhB9Zazssf5JH1M5HsEphiRC1ivQm+ajWhM2tVi+fK67ahDjSuSshCylruYCbWFQh6V53fJ8KbeFMe8zyKNd4nHhiL/QvFamK/VGfQPSBrx8ggOZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q0tPZThCZewHh7QVTp20jpOonR54yN/EtdSqWwQxYKeHcnRWUOkBjzFkMTEyoHEcNKS0cH7K9k7wLhaZd1TQXTKvnVjjxIRQwB/p7KJYCJA+edI/xnFUZZQpSPaKsVAIhqIGVkF/ZY9we4wOqKRoukAs52lrfrLNINinZDotnFqp6ACRsD6LohFm1X2xrJEjXdvsGCml1k86r4Ls1kT2Z84+SdWytey34jz+zqms2kfs/wmX1H4xBLScBtloS/U9vU/U/bSxMzdW9bl5qGfu4RV++Uqvh0yhNMW3A14aMLI2r0Yn8KOCbXt3Jzvt+H1ZeLVcZLYoib/2cgseqjg9yw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Alejandro Vallejo <agarciav@xxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Wed, 16 Apr 2025 16:50:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbru+gjQsTQ/HM4kWWIbbQtHW9Sg==
  • Thread-topic: [ImageBuilder v2] uboot-script-gen: fix arm64 xen u-boot image generation

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, 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@xxxxxxxx>
---
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



 


Rackspace

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