it seems very relevant to have the late as possible kernel up and running:

first: backup your system!

on boot time under „Advanced“ you can chose to boot the old kernel – never the less – backup your system completely before progressing.

hardware requirements:

you will need AT LEAST 15GB of free disk space, better 20GB. (yes you can free disk space again after compilation…)

du -h --max-depth=0 /usr/src/linux-4.17.12
12G /usr/src/linux-4.17.12


if you want the LATEST Kernel ( above  4.17.19) you will need also gcc version > 4.5 or you run into

make clean
arch/x86/Makefile:184: *** Compiler lacks asm-goto support..  Stop.


# under Centos7/Redhat/Fedora this seems to be done like this: (src)
yum install centos-release-scl
yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
which gcc
gcc --version

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO

tested with:
sha256sum: 38d5d51d9d100fd73df031ffd6bd8b1297ce24660dc8c13a3b8b4534a4bd291c

about x86: Force asm-goto: „We want to start using asm-goto to guarantee the absence of dynamic branches (and thus speculation).
A primary prerequisite for this is of course that the compiler supports asm-goto.
This effecively lifts the minimum GCC version to build an x86 kernel to gcc-4.5. Signed-off-by: Peter Zijlstra (Intel) <> Signed-off-by: Thomas Gleixner of:  Link:

if you want the latest kernel for Debian: debian9 stretch…

it seems to pretty much be always the same process:

  1. setup build environment
  2. change to /usr/src
  3. pull latest kernel sources from
  4. create softlink with name „linux“ to the folder with the latest kernel sources
  5. try make menuconfig
  6. install missing packages until make menuconfig works
  7. make kernel
  8. install kernel

in this example i try to compile the latest kernel from on CentOS7

it compiles… and boots up…

hit ESC or other keys to see the verbose kernel output instead of the loading bar…

hostnamectl; # tested on
   Static hostname: CentOS7
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-514.26.1.el7.x86_64
      Architecture: x86-64

# also tested on
Kernel: Linux 3.10.0-693.11.6.el7.x86_64
# also tested 2018-02-06 on
Kernel: Linux 3.10.0-693.17.1.el7.x86_64
# also tested on 2018-07
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-862.6.3.el7.x86_64

su; # become root
yum update; # update system

yum search kernel-devel; # search for kernel headers
yum install kernel-devel.x86_64; # install kernel headers required by gcc
yum search ncurses; # search for devel and i386 (32bit) or 64Bit
yum install wget gcc ncurses-devel.x86_64; # install gcc and ncurses
cd /usr/src/
# now visit and get the link to the latest kernel

tar fxvJ linux-4.12.tar.xz
ln -sv linux-4.12 linux
cd linux
uname -r;
# this is our current kernel version
# reuse the currently used kernel.config
cp -v /boot/config-$(uname -r) .config; 
make clean
make menuconfig;
# gave me this error:
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/mconf.o
YACC scripts/kconfig/
/bin/sh: bison: command not found
make[1]: *** [scripts/kconfig/] Error 127
make: *** [menuconfig] Error 2
# fix it
yum install bison

# rerun
make menuconfig
# gave me this error
YACC scripts/kconfig/
LEX scripts/kconfig/zconf.lex.c
/bin/sh: flex: command not found
make[1]: *** [scripts/kconfig/zconf.lex.c] Error 127
make: *** [menuconfig] Error 2
# fix it
yum install flex

# rerun
make menuconfig
# now finally worked:
# kernel5

# kernel4

# all i modified here is under General -> Custom string cuztom

# older versions look like this

# for compile to work one needs additional packages
yum install elfutils-libelf-devel.x86_64 openssl-devel.x86_64 bc screen

# screen package is optional
# allows you to start compilation and disconnect
# while installing the new kernel requires root
# according to this, you should not compile as root

# so we create a new non-root user:
# (cross distribution Debian8, RedHat(CentOS7), Suse12)
# add user and create home directory
useradd -m username;
# you will have to asign a password for the user straight afterwards
passwd username;
# probably would also want to change default-login-shell of username to bash
usermod -s /bin/bash username;
# change permissions, so non-root user may do things
chown -R username:username /usr/src/linux*
# become this new user
su username;

# starting a new screen session with this name
screen -S compiling_kernel;
make clean;
# compile using 4 cpu cores (faster than with one)
time make -j4;
# watch the magic for a while...
# Ctrl+A then D = detach from current screen session
# so you can let the compilation run in the background and do other stuff
# while it is compiling
# for example: what cpu do you have?
cat /proc/cpuinfo
# benchmarks:
## kernel 4.17.4 using 2x cores of Xeon (Skylake, IBRS) 2GHZ 16MByte Cache
### bogomips: 4199.99
### took real 85minutes
## kernel 5.1 using 4x core of Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
### BogoMIPS: 6800.01
### took real 46m39.147s
screen -ls; # show current screen sessions
screen -R compiling_kernel; # resume this screen session
# how to install htop in centos
yum install epel-release
yum install htop
compiling kernel 4.12.13 under centos7 with 8x xeon E5504 at 2.00GHz cores on supermicro X8DT3 server

watching kernel 4.12.13 compiling under centos7 with 8x xeon E5504 at 2.00GHz cores on supermicro X8DT3 server (2018-01) good way to stress test your system 😀  real: 24m48.755s … not too bad 😀

# the time has come
# when you will definitely
# need to be root to progress
make modules_install
make install
reboot; # and test your new kernel
# if that worked you might want to make it boot the new kernel per default

