# buildkernel fails with fatal error



## idude (Feb 15, 2021)

I'm trying to build a new kernel for the first time but it fails with this error:


```
/usr/src/sys/dev/ppbus/lpt.c:88:10: fatal error: `ppbus_if.h` file not found
```

I'm attaching my MYKERNEL conf file also.


----------



## zirias@ (Feb 15, 2021)

This is a generated file (should be generated during build), so something is severely messed up.

I won't read your whole config and I'm not sure the problem lies there, but just two remarks:

- in-kernel drm is deprecated for a long time now, don't ever use it. drm drivers are available as a port
- don't use a full kernel config, just `include GENERIC` and only list your differences


----------



## zirias@ (Feb 15, 2021)

Little example for what I mean: This is my whole config for a kernel named DESKTOP, including sg devices needed for multimedia/makemkv:

```
include GENERIC
ident DESKTOP

device          sg
```
It's much easier to maintain that way, you can focus on your actual changes and you won't miss out important upstream changes to the GENERIC config.


----------



## idude (Feb 15, 2021)

Zirias said:


> Little example for what I mean: This is my whole config for a kernel named DESKTOP, including sg devices needed for multimedia/makemkv:
> 
> ```
> include GENERIC
> ...


I was following the handbook and a book called Absolute FreeBSD.  I did remove the drm device on my second attempt because it err right away because of it.  include GENERIC I'm a little lost on how to do it.


----------



## SirDice (Feb 15, 2021)

```
# Parallel port
# device		ppc
# device		ppbus			# Parallel port bus (required)
device		lpt			# Printer
```
Both ppc(4) and ppbus(4) are required for lpt(4). One of the biggest 'problems' with a kernel configuration is that there's no good 'sanity' check with regards to dependencies. So you end up with a build failure at some point during your kernel build because you forgot some required dependency.


----------



## zirias@ (Feb 15, 2021)

idude said:


> include GENERIC I'm a little lost on how to do it.


I just showed an example. That was a "complete" (by including GENERIC) kernel config file in my posting above.

But reading SirDice's answer – are you trying to create a "stripped down" config? If so, just forget about that. It's typically not worth the hassle.


----------



## PMc (Feb 15, 2021)

idude said:


> I was following the handbook and a book called Absolute FreeBSD.


Yes that was the old way: one would create a kernel config with just the features and devices that are required. 
But nowadays most use cases can work with GENERIC and load the missing devices as kernel modules. This will cost some 10-15 MB of RAM for the superfluous drivers in GENERIC, and nobody seems to be bothered by that anymore.



idude said:


> I did remove the drm device on my second attempt because it err right away because of it.


That needs a little bit of hackery to make it work, but that is quite pointless now because it will be removed in Rel.13 anyway.


----------



## idude (Feb 16, 2021)

PMc said:


> Yes that was the old way: one would create a kernel config with just the features and devices that are required.
> But nowadays most use cases can work with GENERIC and load the missing devices as kernel modules. This will cost some 10-15 MB of RAM for the superfluous drivers in GENERIC, and nobody seems to be bothered by that anymore.
> 
> 
> That needs a little bit of hackery to make it work, but that is quite pointless now because it will be removed in Rel.13 anyway.


So everyone is loading all those useless drivers even though they don't need them!


----------



## zirias@ (Feb 16, 2021)

When you start a modern browser, you'll have MUCH more RAM allocated for things you never wanted. It just doesn't matter…


----------



## SirDice (Feb 16, 2021)

Yeah, it's honestly not worthwhile to tweak the kernel any more. Especially if you use freebsd-update(8) to keep your system up to date. It makes sense on embedded or small systems but then you're going to be tweaking src.conf(5) too in order to make things even smaller.


----------

