LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where do I get just the kernel source? (https://www.linuxquestions.org/questions/linux-newbie-8/where-do-i-get-just-the-kernel-source-304098/)

batard 03-20-2005 09:07 PM

Where do I get just the kernel source?
 
I'm trying to install a wireless driver in Mandrake 10.1, but to do so I need the kernel source, and it wasn't included in the Mandrake 3-Cd install. I tried downloading the source tarball from kernel.org (my kernel here is 2.6.8.1) but once I unpacked it, it appeared that the whole kernel was there, waiting to be installed, whereas I just needed the source. I tried moving the directory the tarball created (linux-2.6.8.1) into /usr/src, but that didn't solve the problem. So is there any way to get just the source and create a directory for it in /usr/src? I'm also wondering if there's any difference between the source for linux-2.6.8.1 and the 2.6.8.1-12mdk kernel that's specific to Mandrake? I went to their web site and did a google search, but I couldn't seem to find that either.

Any help much appreciated. Please excuse my newbieness :)

t3gah 03-20-2005 09:13 PM

Re: Where do I get just the kernel source?
 
Quote:

Originally posted by batard
I'm trying to install a wireless driver in Mandrake 10.1, but to do so I need the kernel source, and it wasn't included in the Mandrake 3-Cd install. I tried downloading the source tarball from kernel.org (my kernel here is 2.6.8.1) but once I unpacked it, it appeared that the whole kernel was there, waiting to be installed, whereas I just needed the source. I tried moving the directory the tarball created (linux-2.6.8.1) into /usr/src, but that didn't solve the problem. So is there any way to get just the source and create a directory for it in /usr/src? I'm also wondering if there's any difference between the source for linux-2.6.8.1 and the 2.6.8.1-12mdk kernel that's specific to Mandrake? I went to their web site and did a google search, but I couldn't seem to find that either.

Any help much appreciated. Please excuse my newbieness :)

Are you talking about the patch so it will update? Thats at kernel.org unless the mandrake ftp site doesn't have it. You can also check the planetmirror link below too.

http://www.mandrakelinux.com/en/ftp.php3

ftp://ftp.planetmirror.com/pub/Mandrake/

batard 03-20-2005 09:27 PM

Are you talking about the patch so it will update?

Not exactly. At least, I don't think so. Basically, I unpack the wireless driver I'm trying to install (it's a CVS archive), and then I go to install it and it asks for the kernel source. the Driver itself consists of three modules that I have successfully applied to the kernel in FC3 in the past (my FC3 has the source installed).

So I type ...

# cd madwifi
# make

Then it gives me an error that says to specify a KERNELPATH. So I say, OK, I should read up on this. So I read the readme that comes with the driver, and it says if it asks for a KERNELPATH, either make that into an environment variable or specify its path after # make. So I assumed that I would have kernel source in /usr/src/linux-2.6.8.1-12mdk. But there was no such thing. I tried anyway, typing

# make KERNELPATH=/usr/src/linux-2.6.8.1-12mdk
and
# make KERNELPATH=/lib/modules/2.6.8.1-12mdk/

both without any success. There is only one thing in /usr/src, and that's a directory called ATI, created when I installed an ATI driver. This just seems odd to me, coming from FC3.

I hope that explains it a little better.

mpetrov 03-20-2005 10:49 PM

Why don't you try to move your unpacked kernel into the /usr/src/linux-2.6.8-1 and then define it as an environment variable?
I assume it didn't work because your KERNELPATH was pointing to a non existent folder.

Best Regards,
mpetrov

batard 03-21-2005 10:23 AM

Quote:

Why don't you try to move your unpacked kernel into the /usr/src/linux-2.6.8-1 and then define it as an environment variable?
Yes, unfortunately, I did try that and it didn't work. I forgot to mention that in the earlier post. I'm thinking of trying to recompile the kernel in the hope that it installs the source when it does that. I'm a little antsy about trying that - I've never done anything like that - but I can format and reinstall mandrake if necessary.

harken 03-21-2005 10:48 AM

I'm assuming you will use the kernel sources from kernel.org. Then, you don't need to format and reinstall if the compile goes wrong. Just don't delete the old kernel image and the entry in the bootloader. This way you can always boot back with the old kernel and recompile untill you get it working.
One thing though, compiling a kernel won't install the sources, that must be done by you by extracting the kernel-source tarball into /usr/src/linux-kernel_version (if it doesn't exist, create it).
And compiling a kernel isn't that hard, even though it looks scary. Just use your common-sense for setting most of the options during the config stage, then go ahead and make bzImage, make modules, make modules_install, copy the kernel image, add the new kernel entry in the bootloader's config file and that should be it.
You can always post your doubts and questions here if you're not satisfied with something.
Also, take a look here: http://www.linuxquestions.org/questi...threadid=73436 it's fairly understandable written and may give you a start.
Good luck!

__J 03-21-2005 10:54 AM

you need the mandrake kernel-source rpm for the kernel you are running. try to use urpmi to get it.

the problem you will run into with the kernel.org sources is if mandrake applied patches to the kernel source ( highly likely this is the case), then the kernel.org sources will not help you unless you know exactly what patches are added, and patch the vanilla sources with those packages. you basically have two choices:

either find the kernel-source package for your distro

or compile a new kernel. note that if you compile a new kernel, don't move the sources to /usr/src - this is no longer required and advised against by the kernel team.

batard 03-23-2005 05:29 PM

Thanks for the guidance. I did what you suggested and actually discovered that the kernel source is located on CD 3 of the mandrake 10.1 CD set. I followed the directions posted here: http://www.speculation.org/garrick/kernelprep.html. I used urpmi, and kept to the directions to the last detail, because almost all of the commands there are unfamiliar. Then I went to install the madwifi driver, and I got a ton of errors about variables already being defined (and I mean a TON of errors). Both # make and # make install gave me trouble and quit out before finishing. I don't have the faintest idea what's going on here...


All times are GMT -5. The time now is 07:14 PM.