Error: Unable to find kernel source code directory

General support questions
Post Reply
Posts: 1
Joined: 2018/07/16 11:49:00

Error: Unable to find kernel source code directory

Post by umma » 2018/07/16 11:55:40

i'm trying to install ATTO H380 SAS HBA Drivers in CentOS7. but i'm getting Error: Unable to find kernel source code directory. i can not found the exact problem and i not able to resolve this problem.
following is the error message when in run ./ :-
""[root@server lnx_drv_esashba_131]# ./install

ATTO Technology, Inc.
Linux Driver Install Script v2.1

Error: Unable to find kernel source code directory

Kernel source code was expected in /lib/modules/4.17.6-1.el7.elrepo.x86_64/build

If the kernel source code is installed in a different
location, build the driver manually from the src/
directory specifying the correct kernel source directory
on the make command line with the KDIR variable, eg:

# make install KDIR=/usr/src/kernel

Press any key to finish... ""

request you to help in this issue. i'm facing this problem since last 3days. but no one help me in this...

Umma Reddy

User avatar
Forum Moderator
Posts: 24612
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error: Unable to find kernel source code directory

Post by TrevorH » 2018/07/16 12:27:32

You will need the matching kernel-ml-headers/devel package installed. The version number will need to match your running kernel so you might need to reboot into any new kernel that's installed as well.

Do be aware that any kernel module that you build using this method will be specific to that particular kernel version so if you update the kernel, you will need to rebuild the module again (and rebuild the initramfs file for that kernel version to pick up the newly built module).

You might want to investigate using a kmod package such as the ones that ELRepo distribute. If you raise an RFE on their bugtracker, they might even build and maintain the kmod as part of ELRepo (making no promises) though that would mean you'd need to use the distro kernel not the ELRepo kernel-ml one.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply