Find the answer to your Linux question:
Results 1 to 8 of 8
Hello, I'm trying to get my wireless card to work with my debian system. For this, I am trying to install NDISwrapper. However, I'm having some trouble getting NDISwrapper to ...
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    13

    Installing NDISwrapper



    Hello,

    I'm trying to get my wireless card to work with my debian system. For this, I am trying to install NDISwrapper. However, I'm having some trouble getting NDISwrapper to find the kernel source, which is necessary as the first step in the instructions:

    Official NDISwrapper installation instructions

    They say:

    ... Make sure that /lib/modules/VERSION/build is a link to the kernel source ...
    The kernel version that I'm running is called 2.6.8-3-386. Earlier today, I installed the kernel source code from kernel.org and unzipped it to /usr/src. The kernel source version that I downloaded simply reads "2.6.8" (I simply picked linux-2.6.8.tar.gz from this location: Index of /pub/linux/kernel/v2.6).

    Warning whistle #1: There was nothing to differentiate between the different architectures (i.e., 386, 686, and others). But then again, I suppose the kernel source is portable across all platforms. Perhaps it only matters when you are trying to installed a pre-compiled kernel. Can someone confirm?

    Warning whistle #2: I really don't know what the 3 represents in 2.6.8-3. So there may be a slight mismatch between the kernel version that I actually have running and the kernel version for which I downloaded the sources. But there simply was no "2.6.8-3" source code package. What does the 3 mean? Does it matter here?

    So from this point, I tried creating the symbolic link that the NDISwrapper installation instructions called for. I changed my working directory to /lib/modules/2.6.8-3-386 and issued this command:

    Code:
    sudo ln -s /usr/src/linux-2.6.8/ build
    This created a symbolic link to the top-level directory of the kernel source. This directory contains these files and subdirectories:

    • arch
    • COPYING
    • CREDITS
    • crypto
    • Documentation
    • drivers
    • fs
    • include
    • init
    • ipc
    • kernel
    • lib
    • MAINTAINERS
    • Makefile
    • mm
    • net
    • README
    • REPORTING-BUGS
    • scripts
    • security
    • sound
    • usr

    Warning whistle #3: Am I linking to the correct directory? Should I actually be linking to one of the subdirectories inside here?

    Next the instructions state:

    Go to the source-directory and run make distclean and make. As root, run make install. This should compile and install both the kernel module and the userspace utilities. If you don’t need USB support in ndiswrapper, with recent versions, you can compile with make DISABLE_USB=1 and install with make DISABLE_USB=1 install.

    NOTE: Source-directory is for the ndiswrapper directory that you just created. (NOT the /usr/src directory)
    So I switch over to the ndiswrapper directory, which I have over at "~/ndiswrapper/ndiswrapper-1.47/". But when I run make, I get the following:

    Code:
    make -C driver
    make[1]: Entering directory `/home/serg/ndiswrapper/ndiswrapper-1.47/driver'
    Can't find kernel build files in /lib/modules/2.6.8-3-386/build;
      give the path to kernel build directory with 
      KBUILD=<path> argument to make
    make[1]: Leaving directory `/home/serg/ndiswrapper/ndiswrapper-1.47/driver'
    I verified that my symbolic link is correct - it does point to the kernel source, and running "ls /lib/modules/2.6.8-3-386/build" shows the same files and subdirectories as above.

    Warning whistle #4: But the INSTALL file states that the symbolic link should at least have an 'include' directory and a '.config' file. I don't see a '.config' file in the kernel source directory. This is probably why the installation is failing.

    So the kernel source did not come with a file that is required? What do I do?

  2. #2
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    I don't know wish convention the debian developers use to nominate the kernel,but i was using Debian, it's kernel is patched against many patch,the best way it's to get the kernel patched from the Debian/mirrors.

    for the configuration file ,this file should be in /boot/config-(version) you can copy it to the kernel source code
    cp /boot/config-(version) /usr/src/linux/.config

    Hope this help.
    Linux is not only an operating system, it's a philosophy.
    Archost.

  3. #3
    Just Joined!
    Join Date
    Dec 2006
    Posts
    13
    Thanks for the help.

    After several lengthy head-banging sessions coupled with a myriad of google queries, I finally got it - apparently, I have to run xmenuconfig and select a bunch of options which specify exactly how the kernel should be built. This would generate the appropriate .config file.

    So I did this. And a lot more, too... for example, I had to upgrade my gcc compiler, as well as get a package called kernel-package which simplifies the kernel build process on debian systems. It's quite nice, actually, though I should probably like to learn how to do this manually as well.

    Anyways, here's an update on how things went. The errors that ndiswrapper gave me when I tried to compile it stemmed from the fact that I actually have to compile the kernel - just unzipping the kernel source package is not sufficient, even though the INSTALL file would had me believe otherwise.

    After I compiled the kernel, running ndiswrapper gave me some other errors. Unfortunately, I didn't write them down, but I remember that there were a lot of errors inside a function called wfastcall(). These apparently occurred because ndiswrapper requires gcc version 3.4, but I was compiling with 3.3. So I upgraded gcc, and changed the symbolic link /bin/usr/gcc to point to /bin/usr/gcc-3.4 instead of /bin/usr/gcc-3.3. I'm not sure if this is a good idea, but I did it because after installing gcc-3.4, running "gcc" from the command line still called gcc-3.3. (I discovered this by running the file command).

    But when I tried compiling with gcc-3.4, I got a bunch of other errors in the ntoskernel.c file. Something like structure has no member named `nice', or something like that. Google turns up very few results for this... . This problem went away when I reverted to an older version of ndiswrapper.

    Finally, I managed to get both the kernel and ndiswrapper compiled. But as it turns out, there's more to updating the kernel than merely compiling it. I needed to configure the bootloader to see my new kernel. I tried doing it according to the man pages, but I messed something up... at which point, I found kernel-package, which automated the kernel build process.

    So at this point, I am compiling the kernel for what happens to be the third time already. On my prehistoric laptop, that's a four-hour investment. I'll be back with the results.

  4. #4
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    Yes extracting the source code it's not enough the compilation of the kernel generate a lot of modules/headers for other software to include them.

    to configure the kernel from scratch it's not trivial, so i would suggest to copy the configuration file from another kernel to the new kernel source tree and run.

    make menuconfig (save an exit)
    make bzImage
    make modules
    make modules_install
    make headers_install .

    after copy the bzImage wish is in /usr/src/linux/arch/(your_arch)/boot to the /boot directory, configure the grub to see the new kernel by editing the menu.lst in /boot/grub .

    another easy option it's just to install the kernel source and the kernel devel package from the Debian DVD.

    Regards.
    Linux is not only an operating system, it's a philosophy.
    Archost.

  5. #5
    Linux Newbie
    Join Date
    Feb 2006
    Location
    Dover, DE
    Posts
    112
    If you are using a stock kernel from the debian repositories and a program needs the source code for that kernel, the header package for that kernel should be all you need.
    Code:
    sudo apt-get install linux-headers-2.6.x-x-xxx
    That will work in place of the kernel source.
    You shouldn't have to compile a new kernel just because the source for that kernel cannot be found.

  6. #6
    Linux Newbie
    Join Date
    Feb 2006
    Location
    Dover, DE
    Posts
    112
    As an afterthought I would also suggest installing the latest kernel available form the debian repositories.
    Code:
    apt-get install linux-image-2.6-xxx
    apt-get install linux-headers-2.6-xxx
    xxx = 486 or 686 for intel processors (you most likely want 686) or k7 for AMD processors.
    These packages will keep your kernels up to date.

  7. #7
    Linux User towy71's Avatar
    Join Date
    May 2006
    Location
    West Wales
    Posts
    322
    Code:
    apt-get install linux-headers-$(uname -r)
    makes sure that you install the correct header files by checking what kernel you are running

    Ain't Linux cute
    free/libre/open software for the people by the people
    Linux user #185360

  8. #8
    Just Joined!
    Join Date
    Jun 2006
    Posts
    8
    Quote Originally Posted by jonantice View Post
    If you are using a stock kernel from the debian repositories and a program needs the source code for that kernel, the header package for that kernel should be all you need.
    Code:
    sudo apt-get install linux-headers-2.6.x-x-xxx
    That will work in place of the kernel source.
    You shouldn't have to compile a new kernel just because the source for that kernel cannot be found.
    I was having the same issue as the author of this thread and the above corrected my issue with Debian 4.0 on my laptop. Thanks!

Posting Permissions

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