Compile Kernel: Download kernel source code using the following command:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
$ git checkout v4.7.2
and then compile kernel as following:
$ cd linux-4.7.2
$ cp /boot/config-$(uname -r) .config
$ make menuconfig
$ make-kpkg clean
$ fakeroot make-kpkg —initrd —revision jiangxianliang.001 —append-to-version -20160906 kernel_image kernel_headers
To speed up the compile process pass the -j option (-j 16 means you are using all 16 cores to compile the Linux kernel):
$ fakeroot make-kpkg —initrd —revision jiangxianliang.001 —append-to-version -20160906 kernel_image kernel_headers -j 16
- —initrd : Create an initrd image.
- —revision=jiangxianliang.001 : Set custom revision for your kernel such as jiangxianliang.001 or -jiangxianliang.001-custom-kernel etc.
- —append-to-version
- kernel_image : This target produces a Debian package of the Linux kernel source image, and any modules configured in the kernel configuration file .config.
- kernel_headers : This target produces a Debian package of the Linux kernel header image.
Verify kernel deb files:
$ ls ../*.deb