All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [ImageBuilder 1/5] uboot-script-gen: Update to deal with uImage which is not executable
Date: Wed, 17 Apr 2024 15:07:37 +0300	[thread overview]
Message-ID: <20240417120741.2453431-2-olekstysh@gmail.com> (raw)
In-Reply-To: <20240417120741.2453431-1-olekstysh@gmail.com>

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

uImage is the Image that has a U-Boot wrapper, it doesn't contain
"executable" string which subsequent "file" command is looking for
when inspecting it.

Below the proof:

otyshchenko@EPUAKYIW03DD:~/work/xen_tests/input$ file -L binaries/uImage.gz
binaries/uImage.gz: u-boot legacy uImage, Linux Kernel Image, Linux/ARM 64-bit,
OS Kernel Image (gzip), 9822180 bytes, Fri Sep 29 15:39:42 2023, Load Address: 0X40000000,
Entry Point: 0X40000000, Header CRC: 0XE1EF21BF, Data CRC: 0XC418025

otyshchenko@EPUAKYIW03DD:~/work/xen_tests/input$ file -L binaries/uImage
binaries/uImage: u-boot legacy uImage, Linux Kernel Image, Linux/ARM 64-bit,
OS Kernel Image (Not compressed), 23269888 bytes, Fri Sep 29 15:40:19 2023,
Load Address: 0X40000000, Entry Point: 0X40000000, Header CRC: 0XA0B7D051,
Data CRC: 0X42083F51

Suggested-by: Stefano Stabellini <stefano.stabellini@amd.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
---
 scripts/uboot-script-gen | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 3cc6b47..7cb8c6d 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -505,9 +505,9 @@ function check_file_type()
 
     # if file doesn't know what it is, it outputs data, so include that
     # since some executables aren't recongnized
-    if [ "$type" = "executable" ]
+    if [[ "$type" = "executable"* ]]
     then
-        type="executable\|data\|ARM OpenFirmware"
+        type="$type\|data\|ARM OpenFirmware"
     # file in older distros (ex: RHEL 7.4) just output data for device
     # tree blobs
     elif [ "$type" = "Device Tree Blob" ]
@@ -712,7 +712,7 @@ xen_file_loading()
 {
     if test "$DOM0_KERNEL"
     then
-        check_compressed_file_type $DOM0_KERNEL "executable"
+        check_compressed_file_type $DOM0_KERNEL "executable\|uImage"
         dom0_kernel_addr=$memaddr
         load_file $DOM0_KERNEL "dom0_linux"
         dom0_kernel_size=$filesize
@@ -747,7 +747,7 @@ xen_file_loading()
             cleanup_and_return_err
         fi
 
-        check_compressed_file_type ${DOMU_KERNEL[$i]} "executable"
+        check_compressed_file_type ${DOMU_KERNEL[$i]} "executable\|uImage"
         domU_kernel_addr[$i]=$memaddr
         load_file ${DOMU_KERNEL[$i]} "domU${i}_kernel"
         domU_kernel_size[$i]=$filesize
-- 
2.34.1



  reply	other threads:[~2024-04-17 12:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 12:07 [ImageBuilder 0/5] Misc updates for the dom0less support Oleksandr Tyshchenko
2024-04-17 12:07 ` Oleksandr Tyshchenko [this message]
2024-04-17 12:26   ` [ImageBuilder 1/5] uboot-script-gen: Update to deal with uImage which is not executable Michal Orzel
2024-04-17 12:07 ` [ImageBuilder 2/5] uboot-script-gen: Extend DOMU_ENHANCED to specify "no-xenstore" Oleksandr Tyshchenko
2024-04-17 12:27   ` Michal Orzel
2024-04-17 12:07 ` [ImageBuilder 3/5] uboot-script-gen: Add ability to specify grant table params Oleksandr Tyshchenko
2024-04-17 12:28   ` Michal Orzel
2024-04-17 12:07 ` [ImageBuilder 4/5] uboot-script-gen: Add ability to unselect "vpl011" Oleksandr Tyshchenko
2024-04-17 12:31   ` Michal Orzel
2024-04-17 12:07 ` [ImageBuilder 5/5] uboot-script-gen: Add ability to specify "nr_spis" Oleksandr Tyshchenko
2024-04-17 12:33   ` Michal Orzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417120741.2453431-2-olekstysh@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=michal.orzel@amd.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@amd.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.