Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

extract-vmlinux: Output used decompression method

When extract-vmlinux succeeds, it doesn't output which decompression method
was found at which offset. Adding this additional output in check_vmlinux()
helps troubleshooting and reverse-engineering images.

The last check_vmlinux() call was also quoted to accept spaces.

Signed-off-by: Maxime Thiebaut <maxime+kernel@thiebaut.dev>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://lore.kernel.org/r/X6OQ4pHdpreJtlTnf0tFEb4Uxz8T8gFv_7Yw6tpBK4ZBgHYjJr_URwUwCVynpkb-H8Yjk7DdBF01zY-sfqu_7N5trZQfcd6s_4PtdGlHtlA=@thiebaut.dev
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

authored by

Maxime Thiebaut and committed by
Nathan Chancellor
1e150869 0354e81b

+5 -3
+5 -3
scripts/extract-vmlinux
··· 10 10 # 11 11 # ---------------------------------------------------------------------- 12 12 13 + me=${0##*/} 14 + 13 15 check_vmlinux() 14 16 { 15 17 if file "$1" | grep -q 'Linux kernel.*boot executable' || 16 18 readelf -h "$1" > /dev/null 2>&1 17 19 then 18 20 cat "$1" 21 + echo "$me: Extracted vmlinux using '$2' from offset $3" >&2 19 22 exit 0 20 23 fi 21 24 } ··· 33 30 do 34 31 pos=${pos%%:*} 35 32 tail -c+$pos "$img" | $3 > $tmp 2> /dev/null 36 - check_vmlinux $tmp 33 + check_vmlinux $tmp "$3" $pos 37 34 done 38 35 } 39 36 40 37 # Check invocation: 41 - me=${0##*/} 42 38 img=$1 43 39 if [ $# -ne 1 -o ! -s "$img" ] 44 40 then ··· 59 57 try_decompress '(\265/\375' xxx unzstd 60 58 61 59 # Finally check for uncompressed images or objects: 62 - check_vmlinux $img 60 + check_vmlinux "$img" cat 0 63 61 64 62 # Bail out: 65 63 echo "$me: Cannot find vmlinux." >&2