While learning how to build and install a custom kernel (for kernel hacking), I came across a contradictory statement.
In this StackExchange answer, the author states:
in the following instructions, paths inside the source tree take the form [src]/whatever, where [src] is the directory you installed the source into, e.g. /usr/src/linux-3.13.3. You probably want to do this stuff su root as the source tree should remain secure in terms of write permissions (it should be owned by root).
While in the reference book, that he mentioned: Linux Kernel in a nutshell, Greg Kroah-Hartman says:
This warning is the most important thing to remember while working through the steps in this book. Everything in this book — downloading the kernel source code,uncompressing it, configuring the kernel, and building it — should be done as a normal user on the machine. Only the two or three commands it takes to install a new kernel should be done as the superuser (root).
and
The kernel source code should also never be placed in the/usr/src/linux/directory, as that is the location of the kernel that the system libraries were built against, not your new custom kernel. Do not do any kernel development under the /usr/src/directory tree at all, but only in a local user directory where nothing bad can happen to the system.
Both sources are quite old, what is the correct approach to this nowadays?