DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
OK, anyone/anything that can guide me out of this confused state would be greatly appreciated. Sorry this is so long...
I am a newb running deb sarge in the early stages of installing ndiswrapper for my wireless card (smc2802w (version 2, so no linux driver available)), and I'm seeing various things about kernel headers and symbolic links. I'm totally confused, partly b/c I don't understand the concept of kernel headers and I can't really find good info on them.
I'm looking at the debian-specific wiki for ndiswrapper and it says that to find out which kernel headers I need, I can type in
and it will print out the header files package (b/c this is required to compile ndiswrapper). But when I do, I get nothing (and I've also manually read through the "COLUMNS=200 dpkg -l" output and seen that there's nothing in there about headers). So, from this, it appears that I don't have any kernel headers installed and/or my kernel knows nothing of kernel headers. So, umm, I don't know what this means. I'm running a 2.4.30 kernel that I compiled myself and I certainly didn't do anything involving kernel headers with that. The wiki then says to apt-get the corresponding kernel-header package. In searching around, the 'newest' 2.4 kernel headers seem to involve 2.4.27. In the above-mentioned wiki, it says that I must have headers at least matching the kernel i'm running. So do I need to go back to 2.4.27?
2nd part: Now, in looking at the Debian Reference manual (Aoki, Feb 05), it says
"most "normal" programs don't need kernel headers and in fact may break if you use them directly; instead they should be compiled against the headers with which glibc was built, which are the versions in /usr/include/linux and /usr/include/asm"
I have not installed glibc. Does this have anything to do with why my kernel doesn't 'know about' headers? Or are these different 'headers' being referred to?
Well, I hope this isn't too garbled- Anywhere anyone can help or link me to some general info would be great.
If you compiled the kernel then you have the source file. Usually the make files for compiling programs from source can be edited to point to the kernel source. Check the readme. You can create the header files as well from the source - reference for this;
I think you've got me headed in the right direction. I'm semi-confident that once I get the header files made correctly, I can figure out the rest.
Making the header files seems pretty straightforward- it seems this has nothing to do with the .config file, correct? Ie, header files come from source so they'll work with any kernel image from that source? Would I need to do a 'make clean' or anything prior to making the header files? (just wondering b/c everytime I see someone mention making header files it's part of the kernel compiling process)
The header files should be there already if you compiled your own kernel. What I did to install ndiswrapper was to first compile a kernel, install the compiled kernel, then boot into the new kernel. Next, download ndiswrapper-1.1.tar.gz, unpack it and install it with "make" and "make install". It shouldn't complain about kernel headers as long as you are running the kernel that you compiled yourself. I did not have to add any simlinks to kernel header files nor did I have to install kernel headers.
The ndiswrapper installation will complain about kernel header files if you try to do it using a precompiled kernel from debian.org. In that case, you will have to install kernel headers and link them, but it is easier to just recompile your kernel and boot into the new kernel like I said above. Hopefully that makes sense.
OK, I'll give it a try, but I'm still a bit confused.
In my op, I mentioned that I can't find anything about header files on my computer, so I was under the impression that they're not present. When I compiled my kernel, I only did "make-kpkg kernel_image", so I don't think I made them that point. Is this what you did also? If so, I'll just give it a whirl.
Thanks so much for the quick reply- sorry if I'm not comprehending.
Originally posted by Embiggens When I compiled my kernel, I only did "make-kpkg kernel_image", so I don't think I made them that point.
if you didn't expressly tell it to make the headers then it would not. As I said above you can usually edit the make-file to point it at the kernel source which works as well, but you need to look at the readme and also have a look at the make-file.
Here is what I did, starting with the 2.6.8 kernel installed by Sarge:
Code:
apt-get -t unstable install kernel-source-2.6.11
cd /usr/src
tar -jfx kernel-source-2.6.11.tar.bz2
ln -s kernel-source-2.6.11 linux
cd linux
cp /boot/config-2.6.8-2-386 .config
make menuconfig
Note, at this point you should select "Code Maturity Level Options --> Select Only Drivers Expected to compile cleanly" or else the compile will fail. I also selected my processor type and changed a few other minor things. Save your configuration, then compile:
I didn't say anything about kernel headers. After it finishes, install the kernel:
Code:
cd /usr/src
dpkg -i kernel-image-2.6.11-debian_10.00.Custom_i386.deb
The installer will create an entry for it in /boot/grub/menu.lst. Reboot into the new kernel.
I then installed ndiswrapper after booting into the new kernel:
Code:
tar zxvf ndiswrapper1.1.tar.gz
cd ndiswrapper1.1
make distclean
make
make install
Complete the installation following: http://ndiswrapper.sourceforge.net/p...p/Installation As I said above, the ndiswrapper installation didn't work until I had compiled my kernel. You can try to set up kernel headers with a pre-compiled kernel, but it is probably easier to just recompile your kernel. Hopefully there are no typos above, but you can get the point I guess. I have done the above more than once and I know it works.
it's working! Thanks so much to both of you for your help. i basically just followed your steps, m_yates (did move to a 2.6 kernel first). I kind of feel like an idiot- there was nothing especially tricky here, I just got a bit scared by the headers talk. Anyway, I'm currently getting a vague idea of what headers files are, since I'm starting to toy with c. Thanks again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.