linux 内核配置与编译
1,清楚临时文件 中间文件 配置文件
make clean
:::::::::::remove most generated files but keep the config
make mrproper
:::::::::::remove all generated files +config files
make distclean
:::::::::::mrproper+remove editor backup and patch files
2, 确定系统软硬件配置情况 如CPU类型,网卡型号等
3, make config 命令配置内核
逐一询问配置是否需要: 文本交互式 效率低下一般不采用
make menuconfig 菜单式配置内核
基于菜单式
make oldconfig 基于文本交互式, 但不会逐一询问, 只询问新的配置选项
make xconfig 图形化配置
推荐使用 make menuconfig
默认配置文件目录
cd arc/arm/config
有很多参考的配置文件
拷贝到根目录的config下, make menuconfig 打开配置就可以看到刚刚拷贝出来的参考配置;
4. 编译内核
:::: make bzImage
eg:
~~~~~ @cp /boot/config -2.36###### ./. config //拷贝当前内核到配置文件
~~~~~ @make menuconfig 保存配置
~~~~~ @make bzImage 编译内核
5, 编译内核模块 配置选择M 的项
make moduels
6, make modules_install
拷贝编译好的配置文件到lib/modules/下
7, 制作initrd ramdisk
mkinitrd initrd-2.6.29 2.6.29 //2.6.29版本号 该文件在lib/modules/下
产生initrd-2.6.29文件
内核安装
编译好的内核在 arch/x86/boot/下 ### x86是开始时选择拷贝的参考备份配置文件
1, cp arch/x96/boot/bzImage /boot/vmlinuz-$version 拷贝出来重新命名版本
2, cp $initrd-2.6.29 /boot/ 拷贝initrd到boot目录下
3, 修改/etc/grub.conf 该文件时linux启动时显示的选择菜单,可进入新的或者旧的内核系统
@vi /etc/grub.conf
....
....
title Red Hat Enterprise.........
root
kernel /vmlinuz -2.6.18....
...
拷贝以上信息
@4yy
修改title 为 My-linux
目录修改为 kernel /bzImage-2.6.29 //自己修改的内核配置文件
重新启动
会有自定义的linux内核显示在选择框中
完成