Kernel Blues

Discussion in 'HOWTO-Related Questions' started by todgerme, Nov 2, 2006.

  1. todgerme

    todgerme Member

    I hate trying to get Kernel modules working.

    Anyway I am trying to follow the NFS DRBD guide and I can't get past the following when I try to make the DRBD module:

    /usr/src/modules/drbd/drbd# make
    grep: /lib/modules/2.6.8-2-686-smp/build/Makefile: No such file or directory
    grep: /lib/modules/2.6.8-2-686-smp/build/Makefile: No such file or directory

    Calling toplevel makefile of kernel source tree, which I believe is in
    KDIR=/lib/modules/2.6.8-2-686-smp/build

    trying to make dep ...
    make[1]: Makefile: No such file or directory
    make[1]: *** No rule to make target `Makefile'. Stop.
    I'll ignore this error, but this can cause inconsistencies!
    test -f ../scripts/adjust_drbd_config_h.sh && \
    KDIR=/lib/modules/2.6.8-2-686-smp/build /bin/sh ../scripts/adjust_drbd_config_h.sh
    ls: /lib/modules/2.6.8-2-686-smp/build/include/asm/bitops.h: No such file or directory
    Sorry, automagic adjustment of drdb_config.h failed.
    For well known 2.6. kernels, no adjustment to the shipped drbd_config is necessary.
    You need to verify it yourself.
    make: [kbuild] Error 1 (ignored)
    make -C /lib/modules/2.6.8-2-686-smp/build SUBDIRS=/usr/src/modules/drbd/drbd modules
    make[1]: Entering directory `/usr/src/kernel-headers-2.6.8-2-686-smp'
    make[1]: Makefile: No such file or directory
    make[1]: *** No rule to make target `Makefile'. Stop.
    make[1]: Leaving directory `/usr/src/kernel-headers-2.6.8-2-686-smp'
    make: *** [kbuild] Error 2
    ==========


    Looking at /lib/modules/2.6.8-2-686-smp/build where it complains about Makefile not existing everything is symlinked up a directory and then downwards again but this directory doesn't exist so I am very confused!

    lrwxrwxrwx 1 root root 34 2006-11-02 15:27 Makefile -> ../kernel-headers-2.6.8-2/Makefile
    lrwxrwxrwx 1 root root 29 2006-11-02 15:27 lib -> ../kernel-headers-2.6.8-2/lib
    lrwxrwxrwx 1 root root 32 2006-11-02 15:27 kernel -> ../kernel-headers-2.6.8-2/kernel
    lrwxrwxrwx 1 root root 29 2006-11-02 15:27 ipc -> ../kernel-headers-2.6.8-2/ipc
    lrwxrwxrwx 1 root root 30 2006-11-02 15:27 init -> ../kernel-headers-2.6.8-2/init
    drwxr-xr-x 4 root root 4096 2006-11-02 15:27 include
    lrwxrwxrwx 1 root root 28 2006-11-02 15:27 fs -> ../kernel-headers-2.6.8-2/fs
    lrwxrwxrwx 1 root root 33 2006-11-02 15:27 drivers -> ../kernel-headers-2.6.8-2/drivers
    lrwxrwxrwx 1 root root 32 2006-11-02 15:27 crypto -> ../kernel-headers-2.6.8-2/crypto
    lrwxrwxrwx 1 root root 30 2006-11-02 15:27 arch -> ../kernel-headers-2.6.8-2/arch
    lrwxrwxrwx 1 root root 29 2006-11-02 15:27 usr -> ../kernel-headers-2.6.8-2/usr
    lrwxrwxrwx 1 root root 31 2006-11-02 15:27 sound -> ../kernel-headers-2.6.8-2/sound
    lrwxrwxrwx 1 root root 34 2006-11-02 15:27 security -> ../kernel-headers-2.6.8-2/security
    lrwxrwxrwx 1 root root 33 2006-11-02 15:27 scripts -> ../kernel-headers-2.6.8-2/scripts
    lrwxrwxrwx 1 root root 29 2006-11-02 15:27 net -> ../kernel-headers-2.6.8-2/net
    lrwxrwxrwx 1 root root 28 2006-11-02 15:27 mm -> ../kernel-headers-2.6.8-2/mm



    Anyone ideas? Debian Sarge.

    If no-one has ideas can someone post me a smp 686 enable kernel + headers with all the drdb stuff already enabled?
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Do you have the kernel-headers for kernel 2.6.8-2 installed?
     
  3. todgerme

    todgerme Member

    I did, but I have since given up on Debian and went for Ubuntu 6.06 server instead. It only compiles under gcc 4 under Ubuntu but it did compile. Haven't completely followed the guide so I could be back for more tech support shortly :)
     
  4. todgerme

    todgerme Member

    Back to Debian for another system, an Opteron system using an AMD64-K8 kernal, compiling the DRBD module I get the following error:


    Calling toplevel makefile of kernel source tree, which I believe is in
    KDIR=/lib/modules/2.6.8-12-amd64-k8-smp/build

    test -f ../scripts/adjust_drbd_config_h.sh && \
    KDIR=/lib/modules/2.6.8-12-amd64-k8-smp/build /bin/sh ../scripts/adjust_drbd_config_h.sh

    Using unmodified drbd_config.h

    make -C /lib/modules/2.6.8-12-amd64-k8-smp/build SUBDIRS=/usr/src/modules/drbd/drbd modules
    make[1]: Entering directory `/usr/src/kernel-headers-2.6.8-12-amd64-k8-smp'
    CC [M] /usr/src/modules/drbd/drbd/drbd_sizeof_sanity_check.o
    cc1: error: code model `kernel' not supported in the 32 bit mode
    make[2]: *** [/usr/src/modules/drbd/drbd/drbd_sizeof_sanity_check.o] Error 1
    make[1]: *** [_module_/usr/src/modules/drbd/drbd] Error 2
    make[1]: Leaving directory `/usr/src/kernel-headers-2.6.8-12-amd64-k8-smp'
    make: *** [kbuild] Error 2


    Can anyone offer any advice on how to get around this? The module compiles when using a 686-smp kernel, but the system tends to randomly lockup unless you use the proper K8 kernel so I really need to get this working!?
     
  5. falko

    falko Super Moderator ISPConfig Developer

    Are you trying to compile a 64bit kernel on a 32bit system?
     
  6. todgerme

    todgerme Member

    It is am AMD64 using a x86 Debian with an AMD-K8 kernel if that makes any sense. I guess most of the OS would be 32bit but didn't want to go for any of the unofficial AMD64 versions of Debian. I am going to try the AMD64 version of Ubuntu to see what happens.
     

Share This Page