debian stretch kernel compile


# 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.

# apt-get install libncurses5-dev
for menuconfig

$ 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

$ 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

a successful build at the end of make created about half-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.

$ 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 viewed