public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: Paul Chavent <paul.chavent@fnac.net>
To: ecos-patches@ecos.sourceware.org
Subject: host : make install fail if not root
Date: Fri, 25 Sep 2009 18:28:00 -0000	[thread overview]
Message-ID: <4ABD0DD3.1090608@fnac.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Hi.

If i do the sequence "./configure make make install" for host side tools, and if i'am not root, the install fail.

I think we should not need to be root for succedd the install.

So i suggest this patch.

I'am not sure it is the good solution.

Regards.

[-- Attachment #2: ecos-host_root_uid.patch --]
[-- Type: text/plain, Size: 4126 bytes --]

Index: packages/devs/eth/synth/ecosynth/current/host/Makefile.am
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/eth/synth/ecosynth/current/host/Makefile.am,v
retrieving revision 1.4
diff -u -5 -r1.4 Makefile.am
--- packages/devs/eth/synth/ecosynth/current/host/Makefile.am	29 Jan 2009 17:48:16 -0000	1.4
+++ packages/devs/eth/synth/ecosynth/current/host/Makefile.am	25 Sep 2009 18:10:53 -0000
@@ -80,12 +80,12 @@
 rawether.$(OBJEXT)	: Makefile ../src/protocol.h
 
 ## The rawether program needs to run with root privileges, or it will
 ## be unable to access the ethernet hardware.
 install-data-hook:
-	chown root $(etherdir)/rawether
-	chmod u+s $(etherdir)/rawether
+	if [ `id -u` = 0 ] ; then chown root $(etherdir)/rawether ; fi
+	if [ `id -u` = 0 ] ; then chmod u+s $(etherdir)/rawether  ; fi
 
 else
 ## When automake scans for hooks it does not take conditionals fully
 ## into account. If the conditional is not satisfied the generated
 ## makefile will still try to invoke the hook, so dummy hooks are needed.
Index: packages/devs/eth/synth/ecosynth/current/host/Makefile.in
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/eth/synth/ecosynth/current/host/Makefile.in,v
retrieving revision 1.6
diff -u -5 -r1.6 Makefile.in
--- packages/devs/eth/synth/ecosynth/current/host/Makefile.in	23 Aug 2009 13:07:45 -0000	1.6
+++ packages/devs/eth/synth/ecosynth/current/host/Makefile.in	25 Sep 2009 18:10:53 -0000
@@ -708,12 +708,12 @@
 
 
 @SUPPORTED_TRUE@rawether.$(OBJEXT)	: Makefile ../src/protocol.h
 
 @SUPPORTED_TRUE@install-data-hook:
-@SUPPORTED_TRUE@	chown root $(etherdir)/rawether
-@SUPPORTED_TRUE@	chmod u+s $(etherdir)/rawether
+@SUPPORTED_TRUE@	if [ `id -u` = 0 ] ; then chown root $(etherdir)/rawether ; fi
+@SUPPORTED_TRUE@	if [ `id -u` = 0 ] ; then chmod u+s $(etherdir)/rawether  ; fi
 
 @SUPPORTED_FALSE@install-data-hook:
 @SUPPORTED_FALSE@	echo Nothing to be done for this platform
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
Index: packages/io/usb/slave/current/host/Makefile.am
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/host/Makefile.am,v
retrieving revision 1.5
diff -u -5 -r1.5 Makefile.am
--- packages/io/usb/slave/current/host/Makefile.am	29 Jan 2009 17:49:49 -0000	1.5
+++ packages/io/usb/slave/current/host/Makefile.am	25 Sep 2009 18:11:03 -0000
@@ -95,12 +95,12 @@
 	$(INSTALL_PROGRAM) usbhost $(bindir)/usbhost_@PACKAGE_VERSION@
 	rm -f $(bindir)/usbhost
 	$(LN_S) $(bindir)/usbhost_@PACKAGE_VERSION@ $(bindir)/usbhost
 
 install-data-hook:
-	chown root $(usbauxdir)/usbchmod
-	chmod u+s $(usbauxdir)/usbchmod
+	if [ `id -u` = 0 ] ; then chown root $(usbauxdir)/usbchmod ; fi
+	if [ `id -u` = 0 ] ; then chmod u+s $(usbauxdir)/usbchmod  ; fi
 
 else
 
 ## When automake scans for hooks it does not take conditionals fully
 ## into account. If the conditional is not satisfied the generated
Index: packages/io/usb/slave/current/host/Makefile.in
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/usb/slave/current/host/Makefile.in,v
retrieving revision 1.6
diff -u -5 -r1.6 Makefile.in
--- packages/io/usb/slave/current/host/Makefile.in	18 Aug 2008 13:34:29 -0000	1.6
+++ packages/io/usb/slave/current/host/Makefile.in	25 Sep 2009 18:11:03 -0000
@@ -658,12 +658,12 @@
 @SUPPORTED_TRUE@	$(INSTALL_PROGRAM) usbhost $(bindir)/usbhost_@PACKAGE_VERSION@
 @SUPPORTED_TRUE@	rm -f $(bindir)/usbhost
 @SUPPORTED_TRUE@	$(LN_S) $(bindir)/usbhost_@PACKAGE_VERSION@ $(bindir)/usbhost
 
 @SUPPORTED_TRUE@install-data-hook:
-@SUPPORTED_TRUE@	chown root $(usbauxdir)/usbchmod
-@SUPPORTED_TRUE@	chmod u+s $(usbauxdir)/usbchmod
+@SUPPORTED_TRUE@	if [ `id -u` = 0 ] ; then chown root $(usbauxdir)/usbchmod ; fi
+@SUPPORTED_TRUE@	if [ `id -u` = 0 ] ; then chmod u+s $(usbauxdir)/usbchmod  ; fi
 
 @SUPPORTED_FALSE@install-exec-hook:
 @SUPPORTED_FALSE@	echo Nothing to be done for this platform
 
 @SUPPORTED_FALSE@install-data-hook:

             reply	other threads:[~2009-09-25 18:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-25 18:28 Paul Chavent [this message]
2009-09-28 20:00 ` Bart Veer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ABD0DD3.1090608@fnac.net \
    --to=paul.chavent@fnac.net \
    --cc=ecos-patches@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).