0

We have a Makefile for compiling a network interface's driver. When calling the Makefile in an Ubuntu 9.04 installation, we need to call just 'make'. However, when calling the Makefile in an Ubuntu 10.04 installation, we need to call 'sudo -s make'.

In Ubuntu 9.04, if we call 'sudo -s make', the compilation fails. And in Ubuntu 10.04, if we call 'make' the compilation also fails.

Although the compilation can be carried out in both versions of Ubuntu by either issuing or not issuing the 'sudo -s' bit, we would like to have a single .sh script that calls the Makefile successfully regardless of which version of Ubuntu it is running on. Are there any differences in the way that sudo -s is treated in 9.04 compared to 10.04? And if there are, what is the best solution for ensuring that both versions are catered for in one single .sh script when calling make?

1 Answer 1

3

The make command is supposed to compile the source code. That's a task that should not require any administrative privileges. For system wide installation root privileges are necessary. This means in your case, that the makefile is not correct. I don't know what it does, but it is not supposed to do it, since it requires root privileges.

Consider the following scenario: A user wants to install software. He/She lauches

./configure --prefix=/home/joe/bin/usr && make && make install

The make command must not require root access, this would avoid any user installing your program. You mention, it's a network driver, which is normally not necessary to be used by non-root users, anyhow, you should fix your build.

1
  • Thanks for the advice Marco. I'll pass this on to the network interface manufacturer and see what they make of it (no pun intended!). Mar 7, 2012 at 18:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .