'Error during Intel Ethernet e1000e driver compilation in Debian Sid

Due to a motherboard change I need to compile the e1000e Intel driver for the integrated ethernet (a 82579LM chip) because the Debian kernel apparently comes with an outdated e1000e version (modinfo says that the driver version is 2.3.2-k, but I've downloaded the 3.1.0.2 from Intel: https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=15817&lang=eng&ProdId=3299)

But when I try to compile the driver I obtain the error:

Makefile:108: *** Linux kernel source not configured - missing autoconf.h.

I've installed the Debian packages linux-headers*, and the autoconf.h file is located in

/usr/src/linux-headers-$(BUILD_KERNEL)-amd64/include/generated/

where $(BUILD_KERNEL) is the output of uname -r.

I suspect some search paths in the driver Makefile are wrong. There is a variable called KSP with the search paths:

# Kernel Search Path
# All the places we look for kernel source
KSP :=  /lib/modules/$(BUILD_KERNEL)/build \
        /lib/modules/$(BUILD_KERNEL)/source \
        /lib/modules/$(BUILD_KERNEL)-default/build \
        /usr/src/linux-$(BUILD_KERNEL) \
        /usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//') \
        /usr/src/kernel-headers-$(BUILD_KERNEL) \
        /usr/src/kernel-source-$(BUILD_KERNEL) \
        /usr/src/linux-$($(BUILD_KERNEL) | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
        /usr/src/linux

This directories do not exist in my installation:

/lib/modules/$(BUILD_KERNEL)-default/build
/usr/src/linux-$(BUILD_KERNEL) \
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//') \
/usr/src/kernel-headers-$(BUILD_KERNEL) \
/usr/src/kernel-source-$(BUILD_KERNEL)

Instead, I have in my /usr/src:

/usr/src/linux-headers-$(BUILD_KERNEL)-amd64
/usr/src/linux-headers-$(BUILD_KERNEL)-common
/usr/src/linux-kbuild-3.16

I've tried to change the KSP according to my paths but the compilation always gives the same error

Makefile:108: *** Linux kernel source not configured - missing autoconf.h

I'm sure this is a bad path definitions, but I don't know how to fix it

Has anyone compiled an Intel driver in Debian Sid?



Solution 1:[1]

Generally the approach to compile an Intel driver on Debian is:

wget https://downloadmirror.intel.com/xxxx/eng/xxxxxx.tar.gz
cd e1000e-1.0.5/src
export BUILD_KERNEL=$(uname -r)
apt install linux-headers-$BUILD_KERNEL
make

if everything goes well continue with

make install

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tombart