Help - Search - Members - Calendar
Full Version: Installing Kernel Source
Linuxhelp > Support > Technical Support
eastmanuk
Hi, I've recently installed a new kernel from Linuxant to get ndiswrapper working, though when installing it, it asks for the source of the kernel, which isn't in /usr/src/

I installed the kernel using rpm -i kernel.rpm, was that correct? I also downloaded the .src file from that site, but when trying to run the rpm for that file, it tells me that module-init-tools doesn't work with source rpms (or something like that). Can anyone tell me how I'm meant to get the source files?
as2100
If you installed the kernel via RPM, you simply received a binary package of your kernel. This won't include the source of the kernel. You probably want to visit http://kernel.org to get the source distribution.

Untar the source package in /usr/src, and make a symlink named '/usr/src/linux' to point to your new '/usr/src/linux-<version>.tar.gz'

Head into /usr/src/linux and type 'make menuconfig' as root.
This nifty little configuration menu might be a little intimidating at first, but there are plenty of tutorials out there for helping you choose the devices you want enabled.

Once you're done, save the configuration file in the default location (/usr/src/linux/.config).
It should do this automatically, just hit ESC a couple times. wink.gif

Before continuing, type:
# grep NET_RADIO /usr/src/linux/.config
and be sure this "CONFIG_NET_RADIO" option has "=y" directly after it.

Now, with the saved kernel config, type 'make && make modules_install' (2.6.* only) as root.
This will compile your kernel image and modules, and install your modules in '/lib/modules/<new-kernel>'.

From '/usr/src/linux', just copy over a couple files to your bootable partition:
# mkdir /boot/newkernel
# cp {.config,System.map,arch/<your-arch>/boot/bzImage} /boot/newkernel/

Now just edit your bootloader configuration file accordingly, and reboot.

If you are simply wanting to install ndiswrapper, there shouldn't be any further kernel complications (pray to the module loading gods for that wish, however).

Ndiswrapper has a pretty fancy installation wiki, check it out and good luck. smile.gif
DS2K3
Most distributions have modified kernel-sources, in which case the "vanilla" sources (from kernel.org) wont help. If you installed one of the kernels from linuxant, then you will need to get the appropriate kernel-source RPM. Which distribution are you using?

D
eastmanuk
I'm using Fedora Core 4, which I'm pretty sure uses a modified kernel... The sources for that kernel are in the /usr/src/kernels folder, so would making a copy of that folder, making the changes, then basically following the rest of as2100's instructions work?

Oh, and two quick questions... He says about a symlink, what is that and how does it work? And what is the part about 'arch', and how would I find out what arch I'm using?

Thanks for the replys guys smile.gif
eastmanuk
Heres what I've done so far (I'm using Fedora Core 4):

Copied my old kernel source, renamed it, put it back into the /usr/src/kernels folder.

Made a symlink to it, using ln -s newkernel linux
Went into the /usr/src/kernels/linux folder.

Used make menuconfig, changed one thing (disable use 4k stacks instead of 8k), esc out of that and saved.

Typed make && make modules_install which starts, but after less than a minute, I'm given this:
CODE
make[1]: *** No rule to make target 'init/main.o', needed by 'init/built-in.o'.
Stop.
make: *** [init] Error 2


Anyone know why?
DS2K3
If you installed a kernel from Linuxant, them i'm a bit confused as to why you are compiling another one... Apparently, those Linuxant kernels are the same as teh Fedora stcok kernels, just with the stack change. So, installing the stock kernel-source package for the kernel you are using (type "uname -r" to find out the currently running kernel version) should do.

D
eastmanuk
Heh, seems I was being a bit stupid... I installed the kernel from linuxant, which was only the binary, and I needed the source... And I couldn't figure out what to do with the .src.rpm file, heh.

Well, now I've figured out all that, installed it all, and now I just gotta test it... But to do that, I need to edit Grub to boot it... Can anyone tell me what to do with the .config, bzImage, and System.map files, and what to type into the Grub config file? Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.