summaryrefslogtreecommitdiff
path: root/scripts/extract-vmlinux
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2025-08-12 02:15:41 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2025-08-12 22:14:02 +0300
commit9e293d47bfb9e812196670f2deeefc8b9d0226e4 (patch)
treea5f74c41abbd25749bf795f52e4e06c39ab7d102 /scripts/extract-vmlinux
parentfa479132845e94b60068fad01c2a9979b3efe2dc (diff)
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585 (diff)
downloadlinux-9e293d47bfb9e812196670f2deeefc8b9d0226e4.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Cross merge bpf/master after 6.17-rc1. No conflict. Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'scripts/extract-vmlinux')
-rwxr-xr-xscripts/extract-vmlinux13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/extract-vmlinux b/scripts/extract-vmlinux
index 8995cd304e6e..189956b5a5c8 100755
--- a/scripts/extract-vmlinux
+++ b/scripts/extract-vmlinux
@@ -12,13 +12,12 @@
check_vmlinux()
{
- # Use readelf to check if it's a valid ELF
- # TODO: find a better to way to check that it's really vmlinux
- # and not just an elf
- readelf -h $1 > /dev/null 2>&1 || return 1
-
- cat $1
- exit 0
+ if file "$1" | grep -q 'Linux kernel.*boot executable' ||
+ readelf -h "$1" > /dev/null 2>&1
+ then
+ cat "$1"
+ exit 0
+ fi
}
try_decompress()