
Greig McGill and Matt - and others, care to view my inline understanding and comment ?
Hi.
I don't "do" Mandrake, so I've no idea what urpmi is doing with the kernel source, but the steps for building a kernel from source are pretty simple. Ignore all this "don't install into /usr/src/linux stuff... it's just advice. I tend to trust signed kernels, and am willing to take the risk involved in building as root. This advice reflects that.
What I was missing was that simply unpacking the bz2 tar-ball was in fact installing the sources in the first place, so thanks to Matt that is cleared up and I shall proceed.
1. Download and unpack your kernel source. You've done that. # cd /usr/src # wget -c ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.10.tar.bz2 # tar -jxvf linux-2.6.10.tar.bz2
Nothing wrong with this but if as I have already downloaded the tar-ball then the option for me needed clarification. In this case I will simply: # mv /home/frank/src/linux-2.6.10 /usr/src/ Because I will need to re-compile the kernel later for my modem [ cnet 536 ep ] using linmodem advice. For that I will need the kernel-source to be were such building will find it.
At this point, you have a fresh, unconfigured, uncompiled kernel source tree in /usr/src/linux-2.6.10 - feel free to link this to /usr/src/linux as follows:
ln -s /usr/src/linux-2.6.10 /usr/src/linux
Anyone else reading this with a usable kernel already running might NOT want to do this just yet because a `linux` link already exists to your current kernel. If you are confident that you will not suffer a power outrage or can run a suitable recovery disk if you do have one, then you need to first remove the existing link and then later either rename another or rename the new link once you have finished the new kernel installation. By renaming the new link and reinstating the old link your existing kernel will still be your default until you are happy to make the new one the default - primarily for system reference when installing new modules, etc. I think. Care to clarify this folks ? I have at present eg.: [frank(a)Snapafun frank]$ ls -al /usr/src/ total 32 drwxr-xr-x 8 root root 4096 Jan 6 17:56 ./ drwxr-xr-x 15 root root 4096 Jul 6 2004 ../ lrwxrwxrwx 1 root root 16 Jul 28 19:24 linux -> linux-2.6.3-7mdk/ drwxr-xr-x 18 frank frank 4096 Dec 25 10:35 linux-2.6.10/ lrwxrwxrwx 1 root root 18 Jan 5 02:18 linux.263 -> linux-2.6.3-9mdk-1/ drwxr-xr-x 20 root root 4096 Jul 26 23:00 linux-2.6.3-15mdk-1/ drwxr-xr-x 21 root root 4096 Jan 5 01:46 linux-2.6.3-7mdk/ drwxr-xr-x 4 root root 4096 Jul 26 23:00 linux-2.6.3-9mdk-1/ drwxrwxr-x 19 500 500 4096 Jan 5 01:47 linux-2.6.7/ drwxr-xr-x 7 root root 4096 Jul 28 22:04 RPM/ As you can see, I have POSSIBLY 5 kernels available but two links already in place for my system to reckon with. All previous kernels were installed using urpmi so this is the first attempt by myself to compile from source. By removing for amendment later I hope not to confuse the build scripts. So: # rm /usr/src/linux # ln -s /usr/src/linux-2.6.10 /usr/src/linux
Now /usr/src/linux is a "shortcut" to the full kernel path. This is handy as it saves typing time, and also shows which version you're running.
2. Configure your kernel. This is where you set up your kernel so that it supports your hardware. If you don't understand an option, just leave it at its default setting.
# cd /usr/src/linux # make menuconfig
other options are available here and this newbie is going to try # make xconfig instead - fingers crossed.
<choose all your options and save>
3. Build your kernel - this is where you make your system compile the kernel source into a binary kernel.
Assuming you're still in /usr/src/linux:
# make && make modules && make modules_install
Hopefully, you'll not get any errors during compilation. If you do, you may have enabled an experimental feature, or driver which will not build on your system. go back to step 2, and try again...
4. Install your kernel This is where you copy the compiled kernel to the /boot directory, and setup your boot loader to use it.
Again, I'm assuming you're still in /usr/src/linux:
# mv arch/i386/boot/bzImage /boot/bzImage-2.6.10 # mv System.map /boot/System.map-2.6.10
As for updating your bootloader, that depends on whether you're using grub or lilo, but you should be able to figure it out by looking at the existing config file for either and adding a new block to use your new kernel. Use common sense, and don't REPLACE the existing block, as if your new kernel won't boot, you'll want to be able to select your old kernel from the bootloader menu.
Here I need to identify the new and the old as I mentioned above so: # rm /usr/src/linux # ln -s /usr/src/linux-2.6.3-7mdk /usr/src/linux [ my currently working kernel ] # ln -s /usr/src/linux-2.6.10 /usr/src/linux2610 [ linux2610 being the name I choose to reference and use within lilo.conf ]
Hope that helps.
So now that I have added what it is I am going to do, care to slap my fingers with anything before I push the big green button? To E&OE and Matt - thanks very much for your responses - greatly appreciated and has helped clear things up no end. -- Newbie Seeking USER_FUNCTIONALITY always! Regards SnapafunFrank Big or small, a challenge requires the same commitment to resolve. Registered Linux User # 324213