2009-11-1021:08:07 标签:内核编译[推送到技术圈] 内核编译模式:built-in,将相应功能编译到内核中;module,将相应功能编译成模块,,动态调用为什么要编译内核:主要是定制内核,根据需要将相应的功能加到内核中; 主要任务1).获得内核源文件:).配置内核():makeconfig|menuconfig|xconfig|oldconfig3).备份相关文件4)建立内核,相关命令:#建立依赖关系表;#删除安装过程中产生的大量临时文件;(可选)#建立内核,通常在/usr/src/arch/i386/boot目录下;#编译内核模块;(可选)-#(把内核模块存放到相应的位置)(可选)5).安装内核cp/usr/src/arch/i386/bzImage/boot/vmlinuz-/boot/,6).编辑/boot/grub/; 步骤: -a (linux-)及补丁(patch-)/usr/srcbzip2-dclinux-|tarvxf-#解包bzip2-dcpatch-|patch-p1 #解包,给内核源代码打补丁(未执行成功)(或使用patch命令给内核源码打补丁patch-p0original<patchname) ./linux- ?#建立依赖关系表; makecleanormakemrpropper##建立内核,通常在/usr/src/arch/i386/boot目录下; makemodules#编译内核模块;(可选) -# makemoduleinstall(把内核模块存放到相应的位置)(可选) make[1]:***Noruletomaketarget`|',neededby`firmware/keyspan/'. :***[firmware]Error2 -/boot/ /boot/grub/ :Cleaningtargets: clean -Removemostgeneratedfilesbutkeeptheconfigand enoughbuildsupporttobuildexternalmodules mrproper -Removeallgeneratedfiles+config+variousbackupfiles distclean -mrproper+removeeditorbackupandpatchfilesConfigurationtargets: config -Updatecurrentconfigutilisingaline-orientedprogram menuconfig -Updatecurrentconfigutilisingamenubasedprogram xconfig -UpdatecurrentconfigutilisingaQTbasedfront-end gconfig -UpdatecurrentconfigutilisingaGTKbasedfront-end oldconfig - silentoldconfig-Sameasoldconfig,butquietly,additionallyupdatedeps randconfig -Newconfigwithrandomanswertoallopti
linux 内核编译学习 来自淘豆网m.daumloan.com转载请标明出处.