ºìÁªLinuxÃÅ»§
Linux°ïÖú

FedoraÖбàÒëÒ»¸öÄÚºË

·¢²¼Ê±¼ä:2006-12-05 09:49:31À´Ô´:ºìÁª×÷Õß:multitude
ÿһ¸öLinux·¢Ðа涼ÓÐ×Ô¼º×¨ÃŵŤ¾ßÈ¥¹¹½¨×Ô¶¨ÒåµÄÄÚºË. ±¾ÎÄÖ÷Òª½éÉÜÔÚFedoraƽ̨ÉϱàÒëÄÚºË, ÈçºÎ´Ówww.kernel.org(Ò²½Ðvanilla kernel)»ñµÃ×îÐÂÇÒδ¸Ä¶¯µÄÄÚºËÔ´´úÂëÀ´¹¹½¨Ò»¸ö×Ô¶¨ÒåµÄÄÚºË, ÕâÑùÄã¿ÉÒÔʹÓÃ×Ô¼ºµÄÄں˶ø²»ÊÇ·¢ÐаæµÄÄÚºË, ÁíÍâÒ²½éÉÜÁËÈçºÎ¸øÄں˴ò²¹¶¡, ´Ó¶ø·½±ãÔö¼ÓÐµĹ¦ÄÜ.

ÏÂÃæµÄ¹¤×÷ÎÒ¶¼ÔÚFedora Core 6ÉϾ­¹ýÁ˲âÊÔ.


ÎÒÏëÊ×ÏÈҪ˵µÄÊÇÎÄÕÂÖй¹½¨×Ô¶¨ÒåÄں˵ķ½Ê½²»ÊÇΨһµÄ, »¹ÓÐÐí¶àÆäËüµÄ·½Ê½, Õâ²»¹ýÊÇÎÒÏ°¹ßµÄ·½Ê½. ÎÒ²»Äܱ£Ö¤Ê¹Óú󲻻á³öÏÖÈκÎÎÊÌâ.

1. Ô¤±¸¹¤×÷
±¾ÎÄÎÒ½«ÃèÊöÔÚFedoraƽ̨ÉϹ¹½¨×Ô¶¨ÒåÄں˵ÄÁ½ÖÖ·½Ê½. µÚÒ»ÖÖÊÇFedora·½Ê½, ×îºóÄ㽫ÄÜ»ñµÃÒ»¸öÄÚºËrpm°ü, ´Ó¶ø¿ÉÒÔ·½±ãµØÓëËûÈË·ÖÏí. µÚ¶þÖÖÊÇ´«Í³·½Ê½, ÊÊÓÃÓÚËùÓÐlinux·¢Ðаæ, ²»¹ý×îºóÄã²»»áÓÐÒ»¸örpm°ü.

ÎÒÍƼöʹÓÃrootÓû§×öÏÂÃæËùÓеIJ½Öè. È»¶ø, ÓÐʱҲÐèҪʹÓ÷dz¬¼¶Óû§(±ÈÈçÓû§tom)À´ÔËÐÐһЩÃüÁî, ËùÒÔÄã¿ÉÄÜ»áʹÓÃvisudo±à¼­Æ÷ÔÚ/etc/sudoersÎļþÖÐÌí¼ÓÏÂÃæÒ»ÐÐ:
tom ALL=(ALL) ALL

ÏÖÔÚÎÞÂÛʲôʱºòÄãÐèÒªÓÃrootȨÏÞÔËÐÐÃüÁî, ±ÈÈç:
yum install fedora-rpmdevtools unifdef

Ä㶼¿ÉÒÔÓÃÏÂÃæµÄÃüÁîÀ´Ìæ´ú:
sudo yum install fedora-rpmdevtools unifdef

Çë¼Çס: Èç¹ûÒÔrootÓû§Éí·ÝÔËÐÐËùÓÐÃüÁî, Äã¿ÉÒÔÍêÈ«Íü¼Çsudo. ²ÉÓÃʲô·½Ê½, ¿´Äã×Ô¼ºµÄÏ°¹ß.

2. ¹¹½¨rpmÄں˰ü
ÕâһС½Ú½éÉÜÈçºÎ¹¹½¨ÄÚºË, ×îÖÕÄã¿ÉÒԵõ½Ò»¸örpm°ü, ÕâÑù¿ÉÒÔ·½±ã°²×°»òÓëËûÈË·ÖÏí.

