内核编译

编译Linux内核

下载内核源码

  1. apt-get source linux-image-$(uname -r)
  2. apt-get build-dep linux-image-$(uname -r)
  3. apt-get install -y libncurses5 libncurses5-dev

修改内核配置并编译

  1. chmod a+x debian/rules
  2. chmod a+x debian/scripts/*
  3. chmod a+x debian/scripts/misc/*
  4. fakeroot debian/rules clean
  5. fakeroot debian/rules editconfigs
  6. # build kernel
  7. fakeroot debian/rules clean
  8. # quicker build:
  9. fakeroot debian/rules binary-headers binary-generic binary-perarch
  10. # if you need linux-tools or lowlatency kernel, run instead:
  11. fakeroot debian/rules binary
  12. # Only build kernel modules for network drivers
  13. # make prepare
  14. # make modules_prepare
  15. # make modules SUBDIRS=drivers/net
  16. # make M=drivers/net
  17. # make modules

安装并重启

  1. dpkg -i linux*4.8.0-17.19*.deb
  2. reboot