# make sure those orange lines are present
# so it will automatically remember
# the last kernel you have chosen (the chosen one)
# imho would remove the "quiet" parameter
# so you get a more verbose output during boot
vi /etc/default/grub;
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet"
# :wq save quit vi/vim

# centos7 update grub config and menu
grub2-mkconfig -o /boot/grub2/grub.cfg

# can show you what the boot menu looks like and what entry should be default
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (4.10.0-862.14.4.el7.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-862.9.1.el7.x86_64) 7 (Core)
2 : CentOS Linux (0-rescue-9063ac396d784f4c997ceacdd0590c25) 7 (Core)

# show what is current default kernel
grub2-editenv list
saved_entry=CentOS Linux (3.10.0-862.14.4.el7.x86_64) 7 (Core)

grub2-set-default 0

# or if you have access to the server directly:
# reboot select new kernel and it should be set to default
# after
sync; shutdown -r now;
# or
sync; reboot;
# and all goes well, you should be running your latest kernel

modules and kernel install fine – after reboot i can select the new kernel 4.12 and it boots up fine.

[user@CentOS7 ~]$ hostnamectl
   Static hostname: CentOS7
         Icon name: computer-vm
           Chassis: vm
        Machine ID: ad6f3410bf2346ec97a6fdc05dc4a607
           Boot ID: 58e86772e8b34dab97bd2428e7592413
    Virtualization: microsoft
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 4.12.0cuztom
      Architecture: x86-64

 Static hostname: CentOSworkstation.localdomain
 Icon name: computer-laptop
 Operating System: CentOS Linux 7 (Core)
 CPE OS Name: cpe:/o:centos:centos:7
 Kernel: Linux 4.14.12 (recent in 2017-01)
 Architecture: x86-64


cleaning up:

# to avoid overwriting your custom compiled kernel with the next update add this
vim /etc/yum.conf 
# if it is a desktop workstation you might also want to
exclude=icedove* firefox* libreoffice*


a quadcore Intel(R) Core(TM) i5-3470T CPU @ 2.90GHz needs real 36m58.294s to compile linux-4.15.1

….not sure what those messages are about:

full error message:

SELinux is preventing /usr/libexec/accounts-daemon from using the dac_read_search capability.

*****  Plugin dac_override (91.4 confidence) suggests   **********************

If sie berprfen wollen, ob Domne diesen Zugriff bentigt oder Sie eine Datei mit den falschen Berechtigungen auf Ihrem System haben
Then aktivieren Sie die vollstndige Audit-Funktion, um die Pfad-Information der problematischen Datei zu erhalten. Dann reproduzieren Sie den Fehler erneut.

Volle Audit-Funktion aktivieren
# auditctl -w /etc/shadow -p w
Versuchen Sie AVC zu reproduzieren. Fhren Sie dann folgendes aus
# ausearch -m avc -ts recent
Falls PATH record ersichtlich ist, berprfen Sie Eigentmer/ Berechtigungen der Datei und korrigieren Sie dies,
anderenfalls melden Sie dies an Bugzilla.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If sie denken, dass accounts-daemon standardmig dac_read_search Berechtigung haben sollten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, knnen Sie ein lokales Richtlinien-Modul erstellen.
allow this access for now by executing:
# ausearch -c 'accounts-daemon' --raw | audit2allow -M my-accountsdaemon
# semodule -i my-accountsdaemon.pp

Additional Information:
Source Context                system_u:system_r:accountsd_t:s0
Target Context                system_u:system_r:accountsd_t:s0
Target Objects                Unknown [ capability ]
Source                        accounts-daemon
Source Path                   /usr/libexec/accounts-daemon
Host                          CentOS7
Source RPM Packages
Target RPM Packages
Policy RPM                    selinux-policy-3.13.1-102.el7_3.16.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     CentOS7
Platform                      Linux CentOS7 4.12.0cuztom #1 SMP Mon Jul 3
                              12:01:05 CEST 2017 x86_64 x86_64
Alert Count                   6
First Seen                    2017-07-03 15:13:18 CEST
Last Seen                     2017-07-03 15:13:52 CEST
Local ID                      286945cd-6cfc-4233-a5b4-747cfe5afe79

Raw Audit Messages
type=AVC msg=audit(1499087632.710:111): avc:  denied  { dac_read_search } for  pid=782 comm="accounts-daemon" capability=2  scontext=system_u:system_r:accountsd_t:s0 tcontext=system_u:system_r:accountsd_t:s0 tclass=capability permissive=0

Hash: accounts-daemon,accountsd_t,accountsd_t,capability,dac_read_search

important or simply cool and probably related links 🙂

watch Linus Torvalds at work at

Among the material likely coming for Linux 4.13 that we have already covered on Phoronix includes:

– Initial AMD Raven Ridge graphics support (sans no display due to no DC/DAL yet), Vega fixes, and other updates.

Many Allwinner DRM changes.

DRM sync objects are landing.

Raspberry Pi / VC4 improvements.

Various updates to the Intel DRM driver.

Large directory support for EXT4.

XPad updates and Google Rose Touchpad support.

AES-128-CBC support in Fscrypt, the file-system generic crypto code currently utilized by EXT4 and F2FS.

– Possibly the AMD SME/SEV security features supported by new EPYC CPUs.

– Continued push for more HDMI CEC drivers.

Stay tuned for thorough Linux 4.13 kernel feature coverage once the merge window opens following the 4.12 debut.