Linux Kernel Compiler

本文详细介绍了如何从源代码编译Linux内核3.0版本的过程,包括下载内核源码、配置编译选项、编译内核及模块、安装新内核并配置启动项等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

To compiler linux kernel , we can get and download full source from www.kernel.org , choose the same version kernel with your linux .

Check you own linux kernel version:

uname -r

3.0.XX..

In the commond line , can use curl to download the resource

cd ~

curl www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.56.tar.bz2 > linux3.0.tar.bz2

Then uncompress the resource file:

tar -jxvf linux3.0.tar.bz

cd linux3.0.tar.bz

Delete the *.o file use commond below

make mrproper

Then we can choose which content or module can be compiler freely:

make menuconfig

If can't use the 'make menuconfig' it need to install a library ncruses-devel

apt-get install ncruses-dev

After config the content and module which will be compilered , it's time to compiler it:

make clean

make bzImage

make modules

The 'make bzImage' and 'make modules' will spend lots of time , please pay attention and wait for a minute .

Finish compiler kernel , move file to boot directory:

cp arch/i386/boot/bzImage /boot/linux3.0-56

cp System.map /boot/System.map3.0-56

Then add grub config to grub.cfg or menu.lst file

menuentry 'Ubuntu, with Linux 3.0.0-56-generic' --class ubuntu --class gnu-l    inux --class gnu --class os {
         recordfail
         set gfxpayload=$linux_gfx_mode
         insmod gzio
         insmod part_msdos
         insmod ext2
         set root='(hd0,msdos10)'
         search --no-floppy --fs-uuid --set=root c3a2f48c-75b5-45c8-aabe-1566    a89e1cb3
         linux   /boot/linux3.0-56 root=UUID=c3a2f48c-75b5-45c8-aabe-1566a89e    1cb3 ro   quiet splash vt.handoff=7
 }

reboot the system


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值