LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   ndiswrapper and Kernel build files.. (https://www.linuxquestions.org/questions/linux-kernel-70/ndiswrapper-and-kernel-build-files-485687/)

viciousxp 09-21-2006 12:13 PM

ndiswrapper and Kernel build files..
 
Hi,
im new to linux.. i need to get started using it.. but before i could do so i need to have the internet set up.. which is where ndiswrapper kicks in ..

i tryed installing it but it gives me the error that the kernel build file could not be found.. and indeed when i check in /lib/modules/2.6.15-1.2054_FC5/ there was only a files called build and it was a broken link to /usr/src/ something or other..

I tried installing some kernel devel thing which was suggested to another use with a similar problem, it installed succesfully, but still no luck with ndiswrapper..can anyone tell me what i could do to avoid this problem, thanks !

Hangdog42 09-23-2006 07:08 AM

Welcome to LQ!

Ndiswrapper requires that the kernel source code be installed, and from what you've suggested, that hasn't happened. A lot of distros don't install the source code by default because it does take a reasonable amount of disk space. However, they must distribute it so check through your Fedora disks for the RPM containing the source for your kernel and install it as you would any other RPM. That should allow ndiswrapper to compile.

Now that said, many of the stock Fedora kernels are rather ndiswrapper unfriendly. You will likely run into a warning about a 4K stack. You can try to run ndiswrapper with a 4K kernel stack, but many Windows drivers require more than that to run, and system lockups are a frequent symptom of this problem. If that happens to you, do some searching here for links to Fedora kernels with larger stacks (although I think the NTFS kernels have a larger stack). You will need to install the source code for any new kernels as well for ndiswrapper to compile.

apocoloco 09-24-2006 12:13 AM

That was a good reply, I had the same question and I appreciate it. However, I am still a little confused. (Newbie here. A *very* peristent one, from how long I've worked at this w/no positive result) (months)

I'm running Fedora Core 5, 2.6.15-1.2054. I have the problem where my Marvell integrated ethernet doesn't work (the computer is a Shuttle). I only have ONE PCI slot...but I have finally caved and used my only slot to put in a wireless card. I would have preferred using my USB wireless device, , but, first things first - since I KNOW this wireless card is compatible once I get ndiswrapper working.

I tried installed FC5 from CD, but *over and over again* something went wrong. It is ALWAYS something (ARGH). Anyway, I tried the installation from DVD instead of CD, and that worked - finally. The only problem is, I cannot find my kernel anywhere.

Because I have no internet connection at all on that computer, I don't think yum can help me!

You pointed out that,
Quote:

However, they must distribute it so check through your Fedora disks for the RPM containing the source for your kernel and install it as you would any other RPM.
Could you explain how I could do this for my DVD? And what is the syntax to install?

Thanks very much!!

Hangdog42 09-24-2006 07:49 AM

OK, you're going to have to do a little digging on that DVD. I'm not a Fedora user, so I'm not sure where they would put the source code RPM. However, you are looking for something along the lines of kernel-version.src.rpm. If it isn't on your DVD, then it should be available at the Fedora web site. Make sure that the version number matches your kernel EXACTLY.

As for installing, the usual rpm -i kernel-version.src.rpm should do the trick. It usually installs the source code in /usr/src.

apocoloco 09-24-2006 12:47 PM

Thanks. I did a search and found two files that seemed to match the bill: kernel-2.6.15-1.2054_FC5.i686.rpm, and kernel-devel-2.6.15-1.2054_FC5.i586.rpm.

Rpm -i didn't appear to do much for the kernel-.rpm, but when I did the same for kernel-devel-.rpm, it did indeed create a directory "kernels" in my /usr/src. Under "kernels", 2.6.15-1.2054_FC5-i586.

Now once in 2.6.blah, I typed make xconfig. Aha! Finally the screen I've been looking for. I went right down to "Kernel hacking" and turned off 4k_stacks. Saved, and quit.

Now, back in the terminal, I typed "make all modules_install install". I get:

Code:

CHK    includelinux/version.h
.
.
.
scripts/genksysms/lex.c:546:5: warning: "YY_STACK_USED" is not defined.
( a few more lex.c warnings follow)
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sunversion.o
HOSTCC scripts/mod/modpost

make[1]: *** No rule to make target 'init/main.o', needed by 'init/built-in.o'. Stop.
make: *** [init] Error 2.

Stuck again! (Linux: fighting me every step of the way.)

(Also, I went to Fedora's website, but the only downloads I saw were the same CDs and DVD that I downloaded already.) :(

Hangdog42 09-24-2006 05:38 PM

Quote:

Now once in 2.6.blah, I typed make xconfig.
At the risk of appearing rude, you're barking up the wrong tree here. If the goal is to install ndiswrapper, you don't need to compile a kernel, you just need the source code and .config file available from the existing kernel.

To install ndiswrapper, all you should need to do is run make and make install (the last one has to be as root) and if the kernel source is found, it will go. Then you can install the Windows drivers and with a bit of luck, be good to be wireless.

Oh, and if it matters in the future, if you do compile your own kernel, the sequence is:

make xconfig (or oldconfig or menuconfig)
make
make install
make modules_install

If you want to do it on one command, it would be make && make install && make modules_install.

spot221 09-24-2006 05:56 PM

Another possible solution is to download the rpms.

kmod-ndiswrapper
ndiswrapper

you can get it from here
http://rpm.livna.org/fedora/5/i386/

be sure to match your kernel to ndiswrapper
use:
uname -r to find out what kernel you are running

use (as root)
#rpm -ivh filename - to install

use (as a user)
$ndiswraper -i filename to install the .inf file from windoz

then use the internet

fedora has a great number of commonly used programs already pre-compiled. Just thought that may make your life a lttle easier.

apocoloco 09-24-2006 08:48 PM

Quote:

Originally Posted by Hangdog42
At the risk of appearing rude, you're barking up the wrong tree here. If the goal is to install ndiswrapper, you don't need to compile a kernel, you just need the source code and .config file available from the existing kernel.

To install ndiswrapper, all you should need to do is run make and make install (the last one has to be as root) and if the kernel source is found, it will go. Then you can install the Windows drivers and with a bit of luck, be good to be wireless.

Oh, and if it matters in the future, if you do compile your own kernel, the sequence is:

make xconfig (or oldconfig or menuconfig)
make
make install
make modules_install

If you want to do it on one command, it would be make && make install && make modules_install.

No offense taken. However, from past experience I know that ndiswrapper will complain and my computer will indeed crash over and over again if I do not turn off CONFIG_4KSTACKS. After having rpm -i the kernel-devel code from the DVD, I am able to get to xconfig where I can turn off this option. However, then make says:
Code:

make[1]: *** No rule to make target 'init/main.', needed by 'init/built-in.o'.
Next, make install says:
Code:

sh /usr/src/kernels/2.6.15-1.2054_FC5-i586/arch/i386/boot/install.sh 2.6.16-1.2054_FC5 arch/i386/boot/bzImage System.map "/boot"
sh: /usr/src/kernels/2.6.15-1.2054_FC5-i586/arch/i386/boot/install.sh: No such file or directory.
make[1]: *** [install] Error 127.

Next, make modules_install says
Code:

if [ -r System.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -F System.map 2.6.15-1.2054_FC5; fi
What the heck??

All I want to do is turn OFF config_4kstacks, and then install ndiswrapper.

In my mind, this shouldn't have been a problem - I would go into xconfig, set things how I want, then make, make install, then make modules_install like you said.

My gameplan seems simple and sound to me: compile a kernel with all the settings the same as I have now save ONE change, then install ndiswrapper. I'm still lost as to how to implement said plan :( I don't even know why make isn't working (make has NEVER worked for me, so I'm not even sure what to expect!)

viciousxp 09-25-2006 01:29 AM

kernel 2.6.15-1.2054 was a pain in the ass for me for ndiswrapper ...

upgrade kernel to 2.6.17-1.2187 install kernel-devel for that version of the kernel..

then go back to ndiswrapper..
make uninstall..
make
make install

your gonna need to access lsusb.. so you need to install usbutils .. look for it online on another system..

then
ndiswrapper -i (inf files)

ndiswrapper -l to check driver installed hardware detected

ect ect .. once you get to this step .. its easy..

just get rid of 15-1.2054 ..

EDIT: took me 7 days to get all of this done..
it was a pain.. and forget about YUM until all this shit is done.. unless you have a pci ethernet or wireless card.. then use yum to install all of this.. hope to god dependencies dont screw you.. cause damn linus they did me really hard !

Hangdog42 09-25-2006 11:08 AM

You might want to consider a pre-compiled kernel that doesn't have 4K stacks. I've seen people use kernels from linuxant and from the NTFS project. Apparently both have the 4K kernel stacks turned off.

At least that way you could separate the ndiswrapper problem from the kernel compile problems.

apocoloco 09-25-2006 12:07 PM

Well, I sort of want to be able compile a kernel. Also, the last time I went to linuxant, it said I would have to pay or something. No thanx!

But mostly, I just think this shouldn't be a big deal. My guess is the kernel-devel files that they included on the DVD aren't very complete?

Hangdog42 09-25-2006 12:58 PM

Quote:

Originally Posted by apocoloco
Well, I sort of want to be able compile a kernel. Also, the last time I went to linuxant, it said I would have to pay or something. No thanx!

But mostly, I just think this shouldn't be a big deal. My guess is the kernel-devel files that they included on the DVD aren't very complete?


The kernels at Linuxant are free, it is the linuxant ndiswrapper equivalent that you have to pay for.

You're right, it shouldn't be a big deal to configure and compile a kernel. The error you posted earlier suggests that the Makefile isn't there, which would be REALLY weird. I suppose a slightly different approach would be to download the kernel source from kernel.org, copy the .config from your RPM into that directory and then run make oldconfig. That should get you a .config that works and I know the sources from kernel.org have the proper Makefile.


All times are GMT -5. The time now is 11:07 AM.