# When kernel module builds (and installs) go (horribly) wrong

Built a new 2.6.22.1 kernel. Testing it for many things. Looks good overall, though it broke a few things when I first built it. Had to get the latest subsystem patches.
Ok. I decided to use this as “the” kernel for all we are working on. Dog-food it. Put it on my laptop as well.
(BTW: if anyone out there knows how to *force* a driver into windows, I am trying to load the AHCI driver into XP, so I can switch the system into a much faster disk mode … Dell likes loading it in ATA mode, and it is slower as a result … worse, XP refuses to load the driver when presented with it … I need to force this to happen … pointers welcome … might just have to reload XP, but I would prefer to avoid the pleasure of doing this ….)
On it goes. And the DVD which had been undetected (WTH!) was now seen.
But audio disappeared.

Grrrr….
Ok. Pull down the latest alsa patches. Enable everything. Rebuild.
Audio is back.
Ok, now add in the intel 4945 patch from the Intel wireless website . Use the mac80211-9.0.3 patch, run the patch kernel bit. Rebuild the .deb (this is ubuntu 7.04). Install, update the nvidia driver (the restricted drivers do not work with the newer nVidia cards). And up we come, with sound, and ostensibly, with the mac80211 subsystem set up for the kernel.
Ostensibly.
Quoting Inigo Montoya “That word. I don’t think it means what you think it means.”
Yeah.
Get into the iwlwifi-0.1.8 directory after pulling that down. Run make. First it complains about not using BASH as its shell. Ok. Annoying but ok. Then after that it tosses an error on build. Turns out it cannot find a header file:
 root@lightning:/home/landman/iwlwifi-0.1.8# make Makefile:22: Makefile:23: WARNING: $SHELL not set to bash. Makefile:24: If you experience build errors, try Makefile:25: 'make SHELL=/bin/bash'. Makefile:26: make -C /lib/modules/2.6.22.1-scalable/source O=/lib/modules/2.6.22.1-scalable/build M=/home/landman/iwlwifi-0.1.8/compatible/ modules make[1]: Entering directory /usr/src/linux-headers-2.6.22.1-scalable' CC [M] /home/landman/iwlwifi-0.1.8/compatible/iwl-3945-rs.o /home/landman/iwlwifi-0.1.8/compatible/iwl-3945-rs.c:43:44: error: ../net/mac80211/ieee80211_rate.h: No such file or directory  [bang …] Alrighty then … We seem to be missing ieee80211_rate.h. Lets look for it.  landman@lightning:~$ find | grep -i ieee80211_rate.h ./mac80211-9.0.3/origin/net/mac80211/ieee80211_rate.h ./mac80211-9.0.3/modified/net/mac80211/ieee80211_rate.h ./mac80211-9.0.3/compatible/net/mac80211/ieee80211_rate.h landman@lightning:~$ Ah hah! … er … what about the kernel source directory?  landman@lightning:~$ find /usr/src/linux-headers-2.6.22.1-scalable/ | grep -i ieee80211_rate.h landman@lightning:~$ Nada. Ok. That means all we have to do is install it from the mac80211 directory … (didn’t we do this already)? Following the readme, it says NOTE: As of mac80211-2.0.0 you must also enable CONFIG_CFG80211 and rebuild your main kernel image. This is because the latest mac80211 changes re-implement the kernel built-in from net/core/wireless.c as part of the net/wireless/ sources. % make all % make install  Cool. Here is the make all  landman@lightning:~$ cd mac80211-9.0.3 landman@lightning:~/mac80211-9.0.3$make all WARNING:$SHELL not set to bash. If you experience build errors, try 'make SHELL=/bin/bash'. landman@lightning:~/mac80211-9.0.3$make SHELL=/bin/bash all landman@lightning:~/mac80211-9.0.3$ 
Notice the BASH thing. Annoying. But it is built (I did it before).
Now lets follow the directions and do a ‘make install’ … shall we?
 landman@lightning:~/mac80211-9.0.3\$ sudo -s Password: root@lightning:~/mac80211-9.0.3# make SHELL=/bin/bash install make: *** No rule to make target install'. Stop. root@lightning:~/mac80211-9.0.3#
[splutter …]
No … install … target??? In the Makefile??????
 root@lightning:~/mac80211-9.0.3# grep -in install Makefile root@lightning:~/mac80211-9.0.3#
Yeah, thats right. You can build it. You just can’t install it.
Ugh.
FWIW: I followed the README directions to the letter. Will have to hack around this.
Update:: So I did this to make the build work …
 ln -s /home/landman/mac80211-9.0.3/compatible/net .
Ummm…. hack ? Ugh.