File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1010#
1111# ----------------------------------------------------------------------
1212
13+ me=${0##*/ }
14+
1315check_vmlinux ()
1416{
1517 if file " $1 " | grep -q ' Linux kernel.*boot executable' ||
1618 readelf -h " $1 " > /dev/null 2>&1
1719 then
1820 cat " $1 "
21+ echo " $me : Extracted vmlinux using '$2 ' from offset $3 " >&2
1922 exit 0
2023 fi
2124}
@@ -30,12 +33,11 @@ try_decompress()
3033 do
3134 pos=${pos%%:* }
3235 tail -c+$pos " $img " | $3 > $tmp 2> /dev/null
33- check_vmlinux $tmp
36+ check_vmlinux $tmp " $3 " $pos
3437 done
3538}
3639
3740# Check invocation:
38- me=${0##*/ }
3941img=$1
4042if [ $# -ne 1 -o ! -s " $img " ]
4143then
@@ -57,7 +59,7 @@ try_decompress '\002!L\030' xxx 'lz4 -d'
5759try_decompress ' (\265/\375' xxx unzstd
5860
5961# Finally check for uncompressed images or objects:
60- check_vmlinux $img
62+ check_vmlinux " $img " cat 0
6163
6264# Bail out:
6365echo " $me : Cannot find vmlinux." >&2
You can’t perform that action at this time.
0 commit comments