BYOK - Build Your Own Kernel What's this? In the BetterLinux releases for CentOS, some features are provided as How does it work? Each BetterLinux kernel module is implemented as a binary-only part and some Which kernels are supported In practice we support CentOS/RHEL 6.x and all LTS vanilla kernels running on CentOS/RHEL 6.x. Example #1: build a BetterLinux kernel from a 3.14 vanilla kernel The following instructions document the steps to build a customized BetterLinux - Create an account on the BetterLinux website (http://www.betterlinux.com/) - Download the Linux kernel source code from http://www.kernel.org/: $ wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.27.tar.xz - Extract the kernel source tarball: $ tar xJf linux-3.14.27.tar.xz - Apply the corresponding BetterLinux patch: $ patch -p1 < /etc/betterlinux/byok/patches/betterlinux-3.14-v1.2.3.patch - Adjust your kernel .config (options required by BetterLinux are enabled by $ make menuconfig - Build the custom BetterLinux kernel: $ make - Build the BetterLinux kernel modules: $ rpmbuild --rebuild -D "kversion 3.14.27" -D "kbuilddir $PWD" \ - Install BetterLinux kernel: $ sudo make modules_install - Install BetterLinux kernel modules: $ sudo rpm -ivh ~/rpmbuild/RPMS/x86_64/betterlinux-kernel-modules* Example #2: build a BetterLinux kernel from a stock CentOS 6.6 kernel - Get the latest CentOS rpm from http://vault.centos.org - Install the source rpm: $ rpm -ivh kernel-2.6.32-504.3.3.el6.src.rpm - Copy the all-in-one BetterLinux patch to your source rpm build directory: $ cp betterlinux-centos6-2.6.32-504.3.3.el6-v1.2.3.patch ~/rpmbuild/SOURCES/ - Edit the stock kernel.spec file to apply the BetterLinux patch during the $ vi ~/rpmbuild/SPEC/kernel.spec - Add the following line: >>> Patch000001: betterlinux-centos6-2.6.32-504.3.3.el6-v1.2.3.patch # empty final patch file to facilitate testing of kernel patches - Add the following line (NOTE: must be before make configs): >>> ApplyOptionalPatch betterlinux-centos6-2.6.32-504.3.3.el6-v1.2.3.patch # Dynamically generate kernel .config files from config-* files ApplyOptionalPatch linux-kernel-test.patch - Recompile the kernel $ cd ~/rpmbuild/SPEC - Install kernel and kernel-devel packages: $ cd ~/rpmbuild/RPMS/x86_64 - Build BetterLinux kernel modules (ignore git warnings): $ rpmbuild --rebuild -D "kversion 2.6.32-504.3.3.el6.x86_64" betterlinux-kernel-modules-1.2.3-1.src.rpm - Install BetterLinux kernel modules: $ cd ~/rpmbuild/RPMS/x86_64 - Reboot into the new BetterLinux kernel (2.6.32_504.3.3.el6.x86_64) |