I've just uploaded a small program I wrote for configuring a kernel
based on the devices found by doing a dmesg with a generic kernel. It
tries to detect whether you're running a generic kernel by looking at
uname output then runs dmesg via a pipe, copies over
/usr/src/sys/arch/i386/conf/GENERIC line by line, commenting out devices
it doesn't find in dmesg. It's only been tested with i386, but was
written under 5.0 and also tested under 4.7. I'm running both kernels
now. It's very generic C and hopefully has no dependancies.
Alan
http://ab1jx.webs.com/calcs/kr/index.html