Skip to contentSkip to conversation

Pull request for branch for-2011.11/xeno-rtai-fixes

GIT PULL New Thomas Petazzoni 2 participants 11 messages Sep 19, 2011 – Sep 20, 2011

lore
Share & tools
lore
#0 lore raw

The following changes since commit dcb43a0eb0c09ffb84c6c7b4c169a2874cb24cc9:

barebox: patch-kernel.sh is no more (2011-09-19 10:13:37 +0200)

are available in the git repository at:
http://free-electrons.com/~thomas/buildroot.git for-2011.11/xeno-rtai-fixes

Thomas Petazzoni (5):
package: add a PRE_PATCH_HOOKS hook point rtai, xenomai: use the pre patch hook point
rtai: fix path to apply-patches
rtai: Install modules in /lib/modules/<version>/rtai
xenomai: install in /usr

 linux/linux-ext-rtai.mk     |    6 ++--
 linux/linux-ext-xenomai.mk  |    2 +-
 package/Makefile.package.in |    2 +
 package/rtai/rtai.mk        |    2 +-
 package/xenomai/xenomai.mk  |   54 ++++++++----------------------------------
 5 files changed, 18 insertions(+), 48 deletions(-)

Thanks,

Signature · 1 line
Thomas Petazzoni
#1 lore raw

PATCH 1/5 package: add a PRE_PATCH_HOOKS hook point

This will be useful to integrate Xenomai and RTAI into Buildroot, so that they can patch the kernel before the normal patching process starts.

---
 package/Makefile.package.in |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
package/Makefile.package.in +2 -0
index 66be0a2..e2d0e28 100644
@@ -259,6 +259,7 @@ $(BUILD_DIR)/%/.stamp_extracted:
 $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(BUILD_DIR)/%/.stamp_patched:
 	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
