4

I would appreciate, if anybody can help me.

1) I am trying to build kernel module for Ubuntu sever using dkms. Detailed manual is here.

2) When It is building module using this syntax:

sudo dkms build -m ixgbevf -v 2.15.3

it says, that some kernel headers are missing:

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....(bad exit status: 2)
cd src/; make BUILD_KERNEL=....(bad exit status: 2)
ERROR (dkms apport): binary package for ixgbevf: 2.15.3 not found
Error! Bad return status for module build on kernel: 3.13.0-36-generic (x86_64)
Consult /var/lib/dkms/ixgbevf/2.15.3/build/make.log for more information.

3) Log file: /var/lib/dkms/ixgbevf/2.15.3/build/make.log:

DKMS make.log for ixgbevf-2.15.3 for kernel 3.13.0-36-generic (x86_64)
Tue Dec 23 09:27:47 UTC 2014
Makefile:64: *** Kernel header files not in any of the expected locations.
Makefile:65: *** Install the appropriate kernel development package, e.g.
Makefile:66: *** kernel-devel, for building kernel modules and try again.  Stop.

4) I have headers here:

/usr/src/linux-headers-3.13.0-36
/usr/src/linux-headers-3.13.0-36-generic
/usr/include

And cpp -v shows:

#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/4.8/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include

If you need more information, I will provide you immediately. Thanks.

--- Added info ---

1) dpkg -l | grep linux-headers shows:

ii  linux-headers-3.13.0-36          3.13.0-36.63                         all          Header files related to Linux kernel version 3.13.0
ii  linux-headers-3.13.0-36-generic  3.13.0-36.63                         amd64        Linux kernel headers for version 3.13.0 on 64 bit x86 SMP
ii  linux-headers-generic            3.13.0.36.43                         amd64        Generic Linux kernel headers
ii  linux-headers-virtual            3.13.0.36.43                         amd64        Transitional package.

2) Output info of dpkg -l | grep linux-image

ii  linux-image-3.13.0-36-generic    3.13.0-36.63                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-virtual              3.13.0.36.43                         amd64        This package will always depend on the latest minimal generic kernel image.

3) Output of uname -a

Linux ip-10-0-3-11 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

4) The link to sources of ixgbevf module is here.