2.1 ´´½¨ÄãµÄrpmbuildĿ¼
°´ÏÂÃæ´´½¨ÄãµÄrpmbuildĿ¼:
cd ~
cp -a /usr/src/redhat/ rpmbuild
echo '%_topdir %(echo $HOME)/rpmbuild' >> .rpmmacros

È»ºó°²×°¹¹½¨rpm°üÐèÒªµÄÓ¦ÓÃÈí¼þ°ü
yum install fedora-rpmdevtools unifdef

È»ºóÔËÐÐ
fedora-buildrpmtree

2.2 ÏÂÔغͰ²×°FedoraÄÚºËsrc.rpm°ü
½ÓÏÂÀ´ÎªÎÒÃǵÄFedora°æ±¾ÏÂÔØ×îеÄÄÚºËsrc.rpm°ü. Õë¶ÔFedora Core 6, Äã¿ÉÒÔ´Ó½ÓÏÂÀ´µÄÍøÖ·»ñµÃsrc.rpm°ü: http://download.fedora.redhat.com/pub/fedora/linux/core/6/source/SRPMS/, Õë¶ÔFedora Core 5, Äã¿ÉÒÔ´ÓÏÂÃæµÄÍøÖ·»ñµÃsrc.rpm°ü: http://download.fedora.redhat.com/pub/fedora/linux/core/5/source/SRPMS/, µÈµÈ.

×îеÄFedora Core 6ÄÚºËsrc.rpm°üÊÇkernel-2.6.18-1.2798.fc6.src.rpm, ËùÒÔÎÒÃÇÏÖÔÚÏÂÔغͰ²×°Ëü:
cd /usr/src
wget http://download.fedora.redhat.com/pub/fedora/linux/core/6/source/SRPMS/kernel-2.6.18-1.2798.fc6.src.rpm
rpm -ivh kernel-2.6.18-1.2798.fc6.src.rpm

Èç¹ûÄã¿´µ½ÕâЩ¾¯¸æ:
warning: user brewbuilder does not exist - using root
warning: group brewbuilder does not exist - using root

Äã¿ÉÒÔºöÂÔËüÃÇ.

ÎÒÃÇÒѾ­³É¹¦°²×°ÁË×îеÄ2.6.18.1ÄÚºËÔ´´úÂë°ü. Èç¹ûÎÒÃǼÌÐø¹¹½¨ÄÚºËÔ´´úÂë°üµÄ»°, ÎÒÃǵÄÄں˰汾½«ÊÇ2.6.18.1.

2.3 ¸øÄں˴ò²¹¶¡

ÎÒÏë°²×°ÐÂÄÚºË2.6.18.2À´Ìæ´ú2.6.18.1. ϵͳÒѾ­°²×°µÄsrc.rpm°üÊǸø2.6.18´ò¹ý²¹¶¡µÄ2.6.18.1. ¶øÎÒÃÇÏÖÔÚ½«Ê¹Óôò²¹¶¡µÄ·½Ê½Éý¼¶Äں˵½2.6.18.2
cd ~/rpmbuild/SOURCES/
wget http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.18.2.bz2

Èç¹ûÄãÏëÄں˵ÄÃû×Ö½áβΪ2.6.19-rc5, ÄãÒ²¿ÉÒÔʹÓÃprepatch°ühttp://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.19-rc5.bz2. Çë×¢ÒâÕâÏ×÷½ö¶ÔprepachesÓÐЧ. ±ÈÈç. Äں˲¹¶¡½ö¶Ô×îÖÕ·¢ÐеÄÄں˰汾ÓÐЧ, ±ÈÈç2.6.19ÄÚºË. Äã¿ÉÒÔ¸ø2.6.18ÄÚºËÔ´´úÂë´ò²¹¶¡, µ«²»ÄÜÊÇ2.6.18.1»ò2.6.18.2, µÈ. Õâ¸ö¹æÔòÔÚ½ÓÏÂÀ´µÄÍøÒ³ÖÐ×¢Ã÷: http://kernel.org/patchtypes/pre.html