+	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
 	$(if $($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $($(PKG)_PATCH))
 	$(Q)( \
 	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
@@ -443,6 +444,7 @@ $(2)_EXTRACT_CMDS ?= \
 # post-steps hooks
 $(2)_POST_DOWNLOAD_HOOKS        ?=
 $(2)_POST_EXTRACT_HOOKS         ?=
+$(2)_PRE_PATCH_HOOKS            ?=
 $(2)_POST_PATCH_HOOKS           ?=
 $(2)_PRE_CONFIGURE_HOOKS        ?=
 $(2)_POST_CONFIGURE_HOOKS       ?=
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/5 package: add a PRE_PATCH_HOOKS hook point

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> This will be useful to integrate Xenomai and RTAI into Buildroot, so Thomas> that they can patch the kernel before the normal patching process Thomas> starts.

They could presumably use the post-extract hook, but ok - committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 2/5 rtai, xenomai: use the pre patch hook point

In reply to Thomas Petazzoni

The post extract hook point is not really correct as what RTAI and Xenomai extensions are doing is patching the kernel.

The post patch hook point doesn't work, because RTAI and Xenomai patches would be applied *after* all other patches, while it sounds more logical to apply them first, and *then* allow the user to apply some platform/board specific patches if needed.

---
 linux/linux-ext-rtai.mk    |    2 +-
 linux/linux-ext-xenomai.mk |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
linux/linux-ext-rtai.mk +1 -1
index a54230d..150f9e8 100644
@@ -42,6 +42,6 @@ define RTAI_PREPARE_KERNEL
 endef
 endif
 
-LINUX_POST_PATCH_HOOKS += RTAI_PREPARE_KERNEL
+LINUX_PRE_PATCH_HOOKS += RTAI_PREPARE_KERNEL
 
 endif #BR2_LINUX_EXT_RTAI
linux/linux-ext-xenomai.mk +1 -1
index e855ded..9b6772e 100644
@@ -25,6 +25,6 @@ define XENOMAI_PREPARE_KERNEL
 		--verbose
 endef
 
-LINUX_POST_EXTRACT_HOOKS += XENOMAI_PREPARE_KERNEL
+LINUX_PRE_PATCH_HOOKS += XENOMAI_PREPARE_KERNEL
 
 endif #BR2_LINUX_EXT_XENOMAI
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH 2/5 rtai, xenomai: use the pre patch hook point

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> The post extract hook point is not really correct as what RTAI and Thomas> Xenomai extensions are doing is patching the kernel.

Thomas> The post patch hook point doesn't work, because RTAI and Xenomai Thomas> patches would be applied *after* all other patches, while it sounds Thomas> more logical to apply them first, and *then* allow the user to apply Thomas> some platform/board specific patches if needed.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 3/5 rtai: fix path to apply-patches

In reply to Thomas Petazzoni
---
 linux/linux-ext-rtai.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
linux/linux-ext-rtai.mk +2 -2
index 150f9e8..78488af 100644
@@ -25,7 +25,7 @@ ifeq ($(RTAI_PATCH),)
 define RTAI_PREPARE_KERNEL
 	kver=`$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelversion` ; \
 	if test -f $(RTAI_DIR)/base/arch/$(RTAI_ARCH)/patches/hal-linux-$${kver}-*patch ; then \
-		support/script/apply-patches.sh $(LINUX_DIR) 		\
+		support/scripts/apply-patches.sh $(LINUX_DIR) 		\
 			$(RTAI_DIR)/base/arch/$(RTAI_ARCH)/patches/ 	\
 			hal-linux-$${kver}-*patch ; \
 	else \
@@ -35,7 +35,7 @@ define RTAI_PREPARE_KERNEL
 endef
 else
 define RTAI_PREPARE_KERNEL
-	support/script/apply-patches.sh 	\
+	support/scripts/apply-patches.sh 	\
 		$(LINUX_DIR)			\
 		$(dir $(RTAI_PATCH))		\
 		$(notdir $(RTAI_PATCH))
Signature · 1 line
1.7.4.1
#6 lore raw

PATCH 3/5 rtai: fix path to apply-patches

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Signed-off-by: Thomas Petazzoni <[email protected]> Thomas> ---

 Thomas>  linux/linux-ext-rtai.mk |    4 ++--

Thomas> 1 files changed, 2 insertions(+), 2 deletions(-)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH 4/5 rtai: Install modules in /lib/modules/<version>/rtai

In reply to Thomas Petazzoni

The /lib/modules/<version>/kernel/ is completely rewritten by the kernel module installation, so third party modules should be outside of this directory.

---
 package/rtai/rtai.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
package/rtai/rtai.mk +1 -1
index abba614..a4a69f9 100644
@@ -8,7 +8,7 @@ RTAI_CONF_OPT = \
 	--with-linux-dir=$(LINUX_DIR) 	\
 	--disable-leds		      	\
 	--disable-rtailab		\
-	--with-module-dir=/lib/modules/$(LINUX_VERSION_PROBED)/kernel/rtai
+	--with-module-dir=/lib/modules/$(LINUX_VERSION_PROBED)/rtai
 
 RTAI_MAKE = $(MAKE1)
 
Signature · 1 line
1.7.4.1
#8 lore raw

PATCH 4/5 rtai: Install modules in /lib/modules/<version>/rtai

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> The /lib/modules/<version>/kernel/ is completely rewritten by the Thomas> kernel module installation, so third party modules should be outside Thomas> of this directory.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#9 lore raw

PATCH 5/5 xenomai: install in /usr

In reply to Thomas Petazzoni

By default, Xenomai installs everything with --prefix=/usr/xenomai, and passing --prefix=/usr doesn't work because installing Xenomai headers in /usr/include creates conflicts with other headers. However, passing --prefix=/usr and --includedir=/usr/include/xenomai just works fine. This allows to use the default configure command of the AUTOTARGETS infrastructure, and allows to install the Xenomai headers and libraries into more usual locations. Furthermore, it allows to remove the documentation/headers removal hooks, as well as the ld.so.conf hook since now everything is installed in standard locations.

---
 package/xenomai/xenomai.mk |   54 +++++++++-----------------------------------
 1 files changed, 11 insertions(+), 43 deletions(-)
package/xenomai/xenomai.mk +11 -43
index 52e0b4e..d2306c4 100644
@@ -28,34 +28,12 @@ ifeq ($(BR2_PACKAGE_XENOMAI_SMP),y)
 XENOMAI_CONF_OPT += --enable-smp
 endif
 
-# The configure step needs to be overloaded, because Xenomai doesn't
-# support --prefix=/usr and the autotargets infrastructure enforces
-# this.
-define XENOMAI_CONFIGURE_CMDS
-	(cd $(@D); rm -rf config.cache; \
-		$(TARGET_CONFIGURE_OPTS) \
-		$(TARGET_CONFIGURE_ARGS) \
-		CCFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
-		./configure \
-		$(XENOMAI_CONF_OPT) \
-		--host=$(GNU_TARGET_NAME) \
-	)
-endef
-
-ifeq ($(BR2_HAVE_DOCUMENTATION),)
-define XENOMAI_REMOVE_DOCUMENTATION
-	rm -rf $(TARGET_DIR)/usr/xenomai/share/doc
-	rm -rf $(TARGET_DIR)/usr/xenomai/share/man
-endef
-
-XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_DOCUMENTATION
-endif
+XENOMAI_CONF_OPT += --includedir=/usr/include/xenomai/
 
 ifeq ($(BR2_HAVE_DEVFILES),)
 define XENOMAI_REMOVE_DEVFILES
-	rm -rf $(TARGET_DIR)/usr/xenomai/include
 	for i in xeno-config xeno-info wrap-link.sh ; do \
-		rm -f $(TARGET_DIR)/usr/xenomai/bin/$$i ; \
+		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
 	done
 endef
 
@@ -64,15 +42,13 @@ endif
 
 ifeq ($(BR2_PACKAGE_XENOMAI_TESTSUITE),)
 define XENOMAI_REMOVE_TESTSUITE
-	rm -rf $(TARGET_DIR)/usr/xenomai/share/xenomai/testsuite/
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/xenomai/share/xenomai/
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/xenomai/share/
+	rm -rf $(TARGET_DIR)/usr/share/xenomai/
 	for i in klatency rtdm xeno xeno-load check-vdso \
 		irqloop cond-torture-posix switchtest arith \
 		sigtest clocktest cyclictest latency wakeup-time \
 		xeno-test cond-torture-native mutex-torture-posix \
 		mutex-torture-native ; do \
-		rm -f $(TARGET_DIR)/usr/xenomai/bin/$$i ; \
+		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
 	done
 endef
 
@@ -82,9 +58,9 @@ endif
 ifeq ($(BR2_PACKAGE_XENOMAI_RTCAN),)
 define XENOMAI_REMOVE_RTCAN_PROGS
 	for i in rtcanrecv rtcansend ; do \
-		rm -f $(TARGET_DIR)/usr/xenomai/bin/$$i ; \
+		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
 	done
-	rm -f $(TARGET_DIR)/usr/xenomai/sbin/rtcanconfig
+	rm -f $(TARGET_DIR)/usr/sbin/rtcanconfig
 endef
 
 XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_RTCAN_PROGS
@@ -94,10 +70,10 @@ ifeq ($(BR2_PACKAGE_XENOMAI_ANALOGY),)
 define XENOMAI_REMOVE_ANALOGY
 	for i in cmd_bits cmd_read cmd_write insn_write \
 		insn_bits insn_read ; do \
-		rm -f $(TARGET_DIR)/usr/xenomai/bin/$$i ; \
+		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
 	done
-	rm -f $(TARGET_DIR)/usr/xenomai/sbin/analogy_config
-	rm -f $(TARGET_DIR)/usr/xenomai/lib/libanalogy.*
+	rm -f $(TARGET_DIR)/usr/sbin/analogy_config
+	rm -f $(TARGET_DIR)/usr/lib/libanalogy.*
 endef
 
 XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_ANALOGY
@@ -113,23 +89,15 @@ XENOMAI_REMOVE_SKIN_LIST += $(if $(BR2_PACKAGE_XENOMAI_VRTX_SKIN),,vrtx)
 
 define XENOMAI_REMOVE_SKINS
 	for i in $(XENOMAI_REMOVE_SKIN_LIST) ; do \
-		rm -f $(TARGET_DIR)/usr/xenomai/lib/lib$$i.* ; \
+		rm -f $(TARGET_DIR)/usr/lib/lib$$i.* ; \
 		if [ $$i == "posix" ] ; then \
-			rm -f $(TARGET_DIR)/usr/xenomai/lib/posix.wrappers ; \
+			rm -f $(TARGET_DIR)/usr/lib/posix.wrappers ; \
 		fi ; \
 	done
 endef
 
 XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_SKINS
 
-define XENOMAI_ADD_LD_SO_CONF
-	# Add /usr/xenomai/lib in the library search path
-	grep -q "^/usr/xenomai/lib" $(TARGET_DIR)/etc/ld.so.conf || \
-		echo "/usr/xenomai/lib" >> $(TARGET_DIR)/etc/ld.so.conf
-endef
-
-XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_ADD_LD_SO_CONF
-
 # If you use static /dev creation don't forget to update your
 #  device_table_dev.txt
 ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV),y)
Signature · 1 line
1.7.4.1
#10 lore raw

PATCH 5/5 xenomai: install in /usr

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> By default, Xenomai installs everything with --prefix=/usr/xenomai, Thomas> and passing --prefix=/usr doesn't work because installing Xenomai Thomas> headers in /usr/include creates conflicts with other headers. However, Thomas> passing --prefix=/usr and --includedir=/usr/include/xenomai just works Thomas> fine. This allows to use the default configure command of the Thomas> AUTOTARGETS infrastructure, and allows to install the Xenomai headers Thomas> and libraries into more usual locations. Furthermore, it allows to Thomas> remove the documentation/headers removal hooks, as well as the Thomas> ld.so.conf hook since now everything is installed in standard Thomas> locations.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard