Compile Linux Kernel on Ubuntu 12.04 LTS
来源:互联网 发布:先锋网络电视破解版 编辑:程序博客网 时间:2024/05/29 17:11
http://mitchtech.net/compile-linux-kernel-ubuntu-12-04-lts/
This tutorial will outline the process to compile your own kernel for Ubuntu. It will demonstrate both the traditional process using ‘make’ and ‘make install’ as well as the Debian method, using ‘make-dpkg’. This is a quick overview of the compilation process, for a more thourough walkthrough, see Compile Linux Kernel on Ubuntu 12.04 LTS (Detailed). In both cases, we begin by installing some dependencies:
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev linux-source qt3-dev-tools libqt3-mt-dev libncurses5 libncurses5-dev fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge kernel-package
Note: qt3-dev-tools and libqt3-mt-dev is necessary if you plan to use ‘make xconfig’ and libncurses5 and libncurses5-dev if you plan to use ‘make menuconfig’. Next, copy the kernel sources with wget:
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.17.tar.bz2
Extract the archive and change into the kernel directory:
tar -xjvf linux-3.2.17.tar.bz2 cd linux-3.2.17/
Now you are in the top directory of a kernel source tree. Before building the kernel, you must configure it. If you wish to re-use the configuration of your currently running kernel, start by copying the current config contained in /boot:
cp -vi /boot/config-`uname -r` .config
Parse the .config file using make with the oldconfig flag. If there are new options available in the downloaded kernel tree, you may be prompted to make a selection to include them or not. If unsure, press enter to accept the defaults.
make oldconfig
Since the 2.6.32 kernel, a new feature allows you to update the configuration to only compile modules that are actually used in your system. As above, make selections if prompted, otherwise hit enter for the defaults.
make localmodconfig
Now you can configure the build with ncurses using the ‘menuconfig’ flag:
make menuconfig
or, using a GUI with the ‘xconfig’ flag:
make xconfig
Now we are ready to start the build. You can speed up the compilation process by enabling parallel make with the -j flag. The recommended use is ‘processor cores + 1′, e.g. 5 if you have a quad core processor:
make -j5
Once the initial compilation has completed, install the dynamically loadable kernel modules:
sudo make modules_install
Finally, install the kernel:
sudo make install
Debian Method:
Instead of the compilation process of above, you can alternatively compile the kernel as installable .deb packages. This improves the portability of the kernel, since installation on a different machine is as simple as installing the packages. Rather than using ‘make’ and ‘make install’, we use ‘make-kpkg’:
fakeroot make-kpkg –initrd –append-to-version=-some-string-here kernel-image kernel-headers
Unlike above, you cannot enable parallel compilation with make-kpkg using the -j flag. Instead, define the CONCURRENCY_LEVEL environment variable.
export CONCURRENCY_LEVEL=3
Once the compilation has completed, you can install the kernel and kernel headers using dpkg:
sudo dpkg -i linux-image-3.2.14-mm_3.2.14-mm-10.00.Custom_amd64.deb
sudo dpkg -i linux-headers-3.2.14-mm_3.2.14-mm-10.00.Custom_amd64.deb
- Compile Linux Kernel on Ubuntu 12.04 LTS
- linux kernel stable compile on ubuntu
- Compile Linux Kernel on Ubuntu 12.10
- Compile gcc4.8 on Ubuntu 12.04 LTS X64
- Compile Linux Kernel in Ubuntu
- Compile FFmpeg on Ubuntu Lucid Lynx 10.04 LTS
- Compile the latest Kernel(linux-3.1-rc4) On Ubuntu Plateform
- Compile the mainline Linux kernel for Ubuntu
- Linux Kernel 3.9 on Ubuntu
- Compile linux kernel source
- Compile Linux Kernel Modules
- Compile Linux kernel
- linux kernel compile
- Cross compile linux kernel
- vmware workstation 8.0.3 + linux kernel 3.2.X(ubuntu 12.04LTS)
- ubuntu环境下编译内核详解(linux kernel compile)
- How to Compile Android on Ubuntu (12.04)
- How to Compile Android on Ubuntu (12.04)
- CString转char*字符串
- CKEditer实现插入图片的功能
- Min_Cut stoerwagner算法
- 视图、索引、存储过程 、触发器、游标及事务
- 学习点滴笔记
- Compile Linux Kernel on Ubuntu 12.04 LTS
- hbase SCAN操作-ROOT- .META.
- aa
- To Install OpenGL on Ubuntu
- Java socket 分析1--Socket说明与传输协议
- Java socket 分析2--Socket网络编程应用
- 3dsmax快捷键大全
- Java socket 分析3---Socket异常处理问题
- 随机采样一致性算法 RANSAC算法及应用