Allow matches of truncated version strings.
Long objdir paths make it easy to hit the version string length limit in kernel dump headers. The build number and timestamp are unlikely to be truncated and ought to be sufficient to protect against false positives. Discussed with: jhb MFC after: 1 week
This commit is contained in:
parent
274b460b60
commit
5a3924b985
@ -83,10 +83,12 @@ find_kernel()
|
|||||||
}
|
}
|
||||||
}' $INFO)
|
}' $INFO)
|
||||||
|
|
||||||
# Look for a matching kernel version.
|
# Look for a matching kernel version, handling possible truncation
|
||||||
|
# of the version string recovered from the dump.
|
||||||
for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do
|
for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do
|
||||||
kvers=$(gdb_command $k 'printf " Version String: %s", version' \
|
kvers=$(gdb_command $k 'printf " Version String: %s", version' | \
|
||||||
2>/dev/null)
|
awk "{line=line\$0\"\n\"} END{print substr(line,1,${#ivers})}" \
|
||||||
|
2>/dev/null)
|
||||||
if [ "$ivers" = "$kvers" ]; then
|
if [ "$ivers" = "$kvers" ]; then
|
||||||
KERNEL=$k
|
KERNEL=$k
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user