MAXidea 发表于 2006-05-10 16:51

编译Redhat Enterprise ES4 内核出错,请教如何解决?

请教各位DX,我在一台DELL SC1420安装了Redhat Enterprise ES4(Kernel -2.6.9-5.EL),并需要编译内核使它支持AppleTalk通信协议,遇到出错(我使用的是AS3上用过的内核编译方法,在AS3上可行,AS3的内核是kernel-2.4.21-27.EL),请问是不是2.6内核的编译方法已经有变更了?

以下是我的操作方法,红色是出错信息,无法进行bzImage,望请指正!百谢!

# cd /usr/src/kernels
# cp -rp 2.6.9-5.EL-smp-x86_64 2.6.9-5.EL-smp-x86_64-appletalk_2
# cd 2.6.9-5.EL-smp-x86_64-appletalk_2/
# make mrproper
CLEAN   init
CLEAN   include/asm-x86_64/offset.h
scripts/Makefile.clean:10: Documentation/DocBook/Makefile: No such file or directory
make: *** No rule to make target `Documentation/DocBook/Makefile'.Stop.
make: *** Error 2
# cp /boot/config-2.6.9-5.ELsmp ./.config
# make menuconfig

Device Drivers--->
Networking support--->
[*] Networking support
Networking options--->
<M> Appletalk protocol support
Save Configuration to an Alternate File

# make dep
*** Warning: make dep is unnecessary now.
# make clean
# make bzImage
CHK   include/linux/version.h
SPLIT   include/linux/autoconf.h -> include/config/*
CHK   include/asm-x86_64/offset.h
/bin/sh: arch/x86_64/kernel/asm-offsets.s: No such file or directory
UPD   include/asm-x86_64/offset.h
mv: cannot stat `include/asm-x86_64/offset.h.tmp': No such file or directory
make: *** Error 1

MAXidea 发表于 2006-05-10 18:34

补充,我也试过不做make mrproper,make menuconfig后也不做make clean,结果如下:

# cd /usr/src/kernels
# cp -rp 2.6.9-5.EL-smp-x86_64 2.6.9-5.EL-smp-x86_64-appletalk_3
# cd 2.6.9-5.EL-smp-x86_64-appletalk_3/
# cp /boot/config-2.6.9-5.ELsmp ./.config
# make menuconfig
Device Drivers--->
Networking support--->
[*] Networking support
Networking options--->
<M> Appletalk protocol support
Save Configuration to an Alternate File

# make
CHK   include/linux/version.h
SPLIT   include/linux/autoconf.h -> include/config/*
CHK   include/asm-x86_64/offset.h
HOSTCCscripts/genksyms/genksyms.o
HOSTCCscripts/genksyms/lex.o
HOSTCCscripts/genksyms/parse.o
HOSTLDscripts/genksyms/genksyms
CC      scripts/mod/empty.o
MKELF   scripts/mod/elfconfig.h
HOSTCCscripts/mod/file2alias.o
HOSTCCscripts/mod/modpost.o
HOSTCCscripts/mod/sumversion.o
HOSTLDscripts/mod/modpost
make: *** No rule to make target `init/main.o', needed by `init/built-in.o'.Stop.
make: *** Error 2

此问题我在网上找不到可行的解决方法,希望各位赐教!

MAXidea 发表于 2006-05-10 19:32

幸好看到tgy0234的贴,BS Redhat不提供sourcecode

#rpm -ivh kernel-2.6.9-5.EL.src.rpm
#cd /usr/src/redhat/SPECS
#vi kernel-2.6.spec
define buildsource 0 ->1
#touch /etc/beehive-root
#rpmbuild -ba --target=x86_64 ./kernel-2.6.spec
#cd /usr/src/redhat/RPMS/x86_64
#rpm -ivh kernel-sourcecode-2.6.9-5.EL.x86_64.rpm

MAXidea 发表于 2006-05-11 09:26

十分不满意Redhat的客户服务,我send email给redhat的亚太区客户服务中心,得到的回复是由于我的Redhat ES4是从DELL购买的,技术服务需要找DELL而不是他们,TNND,一下子觉得Redhat比Microsoft还黑!

MAXidea 发表于 2006-05-11 09:29

转贴这份MAIL,表达不满:


Hello,

Thank you for contacting Red Hat Customer Service.

Our records indicate you purchased your subscription through a Red Hat vendor, and they are your primary contact for support issues. Please contact the technical support department through your hardware vendor for assistance with your technical support issue.

We appreciate your business and support of our Red Hat products, please let us know if we can be of further assistance.

Best Regards,

++
Kenji Nanamiya
Customer Service, Red Hat Asia-Pacific
Japan: 03-6406-9900 option 14, option 5
Australia/New Zealand:1 800 RED HAT option 4
OTHERS: +61 7 3514 8100 option 4

MAXidea 发表于 2006-05-11 10:58

补充一下最后的Kernel编译步骤:

#cd /usr/src/
#cd linux-2.6.9-5.EL-smp-x86_64-AppleTalk/
#make mrproper
#cp /boot/config-2.6.9-5.ELsmp ./.config
#make menuconfig

<M> Appletalk protocol support
[*]   Appletalk interfaces support                                             
<M>   Appletalk-IP driver support                                                      
[*]       IP to Appletalk-IP Encapsulation support                                       
[*]       Appletalk-IP to IP Decapsulation support

#make clean
#make bzImage
#cp ./arch/x86_64/boot/bzImage /boot/vmlinuz-2.6.9-5.ELsmp-x86_64-AppleTalk
#cp ./vmlinux /boot/vmlinux-2.6.9-5.ELsmp-x86_64-AppleTalk
#make modules
#make modules_install (Got /lib/modules/2.6.9-5.ELcustom/)
#/sbin/mkinitrd /boot/initrd-2.6.9-5.ELsmp-x86_64-AppleTalk.img 2.6.9-5.ELcustom
#cp ./System.map /boot/System.map-2.6.9-5.ELsmp-x86_64-AppleTalk
#cd /boot/grub
#cp -p grub.conf grub.conf.old
#vi grub.conf
title Red Hat Enterprise Linux ES (2.6.9-5.ELsmp-x86_64-AppleTalk)
      root (hd0,0)
      kernel /vmlinuz-2.6.9-5.ELsmp-x86_64-AppleTalk ro root=LABEL=/ rhgb quiet
      initrd /initrd-2.6.9-5.ELsmp-x86_64-AppleTalk.img
#reboot -n

zhyesno 发表于 2006-05-12 09:59

是啊,RHEL4光盘上的内核包不完整。
需要自己下载源码编译。
麻烦。。。

yidou 发表于 2006-05-12 10:43

非常不满意RH, 还是喜欢用suse

wyx_7251430 发表于 2016-05-02 19:54

本帖最后由 wyx_7251430 于 2016-05-02 19:55 编辑

回复 3# MAXidea
你好,我用make menuconfig动了内核配置,编译报错make: *** No rule to make target `init/main.o', needed by `init/built-in.o'.Stop.
make: *** Error 2
我没怎么看明白你是怎么解决的?我的系统是ubuntu14.04




   

nswcfd 发表于 2016-05-06 17:45

本帖最后由 nswcfd 于 2016-05-06 17:55 编辑

回复 3# MAXidea


有一点不太明白, src.rpm里面应该有源代码吧?

要不然后面的sourcecode.rpm是怎么生成的,除非在rpmbuild的过程中从网上下载源代码。
页: [1]
查看完整版本: 编译Redhat Enterprise ES4 内核出错,请教如何解决?