1 |
On Sat, 2010-09-11 at 10:24 +0200, Stéphane Guedon wrote: |
2 |
> few months ago, I read linux kernel in a nutschell(sic), and the author wrote we |
3 |
> shouldn't do kernel operations (config and build) as root. |
4 |
|
5 |
I call bullsh*t. I've been compiling kernels for 17 years and for the |
6 |
most part have done it as root without any problems. |
7 |
|
8 |
What the author is saying is that, to an extent, in theory no one should |
9 |
compile anything as root, or really do anything non-system-adminly as |
10 |
root. You should only do as root what is critically necessary (e.g. |
11 |
make install) as root. |
12 |
|
13 |
In a perfect, tidy world we'd all do that. This world, however does not |
14 |
exist. Even portage, by default does configure and make as root (albeit |
15 |
in a sandbox so it is safe(r). |
16 |
|
17 |
What the author means is theoretically the config/compile phase could |
18 |
unintentionally cause some kind of harm to your system. In practice I |
19 |
have never seen this or heard of it. The kernel devs are bright enough |
20 |
to ensure that the compilation does nothing outside the source tree |
21 |
itself. |
22 |
|
23 |
It's a good guideline but, like the government's dietary guidelines, not |
24 |
ones I intend to follow religiously. |
25 |
|
26 |
> Is sudo (or kdesudo ?) a good replacement to that ? |
27 |
|
28 |
sudo runs things as root, so effectively you've done nothing but add a |
29 |
password prompt to the mix. |
30 |
|
31 |
Gentoo actually makes this a bit more difficult, because usually one |
32 |
uses portage to install the kernel sources, and they get installed as |
33 |
root-owned, and only root has write access to the kernel tree. |
34 |
|
35 |
Some people, such as myself, use kernel sources outside of portage (I |
36 |
follow a git repo) and do so as a non-root user. In this case the |
37 |
kernel tree is not owned by root and the config/compile is easily done |
38 |
as a non-root user. |
39 |
|
40 |
If you are super-paranoid. You can make a non-root copy |
41 |
of /usr/src/linux and compile it as a non-root user. |
42 |
|
43 |
But there really isn't any point in using sudo. It's effectively doing |
44 |
the same thing that you are trying to avoid. |