# Neverending kernel installing & compiling FreeBSD 10.2-RELEASE-p3 -> FreeBSD 10.2-RELEASE-p7



## Arenio (Nov 4, 2015)

Hello everybody!

I'm new and welcome home ;-)

I've got a little problem after installing a patch.
After updating to FreeBSD 10.2-RELEASE-p7 from FreeBSD 10.2-RELEASE-p3 the system installs the new kernel as below.


```
The following files will be updated as part of updating to 10.2-RELEASE-p7:
/boot/kernel/kernel
/boot/kernel/kernel.symbols
```

So, I rebuild my own and then after command `freebsd-update fetch` I still have the option to install new kernel files... After that I have to rebuild my own etc.
Rebooting is done as well.

Is there any option to avoid that or fix such bug?
Thank you for you replies.


Regards
Arenio


----------



## tobik@ (Nov 4, 2015)

If you compile your own kernel remove the kernel component from /etc/freebsd-update.conf so that freebsd-update(8) ignores it.


----------



## Arenio (Nov 4, 2015)

Ok, it's clear. As I know this option hide for OS to install kernel update if I have my own.

But should I avoid installing the new kernel with new features?
Can I install new kernel and then recomplie it for me?
Have I still hide the component kernel from /etc/freebsd-update.conf when using freebsd-update?


----------



## obsigna (Nov 4, 2015)

Arenio said:


> Ok, it's clear. As I know this option hide for OS to install kernel update if I have my own


Yes!



Arenio said:


> But should I avoid installing the new kernel with new features?


No!
Each time I did a `freebsd-update install`, I run `# tmux new "cd /usr/src; make -j4 kernel KERNFAST=MY_KERNEL_SPEC"`. I don't even try to find out if the changes actually hit the kernel, I simply re-build my custom kernel, because only by this the patch level of the system becomes updated as well. I usually run both commands in a row, and only restart once everything is in place in order to complete the procedure.


Arenio said:


> Can I install new kernel and then recomplie it for me?


Yes, however, why do you want to do this? If you remove kernel from the components of /etc/freebsd-update.conf then you would update src and base by `freebsd-update install`, and the kernel by the other command given above.



Arenio said:


> Have I still hide the component kernel from /etc/freebsd-update.conf when using freebsd-update?


Have to, is quite harsh. I would say, it is better to remove kernel from the list of the components. If you want to stay with your custom kernel, then you need to re-build it anyway.


----------



## Arenio (Nov 4, 2015)

I run the command `make -j4 kernel KERNFAST=MY_KERNEL_SPEC` without success.
It means the freebsd-update(8) still needs to fetch and install the kernel.


```
The following files will be updated as part of updating to 10.2-RELEASE-p7:
/boot/kernel/kernel
/boot/kernel/kernel.symbols
```

I don't want that message every time when I recompile the kernel and fetch/install patches.
Avoiding installing the kernel from /etc/freebsd-update.conf is not good solution in my opinion.
When I upgraded FreeBSD from 10.1 to 10.2 I hadn't this problem after compiling my kernel.


----------



## SirDice (Nov 4, 2015)

Is there a specific reason to run a custom kernel? If the GENERIC kernel does what you need it to do why not simply run GENERIC? Almost everything can be dynamically loaded anyway. On 10.x systems you can use freebsd-version(1) to keep track of both the userland and kernel version.


----------



## obsigna (Nov 4, 2015)

Arenio said:


> ...
> Avoiding installing the kernel from /etc/freebsd-update.conf is not good solution in my opinion.
> ...


Seems that we are talking past each other.

Berfore anything else, please confirm as by the request of SirDice that you need/want a custom kernel.

If the answer is *NO* Custom Kernel, then don't edit /etc/freebsd-update.conf and update your system by occasionally running:
1. `freebsd-update fetch`
(Continue only, if the message of the previous command said that there are updates.)
2. `freebsd-update install`
3. `shutdown -r now`

If the answers is *YES, I want a *Custom Kernel, then edit /etc/freebsd-update.conf and remove kernel from the components. This will prevent freebsd-update from installing the binaries of a vanilla GENERIC kernel, which you don't want as you said *YES* to the above question. Anyway freebsd-update will still install all updates of the *kernel sources* and that would include everything that you need to build your updated Custom Kernel. The update procedure in this case is:
1. `freebsd-update fetch`
(Continue only, if the message of the previous command said that there are updates.)
2. `freebsd-update install`
3. `tmux new "cd /usr/src; make -j4 kernel KERNFAST=MY_KERNEL_SPEC"`
4. `shutdown -r now`

Only to be very clear, MY_KERNEL_SPEC is a placeholder for the ident name of your Custom Kernel configuration. And with this procedure you will end up with an updated kernel, in this case a custom one. So this procedure by no way means to avoid updating the kernel, completely in contrary -- was this clear now?

Notes:
In the YES case, you must not build the kernel before freebsd-update fetch/install, but after this, and you need to build it only if `freebsd-update fetch` really found changes.

You might want to clean the freebsd-update history, since the continuous repetition of the messages on "new" kernel binaries waiting to being installed may come from something gone wrong in the past. Do the following only if you are absolutely sure that you don't want to run `freebsd-update rollback` on anything now.

`rm -r  /var/db/freebsd-update/*`


----------



## Arenio (Nov 5, 2015)

The answer is *YES*. The key of the thread "Anyway freebsd-update will still install all updates of the kernel sources and that would include everything that you need to build your updated Custom Kernel."

Thanks for your help.


----------

