summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2020-05-27 20:46:13 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2020-05-27 20:53:10 +0800
commitb0c8cc9500c2bfccead9849a6bc9f6107efbeabf (patch)
tree010906ce83f6a884bfbdc19df6029cb165e81a26
parentfd08d3aa39139bef85c562bfc5a7fffd9a04dd1c (diff)
downloadcuttlefish_kernel-b0c8cc9500c2bfccead9849a6bc9f6107efbeabf.tar.gz
extract-vmlinux: update to check to search "MS-DOS executable"
instead of check if there is a line that ends with "MS-DOS executable", as on some host OS, there might be other information printed after "MS-DOS executable". Like on Debian OS, the output is something like following: $ cat /etc/issue Debian GNU/Linux bullseye/sid \n \l $ file cuttlefish_assembly/vmlinux cuttlefish_assembly/vmlinux: MS-DOS executable PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows $ Test: boot test manually with launch_cvd command Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org> Change-Id: I0e6d761271f4182d8efa45a1851e4a3bea013952
-rwxr-xr-xscripts/extract-vmlinux6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/extract-vmlinux b/scripts/extract-vmlinux
index 1f90139..7724f38 100755
--- a/scripts/extract-vmlinux
+++ b/scripts/extract-vmlinux
@@ -18,7 +18,11 @@ check_vmlinux()
readelf -h $1 > /dev/null 2>&1
if [ $? -ne 0 ]; then
# On ARM64, the kernel might be a PE file instead
- file $1 | grep -q "MS-DOS executable$" || return 1
+ # and output of file command might be something like following:
+ # $ file cuttlefish_assembly/vmlinux
+ # cuttlefish_assembly/vmlinux: MS-DOS executable PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows
+ # $
+ file $1 | grep -q "MS-DOS executable" || return 1
fi
cat $1