设为首页 加入收藏

TOP

Kernel compilation
2014-11-23 22:55:02 来源: 作者: 【 】 浏览:11
Tags:Kernel compilation

Code:
sudo apt-get install linux-treeIn this case we'll use the latest stable vanilla kernel version available.
For the compile process you'll need the following packages on Ubuntu:


Code:
sudo apt-get updatesudo apt-get install build-essentialsudo apt-get install kernel-packagesudo apt-get install gccsudo apt-get install libncurses5sudo apt-get install libncurses5-devsudo apt-get install libqt3-mt-devNow untar the package:


Code:
cd /usr/srcsudo tar --bzip2 -xvf linux-2.6.12.tar.bz2Create the following symlink:


Code:
sudo ln -s /usr/src/linux-2.6.12 /usr/src/linuxcd /usr/src/linuxNow you can start customizing your kernel configuration; there two way, the first one is graphical, the second one pseudo-graphical:


Code:
sudo make xconfigOr:


Code:
sudo make menuconfigThen, after having finished the customization, we have to start the compile process:


Code:
sudo make-kpkg cleansudo make-kpkg --append-to-version=-custom kernel_image modules_imageThe revision flag is optional and is just useful to edit the kernel name showed through uname -r. You can write whatever you want instead of "-custom".


There's also another interesting and useful flag, that is --initrd. The vanilla kernel is not enable yet to make use of initrd properly, and in fact there's a patch for this. The Ubuntu official kernel is a vanilla kernel patched with some patches among which there's the one for initrd. So, if you are compiling a vanilla kernel, you should take --initrd out; otherwise, if you are compiling a Ubuntu kernel, you can make use of initrd and you probably would that.


Note that now you'll have a .deb package in /usr/src ready to be installed as any other package through a simple double-click.
Grub will be updated automatically.
So, just type:


Code:
sudo dpkg -i kernel-image-2.6.12-custom_10.00.Custom_i386.debEnjoy.


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Ubuntu内核的编译及注释 下一篇我们该学什么程序语言?

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: