2013-06-07 12:13:46 +02:00
|
|
|
################################################################################
|
2011-09-17 22:22:58 +02:00
|
|
|
# Linux RTAI extensions
|
|
|
|
#
|
|
|
|
# Patch the linux kernel with RTAI extension
|
2013-06-07 12:13:46 +02:00
|
|
|
################################################################################
|
2011-09-17 22:22:58 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_LINUX_KERNEL_EXT_RTAI),y)
|
|
|
|
# Add dependency to RTAI (user-space) which provide kernel patches
|
|
|
|
LINUX_DEPENDENCIES += rtai-patch
|
|
|
|
|
|
|
|
RTAI_PATCH = $(call qstrip,$(BR2_LINUX_KERNEL_EXT_RTAI_PATCH))
|
|
|
|
|
|
|
|
ifeq ($(KERNEL_ARCH),i386)
|
|
|
|
RTAI_ARCH = x86
|
|
|
|
else ifeq ($(KERNEL_ARCH),x86_64)
|
|
|
|
RTAI_ARCH = x86
|
|
|
|
else ifeq ($(KERNEL_ARCH),powerpc)
|
|
|
|
RTAI_ARCH = ppc
|
|
|
|
else
|
|
|
|
RTAI_ARCH = $(KERNEL_ARCH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Prepare kernel patch
|
|
|
|
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 \
|
2014-10-22 18:20:10 +02:00
|
|
|
$(APPLY_PATCHES) $(LINUX_DIR) \
|
2011-09-17 22:22:58 +02:00
|
|
|
$(RTAI_DIR)/base/arch/$(RTAI_ARCH)/patches/ \
|
|
|
|
hal-linux-$${kver}-*patch ; \
|
|
|
|
else \
|
|
|
|
echo "No RTAI patch for your kernel version" ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
else
|
|
|
|
define RTAI_PREPARE_KERNEL
|
2014-10-22 18:20:10 +02:00
|
|
|
$(APPLY_PATCHES) \
|
2011-09-17 22:22:58 +02:00
|
|
|
$(LINUX_DIR) \
|
|
|
|
$(dir $(RTAI_PATCH)) \
|
|
|
|
$(notdir $(RTAI_PATCH))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2011-09-19 22:10:53 +02:00
|
|
|
LINUX_PRE_PATCH_HOOKS += RTAI_PREPARE_KERNEL
|
2011-09-17 22:22:58 +02:00
|
|
|
|
|
|
|
endif #BR2_LINUX_EXT_RTAI
|