Skip to content

Commit db139d7

Browse files
committed
extract-vmlinux: Check for uncompressed image as fallback
As on x86-64 and other architectures, the boot kernel on parisc (vmlinuz and bzImage) contains a full compressed copy of the final kernel executable (vmlinux.bin.gz), which one should be able to extract with the extract-vmlinux script. But on parisc extracting the kernel with extract-vmlinux fails. Currently the script first checks if the given file is an ELF file (which is true on parisc) and if so returns it. Thus on parisc we unexpectedly get back the vmlinuz boot file instead of the uncompressed vmlinux image. This patch fixes this issue by reverting the logic. It now first tries to find a compression signature in the given file and if that fails it checks the file itself as fallback. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 1138b67 commit db139d7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎scripts/extract-vmlinux‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ fi
4848
tmp=$(mktemp /tmp/vmlinux-XXX)
4949
trap "rm -f $tmp" 0
5050

51-
# Initial attempt for uncompressed images or objects:
52-
check_vmlinux $img
53-
5451
# That didn't work, so retry after decompression.
5552
try_decompress '\037\213\010' xy gunzip
5653
try_decompress '\3757zXZ\000' abcde unxz
@@ -60,5 +57,8 @@ try_decompress '\211\114\132' xy 'lzop -d'
6057
try_decompress '\002!L\030' xxx 'lz4 -d'
6158
try_decompress '(\265/\375' xxx unzstd
6259

60+
# Finally check for uncompressed images or objects:
61+
check_vmlinux $img
62+
6363
# Bail out:
6464
echo "$me: Cannot find vmlinux." >&2

0 commit comments

Comments
 (0)