Driver support works the same way as with all of open source: someone decides to scratch their own itch.
Sometimes the driver is supplied by the company providing the hardware, just as on Windows. Intel does this for their network chips, 3ware does this for their RAID controllers, etc. These companies have decided that it is in their best interest to provide the driver: their "itch" is to sell product to Linux users, and that means ensuring that there is a driver.
In the best case, the company works hard to get their driver into the appropriate source base that ships with Linux distros. For most drivers, that means the Linux kernel. For graphics drivers, it means X.org. There's also CUPS for printer drivers, NUT for UPS drivers, SANE for scanner drivers, etc. The obvious benefit of doing this is that Linux distros made after the driver gets accepted will have support for the hardware out of the box. The biggest downside is that it's more work for the company to coordinate with the open source project to get their driver in, for the same basic reasons it's difficult for two separate groups to coordinate anything.
Then there are those companies that choose to offer their driver source code directly, only. You typically have to download the driver source code from their web site, build it on your system, and install it by hand. Such companies are usually smaller or specialty manufacturers without enough employees that they can spare the effort to coordinate with the appropriate open source project to get their driver into that project's source base.
A rare few companies provide binary-only drivers instead of source code. An example are the more advanced 3D drivers from companies like NVIDIA. Typically the reason for this is that the company doesn't want to give away information they feel proprietary about. Such drivers often don't work with as many Linux distros as with the previous cases, because the company providing the hardware doesn't bother to rebuild their driver to track API and ABI changes. It's possible for the end user or the Linux distro provider to tweak a driver provided as source code to track such changes, so in the previous two cases, the driver can usually be made to work with more systems than a binary driver will.
When the company doesn't provide Linux drivers, someone in the community simply decides to do it. There are some large classes of hardware where this is common, like with UPSes and printers. It takes a rare user who a) has the hardware; b) has the time; c) has the skill; and d) has the inclination to spend the time to develop the driver. For popular hardware, this usually isn't a problem because with millions of Linux users, these few people do exist. You get into trouble with uncommon hardware.
SOLVED!
Simple as that: /root/.bashrc
had this inside:
export GREP_OPTIONS='--color=always'
Changed it to:
export GREP_OPTIONS='--color=never'
...and restarted the root shell (of course; do not omit this step). Everything started working again. Both NVIDIA and VirtualBox kernel modules built from the first try. I am so happy! :-)
Then again though, I am slighly disappointed by the kernel build tools. They should know better and pass --color=never
everywhere they use grep
; or rather, store the old value of GREP_OPTIONS
, override it for the lifetime of the building process, then restore it.
I am hopeful that my epic one-week battle with this problem will prove valuable both to the community and the kernel build tools developers.
A very warm thanks to the people who were with me and tried to help.
(All credits go here: http://forums.gentoo.org/viewtopic-p-4156366.html#4156366)
Best Answer
If you have the
.config
file the kernel was built with, you can download the source and runmake menuconfig
, which will give you an idea of A) what hardware it is possible to configure a kernel for (but see NOTE), and B) what hardware your kernel is actually configured for.So to do this:
uname -r
..config
used for your kernel. If you got the source via your distro, it will hopefully be included; you may also be able to find it somewhere in /boot. Even better: often now distro kernels are built with the/proc/config.gz
feature. If it exists, copy that out, ungzip it, rename the file.config
and copy it into the top level of the kernel source tree.make menuconfig
from inside the top level of the source tree. You will need the ncurses development package installed (ncurses-dev
orncurses-devel
) and you need to be root.You can't do anything bad while using menuconfig beyond change the contents of the
.config
file, which won't matter (just don't confuse yourself with it later).NOTE: You can't actually see all the possible hardware configurations at the same time, since different options may appear in one place based on what has been selected some other place. Kernel configuration is a bit of a labyrinth. However, you will definitely see everything that is actually selected (
M
means it is a module,*
means it is built in).