I have a script (found here on github) that custom compiles the 3.8 linux kernel (with Xenomai for real-time). The kernel compiles/installs/runs however when I try to install my graphics driver (fglrx for ATI RADEON 8490), I get the following error:

/lib/modules/ cannot be found on this system.

When I look into this directory (/lib/modules/ there is nothing there. I then ran an ls -l in /lib/modules/ and got the following output for the build directory:

build -> /home/yapatel/Dev/rtxi/scripts/linux-3.8.13

The directory that the build directory is pointing to was deleted as a part of the script for compiling/installing the custom kernel so this symbolic link is dead, which make sense as to why I am getting the error.

I am compiling the custom kernel using the following command:

fakeroot make-kpkg --initrd --append-to-version=-xenomai-$xenomai_version kernel-image kernel-headers modules

and then installing the compiled kernel using the following commands:

sudo dpkg -i linux-image-*.deb
sudo dpkg -i linux-headers*.deb
sudo update-initramfs -c -k $linux_version-xenomai-$xenomai_version
sudo update-grub

Now here is my question - I understood it as the above installation commands to take care of all the necessary pieces for installing a custom compiled kernel, however the deadlink to my build directory seems to suggest that I need to manually copy over the files from:




This seems like a manuall fix rather than the proper fix. Is there a command I am missing in the compile/install process of my custom kernel? I am assuming this means my kernel modules are not being installed?

All advice/help is appreciated!


You need to either edit the script so that it does not delete the build directory (proper fix) as you are calling it or copy the files to the system (manual fix).

Neither of these "fixes" has anything to do with the commands used to compile a kernel (make).

You can choose where and how to compile a kernel, usually use use a build directory in your home directory and build as a user, but there is not good reason you could not use a system directory and build as root. You can use any location you wish for building.


Try to run make modules -j $number_of_cpus and then make modules_install -j $number_of_cpus to rebuild and install all the modules. Check if this still gives you errors.

  • making and installing the modules does not fix the problem of missing headers. – Panther Mar 21 '14 at 18:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.