prepatchesµÈͬÓÚlinuxÖеIJâÊÔ·¢ÐÐ; ËûÃÇλÓÚ´æµµµÄ²âÊÔĿ¼ÖÐ, ÎÒÃÇ¿ÉÒÔʹÓÃpatch(1)¹¤¾ß¶ÔÉÏÒ»¸öÍêÕû·¢Ðаæ(°æ±¾ºÅ·ÖÈý²¿·Ö)´ò²¹¶¡(ÀýÈç, 2.6.13-rc4 prepatchÖ»¿ÉÒÔ¸ø2.6.11ÄÚºËÔ´´úÂë´ò²¹¶¡, ¶ø²»ÊÇ2.6.11.10.)

ÏÖÔÚÎÒÃDZØÐëÐÞ¸Äkernel-2.6.specÎļþ, ÈÃËüÖªµÀÎÒÃÇʹÓÃÁËеÄÄں˲¹¶¡:
cd ~/rpmbuild/SPECS/
vi kernel-2.6.spec

ËÑÑ°ÏÂÃæÐÐ
Patch1: patch-2.6.18.1.bz2

Ì滻ΪÏÂÃæµÄÄÚÈÝ:
Patch1: patch-2.6.18.2.bz2

(»òÕßÆäËüÄãÒÑÏÂÔصİ汾)

È»ºóÔËÐÐ
rpmbuild -bp kernel-2.6.spec

(Èç¹ûÄãÏë¹¹½¨ÆäËüƽ̨Èçi386, i586, i686»òÕßx86_64µÄÄÚºË, Äã¿ÉÒÔͨ¹ýÔËÐÐÏÂÃæµÄÃüÁîÀ´ÊµÏÖ:
rpmbuild -bp --target=i686 kernel-2.6.spec

ÎÒûÓÐÔÚÉÏÃæÀý×ÓÖÐÖ¸¶¨Îªi386, ÄãµÄϵͳ¿ÉÄÜÊÇÆäËüµÄƽ̨ÀàÐÍ, Çë¼ÇµÃÌîдÄãµÄƽ̨ÀàÐÍ.)

ÏÖÔÚÎÒÃǽøÈëµ½¹Ø¼üµÄ²¿·Ö. src.rpmÓкܶàfedoraרÃŵIJ¹¶¡, ÆäÖÐһЩ²»ÄÜÓëÎÒÃǵÄ2.6.18.2²¹¶¡ºÜºÃµÄ¹¤×÷, ËùÒÔÈç¹ûÄãÔÚrpmbuildÊä³ö¿´µ½ÏÂÃæ×´¿ö:

+ echo 'Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):'
Patch #300 (linux-2.6-ppc-dac960-ipr-clash.patch):
+ patch -p1 -s
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored -- saving rejects to file drivers/block/DAC960.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.46287 (%prep)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.46287 (%prep)

ÕâʱºòÄã±ØÐëÔٴα༭kernel-2.6.specÎļþ, ×¢½âµôpatch #300Ò»ÐÐ:
vi kernel-2.6.spec

[...]
#Patch300: linux-2.6-ppc-dac960-ipr-clash.patch
[...]
#%patch300 -p1
[...]

È»ºóÔÙÔËÐÐrpmbuildÃüÁî, ±ÈÈç:
rpmbuild -bp kernel-2.6.spec

