On Tue, 10 Aug 2010 16:43:04 -0400 (EDT), Arthur Machlas wrote: > > A less religious explanation, from Greg Kroah-Hartman, author of The > Linux Kernel in a Nutshell, and well-known kernel hacker. > > "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). > There have been bugs in the kernel build process in the past, causing > some special > files in the /dev directory to be deleted if the user had superuser > permissions while > building the Linux kernel.* There are also issues that can easily > arise when uncompressing > the Linux kernel with superuser rights, as some of the files in the kernel > source package will not end up with the proper permissions and will cause > build > errors later. > > * This took quite a while to fix, as none of the primary kernel > developers build kernels as root, so > they did not suffer from the bug. A number of weeks went by before it > was finally determined that > the act of building the kernel was the problem. A number of kernel > developers half-jokingly suggested > that the bug remain in, to help prevent anyone from building the > kernel as root, but calmer > heads prevailed and the bug in the build system was fixed." - Linux > Kernel in a Nutshell, p. 4
Thanks, Arthur. I actually do agree with Greg from a philosophical point of view that it is better to do as much as possible as a non-root user. It is pragmatic, rather than philosophical reasons that cause me to build the kernel as root. I believe all the bugs mentioned above have been fixed now. And building the kernel as a non-root user adds extra complications. For example: (1) I believe that "aptitude install linux-source-x.x.xx", as with any package installation, requires root privileges. (2) By default, "aptitude install linux-source-x.x.xx" installs the .tar.bz2 file in /usr/src. My non-superuser self does not have write permissions to that directory; so it cannot be uncompressed in place. It has to be moved somewhere else, such as a directory off of my home directory. And then I have to use chown and chgrp on it to assign the ownership of the file to my non-superuser self. (3) If I am using out-of-kernel-source-tree module source packages, I have to copy them too. By default, the source code installs to /usr/src/modules, I think. All the same issues arise here. And then I have to use the $MODULE_LOC environment variable to tell make-kpkg where to find the module source code. More overrides. It's just simpler to be root and do everything in its default location. If I were experiencing the problems that Greg describes above, it would be worth doing the extra steps to avoid them. But all those problems have been fixed, it seems. Still, since there are many people who feel strongly about this issue, perhaps I should consider revising my kernel building web page to address this subject in more detail. -- .''`. Stephen Powell : :' : `. `'` `- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1851191283.11027.1281537217247.javamail.r...@md01.wow.synacor.com