Re: fedora-list Digest, Vol 10, Issue 364

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Wong Kwok-hon wrote:
> >Hello!
> >
> >I have used Linux since RH9 to FC3 for 6 months but I don't know how
> >to complie the kernel because I can't find any clear procedure to do
> >that. And I noticed that kernel 2.6 is changed and some steps needn't.
> >
> >I am new in complie the kernel because I just install the rpm before.
> >And due to my USB harddisk shown the buffering error shown from
> >kernel. So I may need to re-complie the kernel to fix it.
> >
> >And I saw someone posted some steps of complie a custom kernel of
> >2.6.x as follows:
> >
> >I read from a magazine as
> >------------------------------------------------
> >1. Unpack sources into /usr/src/
> >2. make xconfig
> >3. make menuconfig
> >4. make
> >5. make modules_install
> >6. make install
> >7. reboot the machine
> >
> >OR
> >
> >Someone posted as
> >-----------------------------
> >1. Unpack sources into /usr/src/
> >2. make
> >3. make modules
> >4. make modules_install
> >5. make install
> >6. reboot the mahine
> >
> >Which one is the right way ?
> >Would it become rpm?
> >And how about to become a rpm ?
> >How to remove the error kernel if failed ?
> >
> >Thanks for helping me first because they make me mixed.
> >And sorry for my english is poor.
> >
> >Ringo
>
> the procedure for making a new kernel is :
>
> un pack kernel new
> if this a patch for the kernel-old , you can apply  that :
>
> gzip -cd ../patch-2.6.xx.gz | patch -p1
>
> or
> bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1
>
>
> i make my new kernel with that :
>
> ln -sf  /usr/src/linux-Version /usr/src/linux
> cd  /usr/src/linux
>
> make xconfig  ( or other config option )
>
> make
>
> according to your config you make your kernel with :
This is for kernel 2.4.x only
> make dep
> make modules
> make modules_install
> make install
i don't think it will work, you have to manually copy the bzImage to /boot and 
"make initrd" and copy the initrd to /boot too.
>
> at this moment if you reboot your computer your bzimage is not updated ,
> for lilo , check the /etc/lilo.conf
> and make a new started line with the old starter
> cmd :  lilo
>
> cp ../linux/arch/i386/boot/bzImage   /boot
>
> else see the doc on kernel.org ( or search on the net : howtow kernel )
best place to learn http://tldp.org
>
> alexandre
>

Procedure of compling the kernel 2.6.x

1. copy the kernel source file to /use/src, you can keep the source anywhere. 
There's no hard and fast rules but other software when compiled might look 
in /usr/src/linux 
    cp kernel-2.6.x /usr/src

2. Uncompress the kernel source file
    tar zxvf kernel-2.6.x.tar.gz (for tar file)
    tar jxvf kernel-2.6.x.bz2 (for bzip file)

3. ln -s /usr/src/kernel-2.6.x linux

4. cd linux

5. make menuconfig (terminal base), I recommend this.
    make xconfig (graphical base), since you 're new try this one. 

6. make 

7. make modules_install

8. make install

This is all you have to do. To verify wheather its correctly installed or not, 
vi /etc/grub.conf (if you don't find the file, then try 
in /boot/grub/grub.conf). 

Example:

default=1
timeout=10
splashimage=(hd0,6)/grub/splash.xpm.gz

title Fedora Core (2.6.5-1.358)
        root (hd0,6)
        kernel /vmlinuz-2.6.5-1.358 ro root=/dev/hda8 rhgb quiet
        initrd /initrd-2.6.5-1.358.img
title Fedora Core Custom (2.6.9)
        root (hd0,6)
        kernel /vmlinuz-2.6.9 ro root=/dev/hda8 rhgb quiet
        initrd /initrd-2.6.9.img
title Windows XP
        rootnoverify (hd0,0)
        chainloader +1


default: This tells the grub the default boot. Remember in grub, it starts 
from 0. For above example, Fedora Core is 0 and Fedora Core Custom is 1, goes 
like this.

timeout: It tells grub to hold before it boots default kernel. It is counted 
in seconds.

To remove error kernel just comment the line or delete the block, and make 
sure default to respective number.
eg:
default=0
timeout=10
splashimage=(hd0,6)/grub/splash.xpm.gz
title Fedora Core (2.6.5-1.358)
        root (hd0,6)
        kernel /vmlinuz-2.6.5-1.358 ro root=/dev/hda8 rhgb quiet
        initrd /initrd-2.6.5-1.358.img
#title Fedora Core Custom (2.6.9)
#        root (hd0,6)
#        kernel /vmlinuz-2.6.9 ro root=/dev/hda8 rhgb quiet
#        initrd /initrd-2.6.9.img
title Windows XP
        rootnoverify (hd0,0)
        chainloader +1

To clean up the mess:

1. cd /boot

2. to remove compiled kernel
rm System.map System.map-2.6.x vmlinuz vmlinuz-2.6.x

3. Restoring to original, before compile the kernel go to /boot and ls -l so 
you can note down file name and symbolic link.
ln -s System.map-original System.map
ln -s vmlinuz-original vmlinuz

That's all. Hope you'll enjoy the compling the kernel. Happy compling.
-- 
Sincerely,

Aabash Gurung


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux