Solved kernel config and (required)

jbo@

Developer
In some places of the kernel config (I'm referring to the amd64 GENERIC one for this topic) I see stuff like this:
Code:
# Parallel port
device        ppc
device        ppbus          # Parallel port bus (required)
device        lpt            # Printer
device        ppi            # Parallel port interface device
#device        vpo            # Requires scbus and da

Now, what is this (required) telling me? Is this ppbus device required for the kernel to function at all or is this required if the above option (i.e. the ppc device) is enabled?

Lets have a look at another one:
Code:
# USB support
options     USB_DEBUG        # enable debug msgs
device        uhci            # UHCI PCI->USB interface
device        ohci            # OHCI PCI->USB interface
device        ehci            # EHCI PCI->USB interface (USB 2.0)
device        xhci            # XHCI PCI->USB interface (USB 3.0)
device        usb            # USB Bus (required)
device        ukbd            # Keyboard
device        umass            # Disks/Mass storage - Requires scbus and da

What's going on here? Is the usb device necessary for the kernel to function? Or is it required if any other devices in that section is enabled? Or is it required for all following devices in that section?

Am I overthinking things or... ?
 
If you look in LINT, it often has a more detailed explanation. For example, your first one, parallel ports:

# Parallel port bus support is provided by the `ppbus' device.
# Multiple devices may be attached to the parallel port, devices
# are automatically probed and attached when found.
This tells you along with the config file you quoted that, yes, ppbus is required.

In your second example, as in the first, the required means required for the device or drivers you're attempting to build into the kernel.

So, of course, all the controllers are ?hci and the usb device is required to make any of them function. Likewise for umass (if you want to use usb disks), you need to build in support for scbus and da. You could also have, for example, umodem on SBCs as well.
 
I bet it that the required means it is a common necessity. The GENERIC conf contains the base level requirements.
 
If you look in LINT, it often has a more detailed explanation. For example, your first one, parallel ports:

This tells you along with the config file you quoted that, yes, ppbus is required.
Just to be clear here: "yes, ppbus is required." as in: If I want to have any parallel devices (i.e. lpt, ppi, ...) working, right? It is NOT required by the kernel / base system itself, right? So if I'm dealing with a modern ultrabook that certainly doesn't feature a parallel port nor any built-in devices that would interface via that I can simply throw it out in my kernel config and I'll be fine? Although that would contradict with what Lamia said.

Also, could you be a bit more sperific regarding "look in LINT"?
 
Just to be clear here: "yes, ppbus is required." as in: If I want to have any parallel devices (i.e. lpt, ppi, ...) working, right? It is NOT required by the kernel / base system itself, right? So if I'm dealing with a modern ultrabook that certainly doesn't feature a parallel port nor any built-in devices that would interface via that I can simply throw it out in my kernel config and I'll be fine? Although that would contradict with what Lamia said.
That is correct. I have not tried, but it could be possible to build a kernel with no devices. It wouldn't be terribly useful but it would show you that there is no such thing as a required device for the kernel.

You can look at the man pages for the device, so that ppc(4) tells you it requires device ppbus. Just in case you get confused with the device options (not saying you will but for other readers of this thread).

Likewise, you may have USB on your laptop but not want it in your OS (security, for example), then you can omit all device commands for USB.

So, in summary, add only the devices specific to your laptop for your custom kernel.


Also, could you be a bit more sperific regarding "look in LINT"?

LINT is the file that contains all possible options etc. See here.
There's also NOTES with more descriptive configuration information.

I will quote from the freebsd handbook:
If you are in doubt as to the purpose or necessity of a line, check first in LINT.
 
I don't have a printer, my systems don't even have a parallel port any more. So my custom kernel doesn't have anything relating to ppc(4),ppbus(4) or lpt(4).

ppc(4) and ppbus(4) are required for lpt(4). Just check the man pages of the device you want to remove (or add). It will tell you which other modules it depends on.

Code:
NAME
     lpt – generic printer device driver

SYNOPSIS
     device ppc
     device ppbus
     device lpt

Careful with removing devices (or options) from the kernel config. There's very little sanity checking done before the build, so you will only find out you forgot something (or removed something that's required) when the kernel build fails.

Also note that there's a MINIMAL kernel config. It's stripped of almost everything that's not strictly necessary.
 
Don't worry - I already managed to build & boot a kernel without keyboard & mouse support on my laptop
Been there. Not with the keyboard or mouse but with a device that was missing, system can't boot if it doesn't recognize a controller that has the boot disk attached to it :D

But yeah, just a tip, as kernel.old can get overwritten, make a copy of a known good kernel. So you have something to fall back on. A cp -r /boot/kernel /boot/kernel.good would be enough. I often just keep a copy of the GENERIC kernel as kernel.GENERIC, just as a safety precaution.
 
Back
Top