Custom Kernels On Ubuntu
Packages
sudo apt-get install build-essential git kernel-package fakeroot libncurses5-dev equivs
Getting the Kernel
To use the most up-to-date-kernel:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
To use a previous version of the kernel, including LTS kernels:
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-${VERSION}
Configuring The Kernel
cd linux cp /boot/config-`uname -r` .config yes '' | make oldconfig make menuconfig #optional, for further tweaking
Compiling
make -j[n] deb-pkg LOCALVERSION=${STRING} KDEB_PKGVERSION=${VERSION} DEBFULLNAME=${NAME} DEBEMAIL=${EMAIL}
Making A Meta-Package
equivs-control ${FILE} nano ${FILE} equivs-build ${FILE}
Creating A Repo
dpkg-scanfiles dists/${CODENAME}/${REPO}/binary-${ARCH} /dev/null | gzip -9c > dists/${CODENAME}/${REPO}/binary-${ARCH}