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

FC5(Fedora Core5)ϱàÒëÄÚºË×ܽá

·¢²¼Ê±¼ä:2006-07-20 17:12:38À´Ô´:ºìÁª×÷Õß:hfh08
ͻ񻣼

×î½üÒò¹¤×÷ÐèÒª£¬ÐèÒª¶ÔlinuxÄں˽øÐÐÖرàÒ룬·¢ÏÖÁËһЩÒÔǰûÓÐÓöµ½¹ýµÄ ÎÊÌ⣬Щ³öÀ´ÓÚ ´ó¼ÒÒ»Æð·ÖÏí¡£
²âÊÔ»·¾³¼°Ä¿±ê£º
FC5(Fedora Core5)
¶ÔFC5(Fedora Core5) kernel¼°linux kernel 2.4.20¼´RedHat9½øÐбàÒ룬À´²âÊÔframebufferµÄһЩ¹¦ÄÜ¡£

ÐòÑÔ

¼ÇµÃÒÔÇ°°²×°inux kernel 2.4.20¼´RedHat9Íê±Ïºó£¬¾Í¿ÉÒÔÔÚ/usr/srcĿ¼ÀïÕÒµ½Äں˵ÄÔ´Â룬µ«ÊÇ£¬×î½ü²Å·¢ÏÖÎÒµÄFC5(Fedora Core5)ÏàӦĿ¼Ï¾¹È»Ã»ÓÐÕÒµ½Ô´Â룬¿ÉÄÜÊÇ°²×°Å̵ÄÎÊÌâ»òÕßÊÇ°²×°Ê±Íü¼ÇÁËʲôѡÏ¹í²ÅÖªµÀ£¬·´ÕýÊÇÎÒ ÏÖÔÚûÓÐkernelµÄÔ´Âë¡£

Ô´ÂëÏÂÔØ

´ÓÍøÉÏÏÂÔØÐèÒª±àÒëµÄÄںˣ¬ÍƼöÈçÏÂÁ¬½Ó
ftp://ftp.kernel.org/pub/linux/kernel
ÀïÃæËùÓа汾µÄ Äں˶¼ÓУ¬¾¡ÇéÏ°ѣº£©

±àÒë¹ý³Ì

ΪÁË´ó¼ÒÃ÷°×ÎÒµÄÿһ²½Ö裬ÎҰѱàÒë¹ý³ÌÏêϸµÄÃèÊöÈçÏ£º
¿ªÊ¼ÎÒÏë¶Ôlinux kernel 2.4.20ÄÚºËÏȱàÒ룬ÒòΪ±Ï¾¹linux kernel 2.4.20ÄÚºËÏà¶ÔÀ´Ëµ±È½ÏС£¬½á¹ûÈ´ÒýÀ´À´ºÜ¶àÎÊÌ⣬¾ßÌåÈçÏÂ

$ make rmproper
$make menuconfig
$make dep

ÉÏÃæÕâЩ²½Ö趼ÄÜ˳Àûͨ¹ý
$make bzImage
Ò»»á¾Í³öÏÖÁËÈçÏ嵀 ´íÎó

/usr/linux-2.4.20/include/linux/smp.h:29: error: conflicting types for 'smp_send_reschedule'
/usr/linux-2.4.20/include/asm/smp.h:42: error: previous declaration of 'smp_send_reschedule' was here
In file included from /usr/linux-2.4.20/include/linux/unistd.h:9,
from init/main.c:17:
/usr/linux-2.4.20/include/asm/unistd.h:375: warning: conflicting types for built-in function '_exit'
make: *** [init/main.o] Error 1

µ½ÍøÉϲéÁ˲飬·¢ÏÖÊÇFC5ϵÄGCC°æ±¾Ì«Ð£¨gcc4.1£©£¬ÎÞ·¨±àÒëlinux-2.4.20£¿£¿£¿£¿£¿£¿£¿£¿£¿
ÔÚÒ»¸ö¹úÍâÍøÕ¾ÉÏÒ²·¢ÏÖÁËÀàËÆµÄ ÎÊÌ⣬ËûÃǵĽ¨ÒéÊÇʹÓà gcc 2.95»òÕßgcc3.2½øÐбàÒ루Dave Thompson£©£¬ÐÄÏëÄѵÀÒªÒª°ÑgccµÄ °æ±¾½µÏÂÈ¥²»³É£¿
ÔÚÍøÉÏÑ°ÕÒÁËÒ»»á£¬·¢ÏÖÆäʵFC5Ï¿ÉÒÔ°²×°Ò»¸öpachage£¬¾Í¿ÉÒÔʹÓÃgcc3.2£¬Í¬Ê±²»»áÓ°Ï쵱ǰµÄgcc4.1¡£ÓÚÊǾÍÔÚftp://rpmfind.net/linux/fedora/core/5/i386/os/Fedora/RPMS/compat-gcc-32-3.2.3-55.fc5.i386.rpmÀïÏÂÔØÁËÒ»¸ö£¬¸Ã°üµÄ´óÖÂÃèÊöΪ£ºThe compatibility GNU Compiler Collection Fedora Core 5 for i386£¬ÂíÉϽøÐа²×°

$rpm -ivh compat-gcc-32-3.2.3-55.fc5.i386.rpm
Preparing... ########################################### [100%]
package compat-gcc-32-3.2.3-55.fc5 is already installed

