Subject: Re: bin/7656: run kvm_mkdb at boot to fix dmesg error
To: None <darrenr@merlin.reed.wattle.id.au>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 05/28/1999 14:12:43
Darren Reed wrote:

> >Description:
> 	When booting NetBSD with a new kernel, dmesg and other programs
> which use the kvm db fail.  To resolve this problem, I propose using
> sysctl (where applicable) to help kvm_mkdb to rebuilt the database
> correctly.
> >How-To-Repeat:
> 	Put a new kernel in /, reboot with it and run dmesg.
> >Fix:
> 	The patch below runs kvm_mkdb against the correct kernel if it
> can get the name from sysctl.
> 
> *** rc.dist	Fri May 28 05:23:24 1999
> --- rc	Fri May 28 05:23:14 1999
> ***************
> *** 143,148 ****
> --- 143,152 ----
>   
>   # get the system dmesg output, hopefully containing the boot messages
>   # $dmesg_flags is imported from /etc/rc.conf
> + sysctl machdep | grep -q booted_kernel
> + if [ $? -eq 0 ] ; then
> + 	kvm_mkdb `sysctl -n machdep.booted_kernel`
> + fi

This gives wierd errors on a pmax:

	mona:~ 11# sysctl -n machdep.booted_kernel
	3/rz2/netbsd
	mona:~ 12# kvm_mkdb `sysctl -n machdep.booted_kernel`
	kvm_mkdb: 3/rz2/netbsd: No such file or directory
	

Simon.