How to Compile kernel headers

Discussion in 'Kernel Questions' started by ikkem, Feb 8, 2007.

  1. ikkem

    ikkem Member

    Hi I had a question
    I wanted to ask how to build kernel_headers for the 2.6.19.3 kernel on debian sarge in order to build the dazuko module
    The how to by Falko worked nicely for compiling the kernel source 2.6.19.3 from kernel.org ....thanks for the how to
    http://www.howtoforge.com/kernel_compilation_debian
     
  2. falko

    falko Super Moderator ISPConfig Developer

    If you compiled a kernel from the sources, the kernel headers are already installed. :)
     
  3. ikkem

    ikkem Member

    hi....:)
    thanks for reacting I get a kernel headers not found error when building the dazuko module maybe I am missing something....
    thanks in advance
     
    Last edited: Feb 8, 2007
  4. falko

    falko Super Moderator ISPConfig Developer

    Did you boot into your new kernel, or are you still using your old one? You can find out by running
    Code:
    uname -r
     
  5. ikkem

    ikkem Member

    I boot into my new kernel but for some reason the headers can't be found....
    Code:
    uname -r  
    2.6.19.3-386
    
    I am trying to build the dazuko module to run with antivir

    Code:
    dpkg -i dazuko-source_2.3.2-1_all.deb
    m-a a-i dazuko
    
    module-assistant, error message
    thanks in advance
     
    Last edited: Feb 9, 2007
  6. falko

    falko Super Moderator ISPConfig Developer

    If I think about it - it's possible that the kernel headers aren't installed because in the Debian kernel howto we create a kernel .deb package which doesn't contain the headers.

    You can try to combine the Debian kernel howto with this one: http://www.howtoforge.com/kernel_compilation_ubuntu_p2

    Run
    Code:
    fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
    instead of
    Code:
    fakeroot make deb-pkg
    This should create a kernel headers deb package.

    If that doesn't work, you can still compile a kernel the traditional way, without creating a deb package, as shown here: http://www.howtoforge.com/kernel_compilation_fedora_p2
    That way the headers will be installed for sure.
     
  7. ikkem

    ikkem Member

    thanks for reacting I will try the traditional way hopefully that will be sufficient I could not install the kernel_image with the ubuntu way and the kernel headers were not installed in full because the kernel module builder could not find the kernel headers even after I installed the kernel header package
    I will try the traditional way hopefully it will help....
    ikkem....
     
    Last edited: Feb 10, 2007
  8. ikkem

    ikkem Member

    I followed the how to

    Code:
    make all
    make modules_install
    make headers_install
    make install
    I checked in /boot the ramdisk was not build which made reboot into the new kernel fail (I guess)

    I will continue tomorrow.....
     
  9. ikkem

    ikkem Member

    I made the ramdisk
    Code:
    mkinitrd.yaird -o /boot/initrd.img-2.6.19.3-raysun1 2.6.19.3-raysun1
    updated grub
    Code:
    update-grub
    but I still get a error message of kernel headers not found maybe I missed something....

    thanks in advance
     
  10. falko

    falko Super Moderator ISPConfig Developer

    What's the exact error message, and what kernel version did you try to compile?
     
  11. ikkem

    ikkem Member

    The error message I get is

    I am new to Linux so please tell me if I have to be more specific....

    Thanks in advance....
     
    Last edited: Feb 14, 2007
  12. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    ls -la /lib/modules/2.6.19.3-raysun1
    and
    Code:
    ls -la /boot
    ?
     
  13. ikkem

    ikkem Member

    The output of those commands is

    thanks in advance....
     
  14. falko

    falko Super Moderator ISPConfig Developer

    But there's an initrd.img-2.6.19.3-raysun1 in the /boot directory, so you don't need to create another ramdisk.
     
  15. ikkem

    ikkem Member

    I made a ram disk after that I booted into the new kernel but I still get a error message when I try to compile dazuko....

     
    Last edited: Feb 16, 2007
  16. ikkem

    ikkem Member

    At first the ramdisk was not created with:
    Code:
    make all
    make modules_install
    make headers_install
    make install
    I made the ramdisk with
    Code:
    mkinitrd.yaird -o /boot/initrd.img-2.6.19.3-raysun1 2.6.19.3-raysun1
    updated grub
    Code:
    update-grub
     
  17. ikkem

    ikkem Member

    I succeeded in installing dazuko I compiled it from source(followed the instructions for SuSE 9.1)

    $ mkdir dazuko
    $ cd dazuko
    $ wget http://www.dazuko.de/files/dazuko-2.3.2.tar.gz
    $ tar xzvf dazuko-2.3.2.tar.gz
    $ cd dazuko-2.3.2
    $ ./configure --enable-syscalls --mapfile=/boot/System.map-2.6.19.3-raysun1
    $ su
    # make
    # cp dazuko.ko /lib/modules/2.6.19.3-raysun1/kernel/security
    #depmod -a
    #gedit /etc/modprobe.d/dazuko

    Copy and paste the following code into the blank document and save it.

    install dazuko modprobe -r capability;\
    modprobe -i dazuko; \
    modprobe -i capability

    #gedit /etc/modules file. Add "dazuko" to the end of the list. Save and exit the file.

    modify the boot parameters to disable NSA SELinux support

    #gedit /boot/grub/menu.lst and add "selinux=0" to the end of the line:
    kernel /boot/vmlinuz-2.6.19.3-raysun1 root=/dev/hda1 ro selinux=0

    reboot

    sources
    http://www.dazuko.de/tgen.shtml
    http://klamav.sourceforge.net/klamav...Eft_.286.10.29
     

Share This Page