linux kernel build on ubuntu
Short note
---------
# 1. Clone the kernel to your local machine
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
$ cd linux-stable
# 1.1 optional Github mirror link, i prefer github over kernel.org
$ git clone https://github.com/torvalds/linux.git
$ cd linux
# 2. check kernel version
$ make kernelversion
$ uname -ra
# 3. Find the tag for the version you want
$ git tag -l | grep 4.20
v4.20
v4.20.rc...
# 4. Create a new branch with that tag
$ git checkout -b my4.20 v4.20
# 5. use Ubuntu proper config
# 5.1 use default defconfig for the system
$ make defconfig
# 5.2 use current ubuntu config, /boot/config-*
$ cp /boot/config-`uname -r` .config
# if same version or very close to current version
$ make oldconfig
# otherwise, choose default one, very safe
$ yes '' | make oldconfig
# 5.2.1 optional, change kernel options
$ make menuconfig
#make debian packages, *.deb will be copied in ../ (outside of linux build root)
$ make deb-pkg -j 16
# copied *.deb to target machine. Generally 3 files
# then install debian package. No particular order is required
$ sudo dpkg -i *.deb