FreeBSD - Kernel Queries/Issues

All,

I am a bit of a BSD newbie and haven't really played with it for years, but I have had a recent situation whereby someone attempted to load a custom kernel module and ended up breaking my BSD server.

I managed to fix it by doing the following:

Booting into loader mode:

unload
set kernel="kernel.old"
boot-conf

When I do this the server boots fine and I have a working kernel as follows:

bash-2.05b# uname -a
FreeBSD mrslim 5.4-RELEASE FreeBSD 5.4-RELEASE #2: Fri Oct 31 15:51:10 GMT 2008 root@mrslim:/usr/obj/usr/src/sys/SMP i386

Here are the avaliable kernels:

bash-2.05b# cd /usr/src/sys/i386/conf/
bash-2.05b# ls -al
total 82
drwxr-xr-x 2 root wheel 512 Oct 31 14:55 .
drwxr-xr-x 13 root wheel 512 Jun 21 2005 ..
-rwxr-xr-x 1 root wheel 10005 Oct 31 16:13 GENERIC
-rwxr-xr-x 1 root wheel 1982 Apr 1 2004 GENERIC.hints
-rwxr-xr-x 1 root wheel 9966 Jun 21 2005 KERNEL-MOD1
-rwxr-xr-x 1 root wheel 120 Feb 26 2003 Makefile
-rwxr-xr-x 1 root wheel 33699 May 1 2005 NOTES
-rwxr-xr-x 1 root wheel 469 Jul 13 2004 OLDCARD
-rwxr-xr-x 1 root wheel 1754 Apr 30 2005 PAE
-rwxr-xr-x 1 root wheel 322 Feb 6 2005 SMP
-rwxr-xr-x 1 root wheel 9986 Oct 31 14:59 TOMHKERNEL

I have attempted to complie GENERIC, which seemed to work successfully.

make buildkernel KERNCONF=MYKERNEL

make installkernel KERNCONF=MYKERNEL

When the server is rebooted, none of the network cards are avaliable, the only way round this problem is to go into the loader and do what I mentioned above. I have troubleshooted the network setup and everything is fine, although I can't ping the default gateway, but I am convinced this is caused by my friend not installing his custom module correctly, as everything work perfectly with the current loaded kernel.

Can anyone tell me how I can resolve this issue? It seems I just need the current loaded kernel to be made as the default. I want to be able to restart the server and not have to worry about this failing over and over.. I just want my working setup to be restored permanently!

Thanks in advance.

-D

I think I may have found a way to do this:

'The kernel does not boot:

If your new kernel does not boot, or fails to recognize your devices, do not panic! Fortunately, FreeBSD has an excellent mechanism for recovering from incompatible kernels. Simply choose the kernel you want to boot from at the FreeBSD boot loader. You can access this when the system boot menu appears. Select the �Escape to a loader prompt� option, number six. At the prompt, type unload kernel and then type boot /boot/kernel.old/kernel, or the filename of any other kernel that will boot properly. When reconfiguring a kernel, it is always a good idea to keep a kernel that is known to work on hand.'

Is this what I should do to get this current kernel set as the default? Or shall I just get a new copy of the GENERIC kernel and start again with the recompile? The reason I say this is that the GENERIC kernel has been broken.

You can just rename /boot/kernel to something else (I'd do something like /boot/kernel.bad) and then rename /boot/kernel.old back to /boot/kernel.

did you try running sysinstall to reconfigure your network cards?
this has happened to me before and i ran sysinstall was able to set up my cards and everything worked fine.