×¢Òâ: Äã±ØÐë²»¶ÏÖظ´ÉÏÃæ¹ý³ÌÖ±µ½²»³öÏÖÈκδíÎó.
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 5 ÌõÆÀÂÛ

  1. cxqcxq0177 ÓÚ 2006-12-14 12:54:25·¢±í:

    Â¥Ö÷Ç¿ÈË°¡£¬Ñ§Ï°Ñ§Ï°

  2. multitude ÓÚ 2006-12-05 09:51:38·¢±í:

    3.4 ¹¹½¨ºÍ°²×°ÐµÄÄÚºË
    ¹¹½¨ºÍ°²×°ÐµÄÄÚºË, Ö´ÐÐÏÂÃæµÄ3¸öÃüÁî:
    make all
    make modules_install
    make install
    ±£³ÖÄÍÐÄ, Äں˱àÒëÐèÒªÒ»¶¨Ê±¼ä, Ö÷Òª¿´ÄãµÄÄÚºËÅäÖúʹ¦ÀíÆ÷ËÙ¶È. ×îºóÒ»¸öÃüÁ×Ô¶¯´´½¨Ò»¸öramdisk, Ä㽫ÔÚ/boot/grub/menu.lstÓõ½.
    ÏÖÔڱ༭/boot/grub/menu.lst. °ÑÄãµÄеÄÄÚºËÐÅÏ¢·Åµ½ÁбíµÄ¶¥¶Ë, È·ÈÏеÄÄÚºËѾ?æ´?ϵÄÄÚº? defaultÖµÐèÒªÉèΪ0.
    vi /boot/grub/menu.lst
    ÎÒµÄmenu.lstÊÇÕâÑùµÄ:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE: You have a /boot partition. This means that
    # all kernel and initrd paths are relative to /boot/, eg.
    # root (hd0,0)
    # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
    # initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Fedora Core (2.6.18.2)
    root (hd0,0)
    kernel /vmlinuz-2.6.18.2 ro root=/dev/VolGroup00/LogVol00
    initrd /initrd-2.6.18.2.img
    title Fedora Core (2.6.18-1.2798.fc6)
    root (hd0,0)
    kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00
    initrd /initrd-2.6.18-1.2798.fc6.img
    ÏÖÔÚÖØÐÂÆô¶¯ÏµÍ³:
    shutdown -r now
    Èç¹ûÒ»Çнøչ˳Àû, ÄãµÄÐÂÄÚºËÕý³£¹¤×÷. Äã¿ÉÒÔͨ¹ýÔËÐÐÏÂÃæÃüÁîÀ´¼ì²éÄãµÄÐÂÄÚºËÊÇ·ñÔËÐÐ:
    uname -r
    Õ⽫»áÏÔʾÈç:
    2.6.18.2
    Èç¹ûϵͳûÓÐÆðÀ´, ÖØÆôÒ»ÏÂ, Äã»á¿´µ½:

    °´ÈÎÒâ¼ü½øÈëGRUB²Ëµ¥:

    Ñ¡ÔñÄãÒÔÇ°µÄÄÚºËÆô¶¯ÏµÍ³, ÏÖÔÚÄãÄÜÔٴγ¢ÊÔ±àÒëÐµĹ¤×÷ÄÚºË. ²»ÒªÍü¼Ç´Ó/boot/grub/menu.1stÎļþÖÐÒÆÈ¥²»ÐèÒªµÄÒýµ¼ÄÚºËÐÅÏ¢.

  3. multitude ÓÚ 2006-12-05 09:51:11·¢±í:

    3. ¹¹½¨Äں˵Ĵ«Í³·½Ê½
    Õâ¸öÕ½ڽ²ÊöÁíÒ»ÖÖÊÊÓÃÓÚËùÓÐlinux·¢ÐаæµÄÄں˱àÒ뷽ʽ. ¸úFedora±àÒ뷽ʽ²»Í¬µÄÊÇ, ½á¹û²»»áÓÐrpmÄں˰ü.
    3.1 ÏÂÔØÄÚºËÔ´´úÂë
    ÎÒÃÇÏÂÔØÐèÒªµÄÄں˵½/usr/srcĿ¼(È¥www.kernel.orgÍøÕ¾ÏÂÔØÄãÐèÒªµÄÄں˰汾, ±ÈÈç. linux-2.6.18.2.tar.bz2(Äã¿ÉÒÔ´ÓÕâÀïÏÂÔØËùÓеÄ2.6ÄÚºË: http://www.kernel.org/pub/linux/kernel/v2.6/). È»ºóÏÂÔص½/usr/srcĿ¼:
    cd /usr/src
    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.2.tar.bz2
    È»ºó½âѹÄÚºËÔ´´úÂë, ´´½¨Ò»¸öÖ¸ÏòÄÚºËÔ´´úÂëĿ¼µÄlinux×Ö·ûÁ´½Ó:
    tar xjf linux-2.6.18.2.tar.bz2
    ln -s linux-2.6.18.2 linux
    cd /usr/src/linux
    3.2 ¸øÄÚºËÔ´´úÂë´ò²¹¶¡(¿ÉÑ¡)
    ÓÐʱÄãµÄȱʡÄں˲»Ö§³ÖÐÂÂòµÄÉ豸, ÄãÐèÒª°²×°ÐµÄÇý¶¯. »òÕßÄãÐèҪʹÓÃÐéÄâ¼¼Êõ»òÆäËü¸ß¼¶µÄ¼¼Êõ, ¶øÕâЩÏÖÓеÄÄں˶¼²»Ö§³Ö. ÕâÑùÇé¿öÏÂÄãÐèÒª¸ø¸øÄÚºËÔ´´úÂë´ò²¹¶¡(µ±È»²¹¶¡ÒѾ­·¢²¼..)
    ÏÖÔÚÎÒÃǼÙÉèÄãÒѾ­ÏÂÔØÐèÒªµÄ²¹¶¡(ÒÔÏÂÀý×ÓÎÒ½ÐËüpatch.bz2)µ½/usr/src. ÔËÐÐÏÂÃæµÄÃüÁî¸øÄÚºËÔ´´úÂëÖ±½Ó´òÉϲ¹¶¡(ÄãµÄÓû§±ØÐëλÓÚ/usr/src/linuxĿ¼):
    bzip2 -dc /usr/src/patch.bz2 | patch -p1 --dry-run
    bzip2 -dc /usr/src/patch.bz2 | patch -p1
    µÚÒ»¸öÃüÁîÓÃÓÚ²âÊÔ, ¶ÔÄÚºËûÓÐÈκÎÓ°Ïì. Èç¹ûûÓÐÏÔʾ´íÎó, Äã¿ÉÒÔÔËÐеڶþ¸öÃüÁî¸øÄں˴ò²¹¶¡. Èç¹ûµÚÒ»¸öÃüÁîÓÐÎó, ÇëÎñ¼ÌÐøµÄ²Ù×÷!
    ÄãÒ²Äܹ»Í¨¹ýÄں˵Äprepatches·½Ê½´ò²¹¶¡. ±ÈÈç, Èç¹ûÄãÐèÒªÒ»¸ö¹¦ÄÜ, ¶øÕâ¸ö¹¦Äܽö´æÔÚÓÚ2.6.19-rc5ÖÐ, ÕýʽÍêÕûµÄÄں˰汾ÈÔûÓз¢²¼, ¶øpatch-2.6.19-rc5.biz2ÒѾ­·¢²¼. Äã¿ÉÒÔ°ÑÕâ¸ö²¹¶¡´òµ½2.6.18µÄÄÚºËÔ´´úÂëÖÐ, µ«Çë²»Òª´ïµ½2.6.18.1»ò2.6.18.2, µÈ. Õâ¸ö¹æÔòÔÚ½ÓÏÂÀ´µÄÍøÒ³ÖÐ×¢Ã÷: http://kernel.org/patchtypes/pre.html
    prepatchesµÈͬÓÚlinuxÖеIJâÊÔ·¢ÐÐ; ËûÃÇλÓÚ´æµµµÄ²âÊÔĿ¼ÖÐ, ÎÒÃÇ¿ÉÒÔʹÓÃpatch(1)¹¤¾ß¶ÔÉÏÒ»¸öÍêÕû·¢Ðаæ(°æ±¾ºÅ·ÖÈý²¿·Ö)´ò²¹¶¡(ÀýÈç, 2.6.13-rc4 prepatchÖ»¿ÉÒÔ¸ø2.6.11ÄÚºËÔ´´úÂë´ò²¹¶¡, ¶ø²»ÊÇ2.6.11.10.)
    ËùÒÔÈç¹ûÄãÏë±àÒë2.6.19-rc5ÄÚºË, Äã±ØÐëÔÚ²½Öè3.1ÏÂÔØ2.6.18(http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.tar.bz2)Ìæ´ú2.6.18.2ÄÚºËÔ´´úÂë!
    ÏÂÃæÊÇÈçºÎ¸ø2.6.18´òÉÏ2.6.19-rc5²¹¶¡:
    cd /usr/src
    wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.19-rc5.bz2
    cd /usr/src/linux
    bzip2 -dc /usr/src/patch-2.6.19-rc5.bz2 | patch -p1 --dry-run
    bzip2 -dc /usr/src/patch-2.6.19-rc5.bz2 | patch -p1
    3.3. ÅäÖÃÄÚºË
    ʹÓõ±Ç°¹¤×÷Äں˵ÄÅäÖÃÎļþ×öΪÐÂÄÚºËÅäÖÃÎļþµÄ»ù´¡ÊÇÒ»¸öºÜºÃµÄÖ÷Òâ. Òò´ËÎÒÃÇ¿½±´ÒÑ´æµÄÅäÖÃÎļþµ½/usr/src/linux:
    make mrproper
    cp /boot/config-`uname -r` ./.config
    È»ºóÔËÐÐ
    make menuconfig
    È»ºóÎÒÃÇ¿´µ½Äں˵ÄÅäÖò˵¥. Òƶ¯ÂÌÉ«¹â±êµ½ Load an Alternate Configuration File ÐкóÑ¡Ôñ.configÎļþ×öΪÅäÖÃÎļþ:


    È»ºóä¯ÀÀÄÚºËÅäÖò˵¥, Ñ¡ÔñÄãÐèÒªµÄ¹¦ÄÜ. Íê³ÉÅäÖúó, Ñ¡ÔñExit, »Ø´ðÏÂÃæµÄÎÊÌâ(Do you wish to save your new kernel configuration? ÄãÏ£Íû±£´æеÄÄÚºËÅäÖÃÂð?), Ñ¡ÔñYes:

  4. multitude ÓÚ 2006-12-05 09:50:39·¢±í:

    2.7 °²×°ÐÂÄÚºË
    ÏÖÔÚȥеÄrpmÄں˰ü´æÔÚµÄĿ¼(»ùÓÚÄãµÄƽ̨ÀàÐÍ, ±ÈÈç. ~/rpmbuild/RPMS/i386/)°²×°rpm°ü:
    cd ~/rpmbuild/RPMS/i386
    rpm -ivh kernel-2.6.18custom2.6.18.2-1.i386.rpm
    (ÏÖÔÚÄãÉõÖÁÄܹ»¿½±´µ½ÆäËüµÄFedoraϵͳ, ͨ¹ýÉÏÃæµÄ·½Ê½°²×°. Ä㽫²»ÔÙÐèÒª±àÒëÄÚºË.)
    ½ÓÏÂÀ´ÎÒÃÇΪÐÂÄں˴´½¨Ò»¸öramdisk, ·ñÔòϵͳ½«²»ÄÜÒýµ¼ÐÂÄÚºË:
    mkinitrd /boot/initrd-2.6.18-custom-2.6.18.2.img 2.6.18-custom-2.6.18.2
    È»ºó±à¼­/boot/grub/menu.lstÎļþ, ¿´Ò»ÏÂÄãϵͳÉÏÒѾ­´æÔÚ(ÕýÔÚ¹¤×÷µÄ)Òýµ¼ÄÚºËÐÅÏ¢, ¿½±´ÆäÖеÄÒ»¸öʵÀý, Ì滻ΪÄãеÄÄں˺Íramdisk:
    vi /boot/grub/menu.lst
    ±ÈÈç, ÎÒµÄmenu.lst, ÔÚÎÒÌí¼ÓеÄÄÚºËÐÅϢǰµÄÇé¿ö:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE: You have a /boot partition. This means that
    # all kernel and initrd paths are relative to /boot/, eg.
    # root (hd0,0)
    # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
    # initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Fedora Core (2.6.18-1.2798.fc6)
    root (hd0,0)
    kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00
    initrd /initrd-2.6.18-1.2798.fc6.img
    Ð޸ĺóµÄÇé¿ö:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE: You have a /boot partition. This means that
    # all kernel and initrd paths are relative to /boot/, eg.
    # root (hd0,0)
    # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
    # initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Fedora Core (2.6.18-custom-2.6.18.2)
    root (hd0,0)
    kernel /vmlinuz-2.6.18-custom-2.6.18.2 ro root=/dev/VolGroup00/LogVol00
    initrd /initrd-2.6.18-custom-2.6.18.2.img
    title Fedora Core (2.6.18-1.2798.fc6)
    root (hd0,0)
    kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00
    initrd /initrd-2.6.18-1.2798.fc6.img
    (Äã¿ÉÒÔͨ¹ýÏÂÃæÃüÁî·¢ÏÖÕýÈ·µÄvmlinuzºÍinitrdÎļþ:
    ls -l /boot
    )
    ÏÖÔÚÖØÆôϵͳ:
    shutdown -r now
    Èç¹ûÒ»Çнøչ˳Àû, ÄãµÄÐÂÄÚºËÕý³£¹¤×÷. Ä㻹¿ÉÒÔͨ¹ýÔËÐÐÏÂÃæÃüÁîÀ´¼ì²éÐÂÄÚºËÊÇ·ñÔËÐÐ:
    uname -r
    Õ⽫»áÏÔʾÈç:
    2.6.18-custom-2.6.18.2
    Èç¹ûϵͳûÓÐÆðÀ´, ÖØÆôÒ»ÏÂ, Äã»á¿´µ½:

    °´ÈÎÒâ¼ü½øÈëGRUB²Ëµ¥:

    Ñ¡ÔñÄãÒÔÇ°µÄÄÚºËÆô¶¯ÏµÍ³, ÏÖÔÚÄãÄÜÔٴγ¢ÊÔ±àÒëÐµĹ¤×÷ÄÚºË. ²»ÒªÍü¼Ç´Ó/boot/grub/menu.1stÎļþÖÐÒÆÈ¥²»ÐèÒªµÄÒýµ¼ÄÚºËÐÅÏ¢.

  5. multitude ÓÚ 2006-12-05 09:50:09·¢±í:

    2.4 Ö¸¶¨ÄÚºËʶ±ðÂë
    ÏÖÔÚÎÒÃǽ«Ö¸¶¨Ò»¸ö×Ö·û´®·½±ãÒÔºóÇø±ðÄں˰汾. Òò´ËÎÒÃÇÐèÒª×ö:
    cd ~/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.i386
    vi Makefile
    ÔÚEXTRAVERSIONÒ»ÐÐ, Äã¿ÉÒÔÊäÈëÒ»¸öÄÚºËʶ±ðÂë. ÎÒÏë×îºÃÊÇÔÚ×Ö·û´®ºó¸½ÉÏÄں˵İ汾ºÅ, ÕâÑùÀ´²Ù×÷:
    EXTRAVERSION = -custom-2.6.18.2
    2.5 ÅäÖÃÄÚºË
    ÏÖÔÚÎÒÃÇÔËÐÐ
    make menuconfig
    È»ºóÎÒÃÇ¿´µ½Äں˵ÄÅäÖò˵¥. Òƶ¯ÂÌÉ«¹â±êµ½ Load an Alternate Configuration File ÐкóÑ¡Ôñ.configÎļþ×öΪÅäÖÃÎļþ:


    È»ºóä¯ÀÀÄÚºËÅäÖò˵¥, Ñ¡ÔñÄãÐèÒªµÄ¹¦ÄÜ. Íê³ÉÅäÖúó, Ñ¡ÔñExit, »Ø´ðÏÂÃæµÄÎÊÌâ(Do you wish to save your new kernel configuration? ÄãÏ£Íû±£´æеÄÄÚºËÅäÖÃÂð?), Ñ¡ÔñYes:

    2.6 ¹¹½¨ÄÚºË
    ÏÖÔÚÎÒÃǼòµ¥ÔËÐÐÏÂÃæÃüÁîÀ´¹¹½¨ÄÚºË:
    make rpm
    È»ºóÄ㽫ÔÚ~/rpmbuild/SRPMS/Ŀ¼·¢ÏÖÒ»¸öеÄsrc.rpm°ü, ±ÈÈç. ~/rpmbuild/SRPMS/kernel-2.6.18custom2.6.18.2-1.src.rpm, ÄÚºËrpm°üλÓÚ~/rpmbuild/RPMS/i386/ (»ò ~/rpmbuild/RPMS/i586/, ~/rpmbuild/RPMS/i686/, µÈ. ¿´ÄãµÄƽ̨ÀàÐÍ). ±ÈÈç. ~/rpmbuild/RPMS/i386/kernel-2.6.18custom2.6.18.2-1.i386.rpm. Äã¿´µ½ÄÚºËʶ±ðÂëÒÑÌí¼Óµ½Èí¼þ°üµÄÃû×ÖÖÐ.