debian stretch kernel compile

prerequisites

# apt-get install linux-source
current kernel source

# apt-get install build-essential
required to build debian packages

# apt-get install fakeroot
root not required, not recommended, to build packages.

tools
# apt-get install libncurses5-dev
for menuconfig

# apt-get install pkg-config libqt4-dev
for xconfig

# apt-get install libglade2-dev libgtk2.0-dev
for gconfig
unless you use/prefer gnome, not worth installing bloatware dependencies.

environment
$ mkdir ~/kernel
$ cd ~/kernel
$ tar -xaf /usr/src/linux-source-{version}
$ ln -s linux-source-{version} linux
$ cd linux
$ cp /boot/config-{version} .config
$ make oldconfig

build
$ make menuconfig
$ make clean
$ nice -n19 make -j3 deb-pkg LOCALVERSION=-nixventure

if you get such warnings
warning: File::FcntlLock not available; using flock which is not NFS-safe
ignore them, or
# apt-get install libfile-fcntllock-perl

install
a successful build at the end of make about half-a-dozen files in the parent directory. the most interesting to us is the kernel (linux-image-*.deb), and perhaps the headers (linux-headers-*.deb).

$ sudo dpkg -i ../linux-image-{version}.deb

dpkg will trigger an update of your bootloader. all you need to do now is reboot, and test your brand new shiny kernel.


patch
$ apt-cache search linux-patch
$ apt-cache search kernel-patch
# apt-get install {linux/kernel}-patch-{??}
$ cd ~/kernel/linux
$ make clean
$ zcat /usr/src/kernel-patches/diffs/*/*.patch.gz | patch -p1

No comments:

Post a Comment

most popular posts