antonbormotov
  • 171
  • 1
  • 8
  • Please give the output of `dpkg -l | grep linux-header` and `dpkg -l | grep linux-image`. In the question, not in a comment. Also, `module-assistant` (`m-a`) is an alternative you could try. It has an interactive curses interface. – Faheem Mitha Dec 24 '14 at 08:01
  • Done, Please, take a look. – antonbormotov Dec 24 '14 at 08:32
  • Also add the output of `uname -a`. Are you running a stock kernel (i.e. one built and shipped by your distribution). I'd suggest giving m-a a try as well. – Faheem Mitha Dec 24 '14 at 08:46
  • Do you mean to try m-a instead of dkms? I guess, it is stock kernel, Ubuntu 14.04, from Amazon Marketplace. I added uname, version is 3.13.0-36 – antonbormotov Dec 24 '14 at 09:21
  • Yes, `m-a`. I don't see anything obviously wrong with what you are doing, but I always use `m-a`, which is a bit more manual. Give it a try and post the results in your question if it fails too. To start with just type m-a and use the interactive menu. – Faheem Mitha Dec 24 '14 at 09:56
  • I tried just now, but i need to add this module from sources (http://sourceforge.net/projects/e1000/files/ixgbevf%20stable/). With Dkms I use `dkms add`, but how do I add it in `m-a`? – antonbormotov Dec 24 '14 at 10:02
  • The m-a menu has an item for that, namely select. Does the module you mention appear there? It doesn't appear in mine (Debian wheezy) but that doesn't mean it won't appear in yours. – Faheem Mitha Dec 24 '14 at 10:09
  • No, It does not appear in mine as well. Can we add module from sources there manually? – antonbormotov Dec 29 '14 at 02:14
  • Do you have sources for the module you are trying to build? If so, please provide the link for those sources in the question. – Faheem Mitha Dec 29 '14 at 07:45
  • Faheem, I added link to sources, on sourceforge. I use version 2.15.3. – antonbormotov Dec 29 '14 at 08:13
  • If the sources are not available from Debian, m-a won't work with them, as far as I know. here is a link that might be useful - http://www.xkyle.com/building-linux-packages-for-kernel-drivers/ – Faheem Mitha Dec 29 '14 at 08:51
  • If I get time, I'll try building it myself. – Faheem Mitha Dec 29 '14 at 08:59
  • Faheem, Thanks a lot, I will wait. I forgot to tell you, probably, you need to patch version 2.15.3 as well (file /usr/src/ixgbevf-2.15.3/src/kcompat.h). You can find it here https://gist.github.com/mchv/e66a2a4117143aa3b92e#file-ixgbevf-2-15-3-ubuntu-14-04-lts-patch and patch it. – antonbormotov Dec 29 '14 at 10:18
  • Hey, I'm not promising anything. Can you try the xkyle link and see if it works for you? – Faheem Mitha Dec 29 '14 at 10:43
  • @Faheem, what I did: took dkms configuration file from xkyle link, instead amazon's docs example (changed name and version of driver) and dkms built it successfully. Final dkms.conf file looks for me as: `MAKE="make -C src/ KERNELDIR=/lib/modules/${kernelver}/build" CLEAN="make -C src/ clean" BUILT_MODULE_NAME=ixgbevf BUILT_MODULE_LOCATION=src/ DEST_MODULE_LOCATION="/updates" PACKAGE_NAME=ixgbevf-dkms PACKAGE_VERSION=2.15.3 REMAKE_INITRD=no` – antonbormotov Dec 30 '14 at 06:05
  • I will install it and test a bit later, and post the result here.Thanks a lot for this link. – antonbormotov Dec 30 '14 at 06:20
  • Ok, glad it worked for you. If possible, please post an answer including all the details. You should also include the link you used, but links can break, so don't depend on it to provide any information. That is, your answer should be self-contained. After you have posted it, you can accept it. This may help other people later. – Faheem Mitha Dec 30 '14 at 07:51
  • It worked for server in the office, but not for amazon instance. I will come back to this issue after 15th of January and post answer. Probably, it is better to try build it manually with make. – antonbormotov Dec 30 '14 at 10:06

2 Answers2

3

So, Finally, I have managed to install driver ixgbevf v. 2.15.3 for kernel version 3.13.0-43.

But, there are some important points:

  1. First of all, I tried to use make to build it manually and got the same result:

    Makefile:64: *** Kernel header files not in any of the expected locations.
    Makefile:65: *** Install the appropriate kernel development package, e.g.
    Makefile:66: *** kernel-devel, for building kernel modules and try again.  Stop.
    
  2. Secondly, I ran apt-get upgrade and apt-get dist-upgrade to update kernel from 3.13.0-36 to 3.13.0-43, and reboot machine after, to update kernel. Details are here. It installed kernel headers for 3.13.0-43 as well.

  3. Thirdly, I had to change dkms.conf configuration file, like here:

    MAKE="make -C src/ KERNELDIR=/lib/modules/${kernelver}/build"
    CLEAN="make -C src/ clean"
    BUILT_MODULE_NAME=ixgbevf
    BUILT_MODULE_LOCATION=src/
    DEST_MODULE_LOCATION="/updates"
    PACKAGE_NAME=ixgbevf-dkms
    PACKAGE_VERSION=2.15.3
    REMAKE_INITRD=no
    

After that, It was able to build driver. If you have the same problem and need help, feel free to contact me. @Faheem Mitha, Thanks a lot for your helping.

fra-san
  • 9,931
  • 2
  • 21
  • 42
antonbormotov
  • 171
  • 1
  • 8
3

There is a patch released for Ubuntu14.04 https://gist.github.com/cdgraff/1c31727901e5c76d5ea8

I can confirm it's working:

root@ip-172-31-119-53:~# modinfo ixgbevf
filename:       /lib/modules/3.13.0-45-generic/updates/dkms/ixgbevf.ko
version:        2.16.1
license:        GPL
description:    Intel(R) 10 Gigabit Virtual Function Network Driver
author:         Intel Corporation, <[email protected]>
srcversion:     3F8AACF779F38FD444B1CD3
alias:          pci:v00008086d00001515sv*sd*bc*sc*i*
alias:          pci:v00008086d000010EDsv*sd*bc*sc*i*
depends:        
vermagic:       3.13.0-45-generic SMP mod_unload modversions 
parm:           InterruptThrottleRate:Maximum interrupts per second, per    vector, (956-488281, 0=off, 1=dynamic), default 1 (array of int)
IgorC
  • 31
  • 2