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