# custom kernel not loaded



## Sebastian (May 24, 2018)

Hey,

I'm using a custom kernel with vnet enabeld. I stumbled over the tcp fast open option and created a new kernel named VNET_NEW.

Now I have two custom kernels VNET-KERNEL (old) , VNET_NEW (new) in this directory.

/usr/obj/usr/src/sys/


```
freebsd% ls -l
total 1082
drwxr-xr-x   3 root  wheel  4031 May 22 11:27 GENERIC
drwxr-xr-x   3 root  wheel   230 May 22 21:11 VNET-KERNEL
drwxr-xr-x   3 root  wheel   230 May 23 23:35 VNET_NEW
drwxr-xr-x  12 root  wheel    12 May 23 23:38 boot
```

I don't know how the zfs boot process works , but I think it loads /bootpool/boot/kernel ?


```
freebsd% pwd
/bootpool/boot
freebsd% ls -l | grep kernel
drwxr-xr-x  2 root  wheel     815 May 23 22:50 kernel
drwxr-xr-x  2 root  wheel     815 May 21 23:02 kernel.old
drwxr-xr-x  2 root  wheel     850 Apr 17 21:29 kernel.old1
freebsd%
```

As you can the see kernel seems to be build at may 23 22:50 which should be the new VNET_NEW .
But it is not loaded , after a reboot.


```
FreeBSD freebsd.home.lan 11.1-RELEASE-p10 FreeBSD 11.1-RELEASE-p10 #4 r334026: Tue May 22 11:21:24 CEST 2018     root@freebsd.home.lan:/usr/obj/usr/src/sys/VNET-KERNEL
```

If I do a installkernel I can see that eveything ist coppied to /boot/kernel.

But for me it looks like that  that /bootpol/boot/kernel is used ... .

So that can not work...

I think there is a missing symlink or something like that ?


```
freebsd% pwd
/boot
freebsd% ls -l
total 83
-r--r--r--  1 root  wheel   829 May 22 11:42 device.hints
-rw-------  1 root  wheel  4096 May 24 11:26 entropy
drwxr-xr-x  2 root  wheel   815 May 24 12:11 kernel
drwxr-xr-x  2 root  wheel   815 May 23 22:32 kernel.old
drwxr-xr-x  2 root  wheel   816 May 22 22:02 kernel.old1
freebsd% pwd
/boot
```

EDIT:

Removed the /boot dir . created a symlink for /boot to /bootpool/boot/


----------



## ShelLuser (May 24, 2018)

Impossible to comment on this because you're not giving us any useful information.

First and foremost though: why customize your kernel? Usually there's no need for that. Anyway; what version of FreeBSD are you using (I noticed the version numbers, but for all I know you could also be trying to set up another version) and how did you configure your kernel (please share your configuration file)?

Did you use the source tree from the distribution or did you get it from somewhere else?

And when you say it's not loaded: what _exactly_ does it do? Any specific error messages?

Do you see any white text scrolling over your screen?  Because if so then your kernel is getting loaded and the actual problem lies somewhere else.

(edit)

And no, it does not load /bootpol/boot, I don't know how you came up with that weird idea, but it's wrong. You need /boot/kernel. See also /boot/defaults/loader.conf. If you start messing with /boot you're well on your way to totally trash your system.

What is happening though is that your main ZFS pool filesystem, the one which contains /boot, will be mentioned in your main pool. See `zpool get bootfs zroot` (assuming your main pool is zroot). This will then also propagate in /boot/loader.conf where you'll find the option vfs.root.mountfrom which will point to the ZFS pool filesystem which contains your kernel. In the example I mentioned this would list zfs:zroot.

See also loader.conf(5) as well as Chapter 12 of the FreeBSD handbook.


----------

