Skip to contentSkip to conversation

automake: add a conditionnal to rt devices install

PATCH In review Thierry Bultel 2 participants 3 messages Feb 15, 2017 – Feb 16, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 automake: add a conditionnal to rt devices install

When cross building from a build system (like buildroot), it is not convenient to get the sudo prompt for the installation of cobalt rt devices.
Calling mknod is the responsibility of the build system, that will perform it under a fakeroot environnement
The fix simply checks the existence of NO_RT_DEVICES environment that can be set when bootstrapping

---
 Makefile.am  | 2 ++
 configure.ac | 2 ++
 2 files changed, 4 insertions(+)
Makefile.am +2 -0
index eb3b147..3493bb1 100644
@@ -33,6 +33,7 @@ dist-hook:
 
 dev devices:
 if XENO_COBALT
+if !NO_RT_DEVICES
 	@$(mkinstalldirs) $(DESTDIR)/dev; \
 	if test x`id -u` = x0; then \
 	   sudo= ; \
@@ -69,6 +70,7 @@ echo '*** privileges.' ; \
 	   fi ; \
 	done
 endif
+endif
 
 install-exec-local: devices
 
configure.ac +2 -0
index 83bc809..b7a04c0 100644
@@ -48,6 +48,8 @@ AC_ARG_WITH(core,
     ])
 AC_MSG_RESULT($rtcore_type)
 
+AM_CONDITIONAL(NO_RT_DEVICES,[test x$NO_RT_DEVICES != x])
+
 AM_CONDITIONAL(XENO_COBALT,[test x$rtcore_type = xcobalt])
 test x$rtcore_type = xcobalt && AC_DEFINE(CONFIG_XENO_COBALT,1,[config])
 AM_CONDITIONAL(XENO_MERCURY,[test x$rtcore_type = xmercury])
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · Thierry Bultel

When cross building from a build system (like buildroot), it is not convenient to get the sudo prompt for the installation of cobalt rt devices.
Calling mknod is the responsibility of the build system, that will perform it under a fakeroot environnement
The fix simply checks the existence of NO_RT_DEVICES environment that can be set when bootstrapping

Quoted 5 lines
---
 Makefile.am  | 2 ++
 configure.ac | 2 ++
 2 files changed, 4 insertions(+)

Thanks, however this is duplicating an existing mechanism:

$ make SUDO=false install

see install-user rule in the toplevel Makefile.

This said, Xenomai 3 expects udev/mdev to be enabled, so most of the devices rule in that Makefile is useless now; at least the install rule should not implicitly chain to it via install-exec-local.

Signature · 1 line
Philippe.
#2 lore raw
Quoted 16 lines · Philippe Gerum
Quoted 7 lines · Thierry Bultel

When cross building from a build system (like buildroot), it is not convenient to get the sudo prompt for the installation of cobalt rt devices.
Calling mknod is the responsibility of the build system, that will perform it under a fakeroot environnement
The fix simply checks the existence of NO_RT_DEVICES environment that can be set when bootstrapping

Quoted 5 lines
---
 Makefile.am  | 2 ++
 configure.ac | 2 ++
 2 files changed, 4 insertions(+)

Thanks, however this is duplicating an existing mechanism:

Quoted 8 lines
$ make SUDO=false install

see install-user rule in the toplevel Makefile.

This said, Xenomai 3 expects udev/mdev to be enabled, so most of the devices rule in that Makefile is useless now; at least the install rule should not implicitly chain to it via install-exec-local.

Thanks,
sorry to have missed that