We have covered the kernel configuration and build steps in detail in Chapter 2, Building the 5.x Linux Kernel from Source – Part 1, and Chapter 3, Building the 5.x Linux Kernel from Source – Part 2, hence we shan't repeat it here. Pretty much everything remains the same; the only significant difference being that we must configure this kernel to take advantage of RTL (this is explained on the new RTL wiki site, here: https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/preemptrt_setup).
To cut down the kernel features to be built to approximately match the present system configuration, we first, within the kernel source tree directory (linux-5.4.69), do the following (we also covered this back in Chapter 2, Building the 5.x Linux Kernel from Source - Part 1, under the Tuned kernel config via the localmodconfig approach section):
$ lsmod > /tmp/mylsmod
$ make LSMOD=/tmp/mylsmod localmodconfig...