Replacing Kernel-headers With Custom Compiled Version (from Kernel.org) – Safe?

Home » CentOS » Replacing Kernel-headers With Custom Compiled Version (from Kernel.org) – Safe?
CentOS 3 Comments

Hello CentOS users,

Currently I have compiled kernel version 4.19.37, which the source is from kernel.org. I compiled the kernel by following steps:

- get the kernel tarball and unpack it
- install prerequisties as described in https://wiki.CentOS.org/HowTos/Custom_Kernel (in addition bc and openssl-devel)
- copy the kernel configuration:
$ cp /boot/config-3.10.0-957.21.3.el7.x86_64 ~/linux-4.19.37/.config
- create configuration:
$ cd ~/linux-4.19.37
$ make olddefconfig
$ make nconfig
- compile and create RPM package:
$ make vmlinux
$ make modules
$ make rpm-pkg
- install kernel RPM:
# yum install ~/rpmbuild/RPMS/x86_64/kernel-*.rpm

However, in the last step (installing kernel RPM), I got following notice:

=============================================================================== Package Arch Version
Repository Size
===============================================================================Installing:
kernel x86_64 4.19.37_sentinel_custom-1
/kernel-4.19.37_sentinel_custom-1.x86_64 209 M
kernel-devel x86_64 4.19.37_sentinel_custom-1
/kernel-devel-4.19.37_sentinel_custom-1.x86_64 817 M
kernel-headers x86_64 4.19.37_sentinel_custom-1
/kernel-headers-4.19.37_sentinel_custom-1.x86_64 4.6 M
replacing kernel-headers.x86_64 3.10.0-957.21.3.el7

Transaction Summary
===============================================================================
Install 3 Packages

There, the compiled kernel-headers package (4.19.37_sentinel_custom-1) is about to replace stock version (3.10.0-957.21.3.el7). Is it safe to continue installing from compiled RPM package above, or install kernel manually?

3 thoughts on - Replacing Kernel-headers With Custom Compiled Version (from Kernel.org) – Safe?

  • So is it safe to install kernel RPMs generated by compilation from kernel.org tarball, or should I stick to manual install?

  • You probably don’t need to install the devel package unless you plan to also build third-party kernel modules.

    You shouldn’t need to install the headers package.  The content of that package *should* be the same as the one that was provided by the vendor
    (CentOS), and if it is not then you would need to rebuild glibc in addition to replacing them.  The same is true for “make headers_install”: It shouldn’t change anything, and shouldn’t be necessary.