[parisc-linux] vmlinux header for savecrash.

Grant Grundler grundler@dsl2.external.hp.com
Mon, 21 Jan 2002 13:25:39 -0700


Bruno Vidal wrote:
> As I said few days ago, I've a dump driver ready.
> Now I'm working on a savecrash command. It works fine
> for the dump, but I need to save with the dump some
> informations like the running kernel at dump time.

Bruno - this is great!


> So in the dump I've got this informations:
> utsname_release and utsname_version. Now, how can
> I found the right kernel in /boot ? In other
> word, how can I retrieve utsname informations in a
> binary file (without system.map and gdb) ?

A couple of ideas/hacks:
o assume it's /boot/System.map + /boot/vmlinux. Tell people if they
  want to use dump/savecrash, that's what they have to do.

o assume it's in /boot. Use fgrep to find the matching strings.
  Something like
	#!/bin/sh
	cd /boot
	for i in *
	do
		fgrep $1 $i > /dev/null 2>&1
		if [ $? -eq 0 ]
		then
			echo $i
			exit 0
		fi
	done
	exit 1

The case that /boot might not be mounted could cause problems.

Since klogd seems to want System.map, perhaps savecrash could use
the same heuristics to find the "right" System.map.
See Documentation/oops-tracing.txt for more details.

hth,
grant