Find the answer to your Linux question:
Results 1 to 6 of 6
hello am using fedora 12 . i have installed kernel-devel package but still the kernel headers are not available at /lib/moudles/2.6.31.***/build: my driver gives compilation error /lib/moudles/2.6.31.***/build: no directory or ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    10

    kernel headers


    hello
    am using fedora 12 . i have installed kernel-devel package but still the kernel headers are not available at /lib/moudles/2.6.31.***/build:

    my driver gives compilation error
    /lib/moudles/2.6.31.***/build: no directory or file
    make error

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    Code:
    rpm -q kernel-devel
    Code:
    rpm -q kernel
    Code:
    rpm -q kernel-headers
    there is a separate package called kernel-headers. Make sure you are installing the ones that are for the kernel you are going to be loading.
    linux user # 503963

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    10
    [root@localhost modules]# rpm -q kernel-devel
    kernel-devel-2.6.31.12-174.2.3.fc12.x86_64

    [root@localhost modules]# rpm -q kernel
    kernel-2.6.31.5-127.fc12.x86_64

    [root@localhost modules]# rpm -q kernel-headers
    kernel-headers-2.6.31.12-174.2.3.fc12.x86_64

    my Makefile is

    obj-m :=vram.o
    obj-m +=vramm.o
    KDIR= /lib/modules/$(shell uname -r)/build
    all:
    $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
    clean:
    rm -rf *.o *.ko *.mod.* .c* .t*

    i worked the same code in debian it works fine after kernel headers installation but facing problem here

    /lib/modules/2.6.31.5-127.fc12.x86_64/build: No such file or directory. Stop.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Quote Originally Posted by rakeshkumar View Post
    [root@localhost modules]# rpm -q kernel-devel
    kernel-devel-2.6.31.12-174.2.3.fc12.x86_64

    [root@localhost modules]# rpm -q kernel
    kernel-2.6.31.5-127.fc12.x86_64

    [root@localhost modules]# rpm -q kernel-headers
    kernel-headers-2.6.31.12-174.2.3.fc12.x86_64

    my Makefile is

    obj-m :=vram.o
    obj-m +=vramm.o
    KDIR= /lib/modules/$(shell uname -r)/build
    all:
    $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
    clean:
    rm -rf *.o *.ko *.mod.* .c* .t*

    i worked the same code in debian it works fine after kernel headers installation but facing problem here

    /lib/modules/2.6.31.5-127.fc12.x86_64/build: No such file or directory. Stop.
    Try executing uname -r in the terminal...What did you get? I'm betting it was "2.6.31.5-127.fc12.x86_64"...You may have to write your kernel devel version in by hand.

    instead of this:
    Code:
    KDIR= /lib/modules/$(shell uname -r)/build
    replace $(shell uname -r) with your devel version

    If your unsure check the in folder /lib/modules/...What does it contain?
    Last edited by gerard4143; 02-10-2010 at 04:29 PM.
    Make mine Arch Linux

  6. #5
    Just Joined!
    Join Date
    Jul 2009
    Posts
    49

    another thing...

    I've seen where there is no build directory but it is really just a link to the "kernel" directory. Have a look and either put in the symbolic link or modify your makefile by changing the reference to "build" to "kernel".

    Cheers!!

  7. #6
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Your kernel and kernel-headers have a slight difference...
    Might I suggest: yum install <each of these>:
    Code:
    yum update
    kernel-devel
    kernel-headers
    gcc
    make
    After that, you should be able to proceed with your task.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •