先查看自己系统使用的内核版本:
wang@wang:~$ uname -r
3.13.0-96-generic
查看需要下载的源码包:
wang@wang:/usr/src$ apt-cache search linux-source
linux-source - Linux kernel source with Ubuntu patches
linux-source-3.13.0 - Linux kernel source for version 3.13.0 with Ubuntu patches
sudo apt-get install linux-source-3.13.0
下载完成之后,会在/usr/src目录下有一个linux-source-3.13.0.tar.bz2压缩包,进行解压。
root@wang:/usr/src#tar jxvf linux-source-3.13.0.tar.bz2
开始配置内核选择最快的原版的配置(默认)方式:
root@wang:/usr/src/linux-source-3.13.0#make oldconfig
然后开始make,大约需要一个小时:
root@wang:/usr/src/linux-source-3.13.0#make
root@wang:/usr/src/linux-source-3.13.0#make bzImage
root@wang:/usr/src/linux-source-3.13.0#make modules
root@wang:/usr/src/linux-source-3.13.0#make mudules_install
make bzImage会在当前目录下生成vmlinux文件,重启系统