一,环境搭建步骤
1)下载Linux源码
1> ~#apt-cache search linux-source
出现:linux-source - Linux kernel source with Ubuntu patches
linux-source-3.0.0 - Linux kernel source for version 3.0.0 with Ubuntu patches
2>查看内核版本
root@lutao-virtual-machine:/usr/src/linux-source-4.10.0# uname -a
Linux lutao-virtual-machine 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
3>~#apt-get install linux-source-4.10.0
下载完成后,在/usr/src/下会出现一个linux-source-4.10.0.tar.bz2。解压: tar jxvf linux-source-4.10.0.tar.bz2
4>然后在Linux内核源码目录/usr/src/linux-source-4.10.0目录下面用老的方法配置好Linux内核:
~#make oldconfig
4>编译内核:~#make //apt-get install libssl-dev(解决openssl/ssl.h找不到问题,下载失败时
vi /etc/resolv.conf
nameserver 202.96.134.133
nameserver 8.8.8.8)
5>编译模块:~#make modules
6>安装模块:~#make modules_install
以上步骤完成后,会在/lib/modules 目录下生成一个文件夹