Simple guide I wrote ro help some people in a forum
WARNING: If you have never done this before, make sure that you have the install cd for your distro. It will help a lot when you screw up. Dont let that discourage you, it takes a few attempts whenever any trys doing this the first time.
NOTES:
* all commands assume that you are runing in root. you can get root access my typing `sudo -i`
* all command line commends will be within ticks ( ` ) so the command ls would be `ls`
First Back everything up
`sudo -i`
`cp -r /boot /boot.backup`
`cp -r /usr/src/linux /usr/src/linux.backup`
now you can restore your system my booting into the distro cd and pressing ALT+CRL+SHIFT+F1 and running
`sudo -i`
`mv /boot /boot.screwedup`
`mv /boot.backup /boot`
`cd /usr/src/linux.backup`
`make&&make modules_install`
`reboot`
Ok that how to save your system, now how to screw it up. The funnest part.
To compile your kernel you need to know what you have. there is NO AUTO HARDWARE stuf. To get a list of your pci bus run this command
`lspci | less`
Explanation: lspci reeds your PCI slots in you box and prints it out, less is a tool for scrooling through output. Oh `|` is called a pipe and it takes the output from lspci and pipes it into the tool less.
it also works for usb
`lsusb|less`
cool right?
So now you know your hardware, lets find your cpu
`less /proc/cpuinfo`
Thats your cpu info. now for the hard part configuring you kernel.
This might be helpfull
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7
now to get to your kernel type
`/usr/src/linux/`
to configure it type in
`make menuconfig`
If you have ubuntoo you have a confusing task infront of you. ubuntoo complies everything as modules, then loads them into your system as modules. this slowes your system down a lot. so everything you saw in `lspci` and `lsusb` complile into your system. Thats makked my a star( [*] ), Modules as a M ( [M] ). I tend to avoid modules. Now uncheck everything you dont want and check everything you do want.
go, Have fun. you can search by hiting the `/` key.
go
Done?
ok, save your config and exit.
now you have to compile it.
`make && make modules_install`
now you have to install the kernel. you have to copy it to boot.
`cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel.new`
cool, now we need to find you made as modules. You do not need to do this if you enabled “automatic module loading” in “loadable module suport”. If you have that, skip down to BOOTLOADER
You can find your kernel version by seeing where /usr/src/linux points
`ls -l /usr/src/linux`
`find /lib/modules// -type f -iname ‘*.o’ -or -iname ‘*.ko’`
For instance, to automatically load the 3c59x.ko module, edit the kernel-2.6 file and enter the module name in it.
`nano -w /etc/modules.autoload.d/kernel-2.6`
and type in 3c59x (leave out the .ko)
BOOTLOADER
now you need to add your kernel to the grub bootloader (if you use lilo props to you but, I am only explaining the most common bootloader.
READING:
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
what you are going to do is open your grub file
`nano -w /boot/grub.conf`
and make a new entry at the bottom. note what (hd?,?) is in the other entreys and use those numbers. add these lines to the end of the file
Also edit the line DEfult=X with the number of your entry
——–code snip—–
title=Your Kernel
# Partition where the kernel image
# (or operating system) is located
# for example (hd0,2)
root (hd?,?)
kernel /boot/kernel.new root=/dev/ROOT
—-END—-
Replace (hd?,?) with your grub drvice (look at the other entreys
Replace /dev/ROOT with you root davice ie /dev/hda2 or /dev/sda4. If you do not know this and not know how to get this you shuld not be doing this but you can find out with the mount command.
Great now reboot and pray.
Reply if you have questions