# FreeBSD kernel built, installed, but doesn't load.



## DnDwarf (Mar 5, 2010)

Hello. Sorry for disturbing you. But I've met a strange problem while installing my custom kernel on one of my servers. Did everything as usual.


```
#uname -a
FreeBSD mail2.plane.ru 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC 2009     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
#cd /usr/src/sys/amd64/conf
#cp GENERIC MYKERN
#edit MYKERN
```

Then I edited conf file as I need it.


```
#cd /usr/ports
#make buildkernel KERNCONF=MYKERN
#make installkernel KERNCONF=MYKERN
# ls -l | grep kern
drwxr-xr-x 2 root wheel 10752 Mar 4 15:11 kernel
drwxr-xr-x 2 root wheel 25088 Mar 4 09:49 kernel.old
```

Everything seems ok. Then I go for reboot and after it I see:

```
#uname -a
FreeBSD mail2.plane.ru 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC 2009     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
```

Nothing changed.


```
#sysctl -a kern.bootfile
kern.bootfile: /boot/kernel/kernel

# strings -a /boot/kernel/kernel | grep :/
5:/R
ufs:/dev/md0
/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall
    root@mail2.plane.ru:/usr/obj/usr/src/sys/MYKERN
```

I've tried 

#nextboot -k kernet 

But everything I've got was:


```
#uname -a
FreeBSD mail2.plane.ru 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC 2009     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
```


```
2# cat /boot/loader.conf
geom_mirror_load="YES"
```

Could you please give me any advise where to look what is wrong, because I can't understand where is this kernel that boots on.. I've tried to replase /boot/GENERIC with my kernel, I've even tried to poot my kernel to /usr/obj/usr/src/sys in a direcotry called GENERIC, but this did't work either, so I'm completely emberessed now.


----------



## DutchDaemon (Mar 5, 2010)

```
#[B]cd /usr/ports[/B]
#make buildkernel KERNCONF=MYKERN
#make installkernel KERNCONF=MYKERN
```

Excuse me?


----------



## DnDwarf (Mar 5, 2010)

Sorry,

```
#cd /usr/src
```

of caurse.


----------



## SirDice (Mar 5, 2010)

Edit the MYKERN file and change the *ident* line. Set it to MYKERN.


----------



## DnDwarf (Mar 5, 2010)

Ident was chaged to MYKERN at the first time when I was editing MYKERN file.


----------



## achix (Mar 5, 2010)

Maybe try
`# ls -l /boot/kernel/kernel /boot/kernel.old/kernel`
`# md5  /boot/kernel/kernel /boot/kernel.old/kernel`

Do you see the supposed new kernel installed in place and the old one in kernel.old?
FYI /boot/GENERIC is primarily for use with freebsd-update(8).


----------



## DnDwarf (Mar 5, 2010)

achix, what do you mean? 


```
# strings -a /boot/kernel/kernel | grep :/
5:/R
ufs:/dev/md0
/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall
    [email]root@mail2.plane.ru[/email]:/usr/obj/usr/src/sys/MYKERN
```
-  shows that in /boot/kernel/kernel installed my kernel and


```
#sysctl -a kern.bootfile
kern.bootfile: /boot/kernel/kernel
```

says that boot should start with /boot/kernel/kernel but it doesn't. I've tryied to look to /boot/loader.conf to see if kern.bootfile was changed  , but there is nothings there.
So I'm trying to find out what are the possibilities why this is happening. 
I've tried to find all "kernel" files on my fs, all generic kernels that could be. I've even rewritten /boot/GENERIC with my kernel, but made a backup of course, so now there is no GENERIC kernel folder in my fs. But it still loads somehow. So I'm trying to find out what else can be. =(


----------