¿´µ½ÁË°Ñ£¬FC5¾¹È»Ä¬ÈÏÒѾ­°²×°ÉϸðüÁË¡«¡«¡«¡«¡«¡«¡«¡«¡«¡«
ÓÚÊÇÂíÉÏÐÞ¸ÄMakefile£¬°ÑÀïÃæµÄCCÐÞ¸ÄΪ GCC3.2

$make mrprop*;make clean
$make dep
$make bzImage

¾­¹ýÂþ³¤µÄµÈ´ý£¨²»³¤£¬Ò²¾Í15·ÖÖÓ×óÓÒ£©£¬½á¹ûµÈÀ´µÄÈ´ÊÇ£º

{standard input}: Assembler messages:
{standard input}:936: Error: suffix or operands invalid for `mov'
{standard input}:937: Error: suffix or operands invalid for `mov'
{standard input}:1031: Error: suffix or operands invalid for `mov'
{standard input}:1032: Error: suffix or operands invalid for `mov'
{standard input}:1083: Error: suffix or operands invalid for `mov'
{standard input}:1084: Error: suffix or operands invalid for `mov'
{standard input}:1086: Error: suffix or operands invalid for `mov'
{standard input}:1098: Error: suffix or operands invalid for `mov'

û°ì·¨ £¬°Ñ ´íÎóÐÅÏ¢ÊäÈëµ½googleÀïÃ棬·¢ÏֺܶàÈ˶¼Óöµ½¹ýÀàËƵÄÂé·³¡£×îºóµÄ ½áÂÛ£ºÊÇFC5ϵÄbinutilsµÄÒ»¸öbug£¬ÓÚÊÇÁËÏàÓ¦µÄ²¹¶¡http://www.kernel.org/pub/linux/devel/binutils/linux-2.6-seg-5.patch£¬ÔÚ´ý±àÒëµÄÄÚºËÔ´Â루±¾ÀýΪlinux-2.4.20/£©µÄ¸ùĿ¼Ï½øÐÐpatch²Ù×÷£º

$patch -p0
»òÕß

$patch -p1
ÏêϸÇë²éÔÄpatchµÄÓ÷¨¡£
£¯£ª
patchµÄÓ÷¨¼ò½é

¸ñʽ

patch -pnumber
²ÎÊýpµÄº¬Òå

ÈÝÒױ仯µÄ²¿·ÖÊÇ¡®-p¡¯²ÎÊýºóÃæµÄ¡®number¡¯£¬¶¨ÒåÁ˲¹¶¡Ó¦ÓÃÓÚºÎÖÖÀ©Õ¹·½Ê½µÄ·¾¶£º
¡®-p0¡¯ÊÇÓ¦Óò¹¶¡ÎļþÖиø³öµÄȫ·¾¶£¬¡®-p1¡¯ÔòɾµôµÚÒ»¸öб¸Ü£¨slash£º/£©£¬ÒÀ´ËÀàÍÆ¡£
ûÓÐÖ¸¶¨µÄ¡®-p¡¯½«³ýȥȫ²¿Â·¾¶£¬Èç¹ûÕâ¸ö²¹¶¡Ö»ÊÇÓ¦ÓÃÓÚͬһ¸öĿ¼ÏµÄÎļþ£¬ÕâÑù×ö¾ÍºÜºÃ¡£
ͨ³£µÄ×ö·¨ÊÇ£¬½«²¹¶¡Îļþ·ÅÔÚÔ´´úÂëµÄÉÏÒ»¼¶Ä¿Â¼£¬È»ºóÔËÐÐ
patch -p1 £ª£¯

patchÍêÖ®ºó£¬ÔÙÒ»´ÎÖØбàÒ룬µ±
$make bzImage
ºó£¬Ò»ÇÐÕý³£
$make modules
$make modules_install
ºó£¬¾¹È»»¹³öÏÖÁËÈçϵÄÐÅÏ¢

cd /lib/modules/2.4.20; \
mkdir -p pcmcia; \
find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.4.20; fi
Version requires old depmod, but couldn't run /sbin/depmod.old: No such file or directory

×öÁËÈçÏ´ëÊ©

$ln -s /sbin/depmod /sbin/depmod.old
$make modules_install
$mkinitrd -f -v /boot/initrd-2.4.20.img 2.4.20

Ò»ÇÐÕý³£

ÐÞ¸ÄÏàÓ¦µÄlino»òÕß grub£¬ÖØÐÂÆô¶¯¡£

ÔÚ±àÒëʱ£¬·¢ÏÖÈç¹û±àÒëFC5 kernel£¬ËüµÄgrub»á×Ô¶¯±»Ð޸ģ¬²»ÐèÒªÊÖ¶¯Ð޸ġ£

±àÒëC5 kernelºÍkernel 2.4.20£¬ËûÃǵıàÒë¹ý³Ì¿ÉÄÜÓеãÉÔ΢²»Í¬£¬¾ßÌåµÄ²½Öè¼û¸÷¸ùĿ¼ÏµÄREADERMEÎļþ£¬ÀïÃæ˵µÄºÜÏêϸ¡£

¹ØÓÚ×÷Õߣº

Äô·É£¨afreez£©±±¾©¡£Öйشå
ÁªÏµ·½Ê½£ºafreez@sina.com
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