QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: nifi

我市新手,怎样编译一个适合自己机器和应用的内核???

[复制链接]
发表于 2003-8-25 22:04:46 | 显示全部楼层
cp936等Native Language Support能否编译进内核?我觉得编译进内核好像有问题了。例如xchm、xmule等
回复

使用道具 举报

 楼主| 发表于 2003-8-25 23:13:58 | 显示全部楼层
明天下一个source再重来吧
多谢大家的帮助
回复

使用道具 举报

 楼主| 发表于 2003-8-26 08:59:20 | 显示全部楼层
一点题外话:昨天晚上看了一些LFS的东西,觉得自己水平不行,虽然心里痒痒,但还是忍住了,往后放放再说吧。我想这也是对很多新手的一点建议,不要见一个爱一个就换一个,呵呵。
不知道这个想法对不对。
回复

使用道具 举报

 楼主| 发表于 2003-8-26 09:45:00 | 显示全部楼层
一点常识性的疑问
www.kernel.org中提供的下载链接:
The latest stable version of the Linux kernel is:   2.4.22(http://www.kernel.org./pub/linux/kernel/v2.4/patch-2.4.22.bz2)
  2003-08-25 11:48 UTC  F(http://www.kernel.org./pub/linux/kernel/v2.4/linux-2.4.22.tar.bz2)
  V(http://www.kernel.org/diff/diffview.cgi?file=/pub/linux/kernel/v2.4/patch-2.4.22.bz2)
  VI(http://www.kernel.org/diff/diffview.cgi?file=/pub/linux/kernel/v2.4/testing/incr/patch-2.4.22-rc4-final.bz2)
  C(http://www.kernel.org./pub/linux/kernel/v2.4/testing/cset/)  Changelog (http://www.kernel.org./pub/linux/kernel/v2.4/ChangeLog-2.4.22)
不太清楚这些分别是代表什么?
回复

使用道具 举报

 楼主| 发表于 2003-8-26 12:30:23 | 显示全部楼层

今天(030826)的一些结果记录

今天我从www.kernel.org上下载了2.5.0的内核,tar开后放到/usr/src/linux-2.5.0下,然后参照linuxsir上的一篇文章:http://www.linuxsir.com/bbs/showthread.php?s=&threadid=977进行,但还是有问题,一些相关的信息记录如下,请指点,谢谢!
make的结果一般都只记录了后边几条,如果平时编译的时候还需要注意哪些地方,还请告知。
[root@nifi root]# gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@nifi root]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 7
model name      : Pentium III (Katmai)
stepping        : 3
cpu MHz         : 498.761
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips        : 996.14
==================
make dep:
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[2]: Leaving directory

`/usr/src/linux-2.5.0/arch/i386/lib'
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory `/usr/src/linux-2.5.0'
make: warning:  Clock skew detected.  Your build may be

incomplete.

======

make clean:
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory

`/usr/src/linux-2.5.0/Documentation/DocBook'
make: warning:  Clock skew detected.  Your build may be

incomplete.

=========

make bzImage:
drivers/char/char.o(.data+0x46f4): undefined reference to `local symbols in
discarded section

.text.exit'
drivers/net/net.o(.data+0x194): undefined reference to `local symbols in
discarded section

.text.exit'
make: *** [vmlinux] Error 1

=======

make modules:
make[1]: Entering directory `/usr/src/linux-2.5.0/arch/i386/lib'
make[1]: *** Warning: File

`/usr/src/linux-2.5.0/Rules.make' has modification
time in the future (2001-03-07 11:31:01 > 2000-08-26

11:47:03.800479)
make[1]: Nothing to be done for `modules'.
make[1]: warning:  Clock skew detected.  Your build

may be incomplete.
make[1]: Leaving directory `/usr/src/linux-2.5.0/arch/i386/lib'
make: warning:  Clock skew

detected.  Your build may be incomplete.

========

make modules_install:
find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r

System.map ]; then /sbin/depmod -ae -F System.map  2.5.0; fi
make: warning:  Clock skew detected.  Your build

may be incomplete.

========

make distclean:
[root@nifi linux-2.5.0]# make distclean
make: *** Warning: File `Rules.make' has modification

time in the future
(2001-03-07 11:31:01 > 2000-08-26 12:11:11.686607)
make[1]: Entering directory

`/usr/src/linux-2.5.0/arch/i386/boot'
make[1]: *** Warning: File `Makefile' has modification time in the

future
(2001-08-06 04:13:19 > 2000-08-26 12:11:11.703259)
rm -f tools/build
rm -f setup bootsect zImage

compressed/vmlinux.out
rm -f bsetup bbootsect bzImage compressed/bvmlinux.out
make[2]: Entering directory

`/usr/src/linux-2.5.0/arch/i386/boot/compressed'
make[2]: *** Warning: File `Makefile' has modification time in

the future
(2001-09-12 14:08:12 > 2000-08-26 12:11:12.053524)
rm -f vmlinux bvmlinux _tmp_*
make[2]: warning:  

Clock skew detected.  Your build may be incomplete.
make[2]: Leaving directory

`/usr/src/linux-2.5.0/arch/i386/boot/compressed'
make[1]: warning:  Clock skew detected.  Your build may be

incomplete.
make[1]: Leaving directory `/usr/src/linux-2.5.0/arch/i386/boot'
find . \( -name '*.[oas]' -o -name

core -o -name '.*.flags' \) -type f -print
\
| grep -v lxdialog/ | xargs rm -f
rm -f kernel/ksyms.lst

include/linux/compile.h vmlinux System.map .tmp*
drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c
drivers/char/conmakehash drivers/char/drm/*-mod.c drivers/pci/devlist.h
drivers/pci/classlist.h

drivers/pci/gen-devlist drivers/zorro/devlist.h
drivers/zorro/gen-devlist drivers/sound/bin2hex

drivers/sound/hex2hex
drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2}
drivers/scsi/aic7xxx/aicasm/aicasm_gram.c
drivers/scsi/aic7xxx/aicasm/aicasm_scan.c

drivers/scsi/aic7xxx/aicasm/y.tab.h
drivers/scsi/aic7xxx/aicasm/aicasm drivers/scsi/53c700-mem.c
net/khttpd/make_times_h net/khttpd/times.h
submenu*
rm -rf modules
make -C Documentation/DocBook clean
make[1]:

Entering directory `/usr/src/linux-2.5.0/Documentation/DocBook'
make[1]: *** Warning: File

`/usr/src/linux-2.5.0/Rules.make' has modification
time in the future (2001-03-07 11:31:01 > 2000-08-26

12:11:19.442337)
rm -f core *~
rm -f wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml kernel-api.sgml
parportbook.sgml kernel-hacking.sgml kernel-locking.sgml via-audio.sgml
mousedrivers.sgml sis900.sgml

deviceiobook.sgml procfs-guide.sgml
tulip-user.sgml
rm -f  wanbook.dvi  z8530book.dvi  mcabook.dvi  

videobook.dvi  kernel-api.dvi
parportbook.dvi  kernel-hacking.dvi  kernel-locking.dvi  via-audio.dvi
mousedrivers.dvi  sis900.dvi  deviceiobook.dvi  procfs-guide.dvi
tulip-user.dvi  wanbook.aux  z8530book.aux  

mcabook.aux  videobook.aux
kernel-api.aux  parportbook.aux  kernel-hacking.aux  kernel-locking.aux
via-audio.aux

mousedrivers.aux  sis900.aux  deviceiobook.aux
procfs-guide.aux  tulip-user.aux  wanbook.tex  z8530book.tex  

mcabook.tex
videobook.tex  kernel-api.tex  parportbook.tex  kernel-hacking.tex
kernel-locking.tex  via-audio.tex

mousedrivers.tex  sis900.tex
deviceiobook.tex  procfs-guide.tex  tulip-user.tex  wanbook.log  z8530book.log
mcabook.log  videobook.log  kernel-api.log  parportbook.log
kernel-hacking.log  kernel-locking.log  

via-audio.log  mousedrivers.log
sis900.log  deviceiobook.log  procfs-guide.log  tulip-user.log  wanbook.out
z8530book.out  mcabook.out  videobook.out  kernel-api.out  parportbook.out
kernel-hacking.out  

kernel-locking.out
via-audio.out  mousedrivers.out  sis900.out  deviceiobook.out
procfs-guide.out


tulip-user.out
rm -f  parport-share.png  parport-multi.png  parport-structure.png
parport-share.eps  

parport-multi.eps  parport-structure.eps
rm -f procfs_example.sgml
make[1]: warning:  Clock skew detected.  Your

build may be incomplete.
make[1]: Leaving directory `/usr/src/linux-2.5.0/Documentation/DocBook'
find . \( -size

0 -o -name .depend \) -type f -print | xargs rm -f
rm -f include/linux/autoconf.h include/linux/version.h
drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h
drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h
drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h
drivers/net/hamradio/soundmodem/gentbl

drivers/sound/*_boot.h
drivers/sound/.*.boot drivers/sound/msndinit.c drivers/sound/msndperm.c
drivers/sound/pndsperm.c drivers/sound/pndspini.c drivers/atm/fore200e_*_fw.c
drivers/atm/.fore200e_*.fw

.version .config* config.in config.old
scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp

scripts/lxdialog/*.o
scripts/lxdialog/lxdialog .menuconfig.log include/asm .hdepend scripts/mkdep
scripts/split-include scripts/docproc
/usr/src/linux-2.5.0/include/linux/modversions.h kernel.spec
rm -rf

include/config /usr/src/linux-2.5.0/include/linux/modules
make -C Documentation/DocBook mrproper
make[1]:

Entering directory `/usr/src/linux-2.5.0/Documentation/DocBook'
make[1]: *** Warning: File

`/usr/src/linux-2.5.0/Rules.make' has modification
time in the future (2001-03-07 11:31:01 > 2000-08-26

12:11:21.402515)
rm -f core *~
rm -f wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml kernel-api.sgml
parportbook.sgml kernel-hacking.sgml kernel-locking.sgml via-audio.sgml
mousedrivers.sgml sis900.sgml

deviceiobook.sgml procfs-guide.sgml
tulip-user.sgml
rm -f  wanbook.dvi  z8530book.dvi  mcabook.dvi  

videobook.dvi  kernel-api.dvi
parportbook.dvi  kernel-hacking.dvi  kernel-locking.dvi  via-audio.dvi
mousedrivers.dvi  sis900.dvi  deviceiobook.dvi  procfs-guide.dvi
tulip-user.dvi  wanbook.aux  z8530book.aux  

mcabook.aux  videobook.aux
kernel-api.aux  parportbook.aux  kernel-hacking.aux  kernel-locking.aux
via-audio.aux

mousedrivers.aux  sis900.aux  deviceiobook.aux
procfs-guide.aux  tulip-user.aux  wanbook.tex  z8530book.tex  

mcabook.tex
videobook.tex  kernel-api.tex  parportbook.tex  kernel-hacking.tex
kernel-locking.tex  via-audio.tex

mousedrivers.tex  sis900.tex
deviceiobook.tex  procfs-guide.tex  tulip-user.tex  wanbook.log  z8530book.log
mcabook.log  videobook.log  kernel-api.log  parportbook.log
kernel-hacking.log  kernel-locking.log  

via-audio.log  mousedrivers.log
sis900.log  deviceiobook.log  procfs-guide.log  tulip-user.log  wanbook.out
z8530book.out  mcabook.out  videobook.out  kernel-api.out  parportbook.out
kernel-hacking.out  

kernel-locking.out
via-audio.out  mousedrivers.out  sis900.out  deviceiobook.out
procfs-guide.out


tulip-user.out
rm -f  parport-share.png  parport-multi.png  parport-structure.png
parport-share.eps  

parport-multi.eps  parport-structure.eps
rm -f procfs_example.sgml
rm -f  wanbook.ps  z8530book.ps  mcabook.ps  

videobook.ps  kernel-api.ps
parportbook.ps  kernel-hacking.ps  kernel-locking.ps  via-audio.ps
mousedrivers.ps  

sis900.ps  deviceiobook.ps  procfs-guide.ps  tulip-user.ps
wanbook.pdf  z8530book.pdf  mcabook.pdf  

videobook.pdf  kernel-api.pdf
parportbook.pdf  kernel-hacking.pdf  kernel-locking.pdf  via-audio.pdf
mousedrivers.pdf  sis900.pdf  deviceiobook.pdf  procfs-guide.pdf
tulip-user.pdf
rm -f -r  wanbook  z8530book  

mcabook  videobook  kernel-api  parportbook
kernel-hacking  kernel-locking  via-audio  mousedrivers  sis900  

deviceiobook
procfs-guide  tulip-user
rm -f .depend
rm -f /usr/src/linux-2.5.0/scripts/mkdep-docbook
rm -rf

DBTOHTML_OUTPUT*
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving

directory `/usr/src/linux-2.5.0/Documentation/DocBook'
rm -f core `find . \( -not -type d \) -and \
        \(

-name '*.orig' -o -name '*.rej' -o -name '*~' \
        -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
   

    -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS
tags
make: warning:  Clock skew

detected.  Your build may be incomplete.
回复

使用道具 举报

 楼主| 发表于 2003-8-26 16:48:07 | 显示全部楼层
不好意思,上边的那一大陀是这个意思:前两个是我的系统信息,GCC和CPU,不重要。
后边的各段消息用“=======”隔开,其实也就是编译内核从MAKE BZIMAGE开始各个命令之后出现的一些提示,我主要挑了最后几行报告错误的的贴上来了。
急啊,希望大侠们帮我一把!!!
回复

使用道具 举报

 楼主| 发表于 2003-8-26 18:35:24 | 显示全部楼层
这个可是新下载的2.5.0的源码包啊,什么补丁都没打
两次编译的时候都提示说Clock skew detected,郁闷ing
一般来说如果没有error提示就基本上可以了,warning应该是可以忽略的吧?
还有,我是用GRUB引导的,很多介绍的资料上对这个说明都不是很详细,尤其是最后对于镜像文件(好像是这个,记不清了),initrd那个东西怎么处理都说得不明白,甚至很多地方都说法不一,不知道到底该怎么做。
回复

使用道具 举报

发表于 2003-8-26 22:42:00 | 显示全部楼层
do not use 2.5.0. use 2.4.22

can u run command date and post the output here?

yes, warning can be ignored.


man mkinitrd, and read document under kernel source code to know what is initrd. or u can search this forum. i post it several times already.
回复

使用道具 举报

 楼主| 发表于 2003-8-27 08:47:14 | 显示全部楼层
昨天在起动linux的时候终于发现问题了,在启动sendmail的时候提示"clock skew",说系统时间不对,以前没注意过,这才想起来前阶段因为冲击波病毒的影响,我在win2000下把系统时间改到2000年了,现在改回来以后已经没这个问题了.以后大家出现这个提示也考虑一下这个原因了,呵呵.
我不知道2.5.0有什么问题,编译完成后找不到System.map和bzImage,难道就是因为2.5.0的原因?
还有,在编译的时候我发现有很多提示说在/usr/include下的asv,linux.scsi中找不到部分文件和文件夹,不知道对编译结果有没有影响.
下边是在执行make bzImage的时候记录的一部分,帮忙看看是什么问题:
{standard input}: Assembler messages:
{standard input}:1014: Warning: indirect lcall without `*'
{standard input}:1092: Warning: indirect lcall without `*'
{standard input}:1175: Warning: indirect lcall without `*'
{standard input}:1256: Warning: indirect lcall without `*'
{standard input}:1271: Warning: indirect lcall without `*'
{standard input}:1281: Warning: indirect lcall without `*'
{standard input}:1348: Warning: indirect lcall without `*'
{standard input}:1363: Warning: indirect lcall without `*'
{standard input}:1374: Warning: indirect lcall without `*'
{standard input}:1832: Warning: indirect lcall without `*'
{standard input}:1910: Warning: indirect lcall without `*'
......
......
drivers/char/char.o(.data+0x46f4): undefined reference to `local symbols in discarded section .text.exit'
drivers/net/net.o(.data+0xd4): undefined reference to `local symbols in discarded section .text.exit'
make: *** [vmlinux] Error 1
============================================

i will try 2.4.22

thanks       
回复

使用道具 举报

 楼主| 发表于 2003-8-27 10:54:53 | 显示全部楼层
关于内核版本的一点疑问:是不是例如2.4.0或者2.5.0的就表示稳定版本,其他的*.*.**是测试版本?更高的版本难道不是支持的功能更多,更稳定吗?
回复

使用道具 举报

 楼主| 发表于 2003-8-27 14:34:42 | 显示全部楼层
就差一步了,我用了2.4.22的内核,整个编译过程很顺利,但是用GRUB引导启动的时候出了点问题,刚开始就停住了,提示如下:
......
VFS:Cannot open root device "LABEL=/" or 00:00
Please oppend a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00
然后就没反应了,我估计是GRUB的错误,下边是我的menu.lst的内容:
default=1
timeout=10
splashimage=(hd0,6)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-
        root (hd0,6)
        kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /boot/initrd-2.4.20-8.img

title Win2k
        rootnoverify (hd0,0)
        chainloader +1

title RH_test
        root (hd0,6)
        kernel /boot/kernel_test/vmlinuz-2.4.22 ro root=LABEL=/
#        initrd /boot/kernel_test/initrd-2.4.20-8.img


title RH_bak
        root (hd0,6)
        kernel /boot/kernel_bak/vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /boot/kernel_bak/initrd-2.4.20-8.img
看来我还得再查查initrd的资料?
回复

使用道具 举报

发表于 2003-8-27 21:42:44 | 显示全部楼层
if u do not have initrd.img file, u can not use root=LABEL=/, u have to use root=/dev/hdxy


find which is u root partition, use the hdxy
or generate a initrd file.
回复

使用道具 举报

发表于 2003-8-28 13:43:39 | 显示全部楼层
[quote:43ac2b3e36="gxl117"]使用make bzImage来产生内核,zImage只适用于小内核。
不一定是Y越少就小,要根据自己的需要来设置。我的全是Y,基本不用模块,当然我会留kmod。 [/quote]
cp936等Native Language Support能否编译进内核?我觉得编译进内核好像有问题了。例如xchm、xmule等

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

发表于 2003-8-28 20:22:06 | 显示全部楼层
这两个的确不支持中文。linux对中文的支持……,失望 :-(
回复

使用道具 举报

发表于 2003-8-28 22:03:09 | 显示全部楼层
have to wait a while to support unicode later. the problem is that linux is developed for fun. so performance is more important  than other features.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-18 15:17 , Processed in 0.090949 second(s), 13 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表