2005-12-02 02:23:51

by Coywolf Qi Hunt

[permalink] [raw]
Subject: [q] make modules_install as non-root?

Hello people,

I wrote my own installkernel so I can do `make install' as non-root
with the help of sudo. But how can we get to do `make modules_install'
as non-root with sudo as well?

The works of modules_install seem scattered over several places. Is
it a nice idea to factor out an *installmodules* script for `make
modules_install' to invoke?

ps:
Linus recommend us to build as non-root and install as root.
I ask if we should install as non-root too.

Thanks
--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/


2005-12-02 02:46:29

by Peter Williams

[permalink] [raw]
Subject: Re: [q] make modules_install as non-root?

Coywolf Qi Hunt wrote:
> Hello people,
>
> I wrote my own installkernel so I can do `make install' as non-root
> with the help of sudo. But how can we get to do `make modules_install'
> as non-root with sudo as well?
>
> The works of modules_install seem scattered over several places. Is
> it a nice idea to factor out an *installmodules* script for `make
> modules_install' to invoke?
>
> ps:
> Linus recommend us to build as non-root and install as root.
> I ask if we should install as non-root too.

Personally, I just use "sudo make install" or "sudo make
modules_install" to do installations as an ordinary user. No need for
special scripts or modifications to the build procedure.

Peter
--
Peter Williams [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce

2005-12-02 02:59:14

by Coywolf Qi Hunt

[permalink] [raw]
Subject: Re: [q] make modules_install as non-root?

2005/12/2, Peter Williams <[email protected]>:
> Coywolf Qi Hunt wrote:
> > Hello people,
> >
> > I wrote my own installkernel so I can do `make install' as non-root
> > with the help of sudo. But how can we get to do `make modules_install'
> > as non-root with sudo as well?
> >
> > The works of modules_install seem scattered over several places. Is
> > it a nice idea to factor out an *installmodules* script for `make
> > modules_install' to invoke?
> >
> > ps:
> > Linus recommend us to build as non-root and install as root.
> > I ask if we should install as non-root too.
>
> Personally, I just use "sudo make install" or "sudo make
> modules_install" to do installations as an ordinary user. No need for
> special scripts or modifications to the build procedure.

That's rather insecure. You have to add /usr/bin/make in your sudoers,
then an malicious Makefile could do harm. I'm being paranoid. But we
all are since we avoid to use root.
--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/

2005-12-02 03:04:45

by Peter Williams

[permalink] [raw]
Subject: Re: [q] make modules_install as non-root?

Coywolf Qi Hunt wrote:
> 2005/12/2, Peter Williams <[email protected]>:
>
>>Coywolf Qi Hunt wrote:
>>
>>>Hello people,
>>>
>>>I wrote my own installkernel so I can do `make install' as non-root
>>>with the help of sudo. But how can we get to do `make modules_install'
>>>as non-root with sudo as well?
>>>
>>>The works of modules_install seem scattered over several places. Is
>>>it a nice idea to factor out an *installmodules* script for `make
>>>modules_install' to invoke?
>>>
>>>ps:
>>>Linus recommend us to build as non-root and install as root.
>>>I ask if we should install as non-root too.
>>
>>Personally, I just use "sudo make install" or "sudo make
>>modules_install" to do installations as an ordinary user. No need for
>>special scripts or modifications to the build procedure.
>
>
> That's rather insecure. You have to add /usr/bin/make in your sudoers,
> then an malicious Makefile could do harm.

Only if you run it with sudo.

> I'm being paranoid. But we
> all are since we avoid to use root.
> --
> Coywolf Qi Hunt
> http://sosdg.org/~coywolf/


--
Peter Williams [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce

2005-12-02 03:12:23

by Keith Owens

[permalink] [raw]
Subject: Re: [q] make modules_install as non-root?

On Fri, 2 Dec 2005 10:23:49 +0800,
Coywolf Qi Hunt <[email protected]> wrote:
>Hello people,
>
>I wrote my own installkernel so I can do `make install' as non-root
>with the help of sudo. But how can we get to do `make modules_install'
>as non-root with sudo as well?
>
>The works of modules_install seem scattered over several places. Is
>it a nice idea to factor out an *installmodules* script for `make
>modules_install' to invoke?
>
>ps:
>Linus recommend us to build as non-root and install as root.
>I ask if we should install as non-root too.

make INSTALL_MOD_PATH=<somewhere> modules_install

Then use sudo to move from <somewhere>/lib/modules/<version> to /lib/modules/<version>.

2005-12-02 15:24:58

by Horst H. von Brand

[permalink] [raw]
Subject: Re: [q] make modules_install as non-root?

Coywolf Qi Hunt <[email protected]> wrote:
> 2005/12/2, Peter Williams <[email protected]>:

[...]

> > Personally, I just use "sudo make install" or "sudo make
> > modules_install" to do installations as an ordinary user. No need for
> > special scripts or modifications to the build procedure.

> That's rather insecure. You have to add /usr/bin/make in your sudoers,
> then an malicious Makefile could do harm. I'm being paranoid. But we
> all are since we avoid to use root.

Oh, come on. If somebody can mess with your kernel sources, you are toast
anyway. No need to doctor a Makefile for that at all.
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513