I have symlinked /usr/src/linux to 2.6.8-gentoo-r3, but I am running 2.6.7-gentoo-r1. In this case, the following happens: * Patching Makefile to enable WPA * /usr/src/linux is a symbolic link * Determining the real directory of the Linux kernel source code * Building for Linux 2.6.8-gentoo-r3 found in /usr/src/linux >>> Source unpacked. make -C //usr/src/linux M=/var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54 MODVERDIR=/var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54 modules make[1]: Entering directory `/usr/src/linux-2.6.8-gentoo-r3' CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_module.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_tx.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_rx.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_wx.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ipw2100_main.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_wep.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_ccmp.o CC [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_tkip.o LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ipw2100.o LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211.o Building modules, stage 2. MODPOST CC /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211.mod.o CC /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt.mod.o CC /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_ccmp.mod.o CC /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_tkip.mod.o CC /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_wep.mod.o CC /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ipw2100.mod.o LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211.ko LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt.ko LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_ccmp.ko LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_tkip.ko LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ieee80211_crypt_wep.ko LD [M] /var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54/ipw2100.ko make[1]: Leaving directory `/usr/src/linux-2.6.8-gentoo-r3' >>> Test phase [not enabled]: net-wireless/ipw2100-0.54 >>> Install ipw2100-0.54 into /var/tmp/portage/ipw2100-0.54/image/ category net-wireless make -C /lib/modules/2.6.7-gentoo-r1/build M=/var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54 MODVERDIR=/var/tmp/portage/ipw2100-0.54/work/ipw2100-0.54 modules make: *** /lib/modules/2.6.7-gentoo-r1/build: No such file or directory. Stop. make: *** [modules] Error 2 --- I have no idea where it picks up the 2.6.7-gentoo-r1.
In src_compile() of ipw2100-0.54.ebuild emake KMISC=${D}/lib/modules/${KV}/net install || die is used. I think somehow ${KV} must have been set to 2.6.7-gentoo-r1 (i.e. the running kernel) instead of 2.6.8-gentoo-r3 (i.e. the new kernel you want to compile the module for). I don't know, where ${KV} is set, although the eclass kernel-mod is inherited, but strange enough it's not set there.
Actually, ${KV} is correct at that point, but KMISC seems to not be picked up properly by the Makefile. Adding KVER=${KV} as an additional param to emake works around the problem. However, it will still ignore KMISC, so it's not a good solution.
I've fixed this in net-wireless/ipw2100-0.55-r2 Reporter, please confirm.
Closing as FIXED.