moves and extends the current facilities, which have been
added some time ago for the the usbip utility, to support
more utilites that are shipped with the Linux kernel tree
to the SDK.
this allows to drop all the hand-waving and code for
failed previous attempts to mitigate the SDK build failures.
Fixes: bdaaf66e28bd ("utils/spidev_test: build package directly from Linux")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
PKG_NAME:=spidev-test
PKG_RELEASE:=$(LINUX_VERSION)
PKG_NAME:=spidev-test
PKG_RELEASE:=$(LINUX_VERSION)
PKG_BUILD_DIR:=$(LINUX_DIR)/tools/spi-$(TARGET_DIR_NAME)
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DIR:=$(LINUX_DIR)/tools/spi-$(TARGET_DIR_NAME)
PKG_BUILD_PARALLEL:=1
define Package/spidev-test
SECTION:=utils
CATEGORY:=Utilities
define Package/spidev-test
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=+PACKAGE_kmod-spi-dev:kmod-spi-dev @!IN_SDK
TITLE:=SPI testing utility
VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
URL:=http://www.kernel.org
TITLE:=SPI testing utility
VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
URL:=http://www.kernel.org
endef
define Build/Prepare
endef
define Build/Prepare
+ # For SDK: Sources are copied by target/sdk/Makefile's
+ # USERSPACE_UTILS(_FILES)
$(CP) $(LINUX_DIR)/tools/spi/* $(PKG_BUILD_DIR)/
endef
$(CP) $(LINUX_DIR)/tools/spi/* $(PKG_BUILD_DIR)/
endef
KERNEL_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(KERNEL_FILES_BASE))))
KERNEL_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(KERNEL_FILES_BASE))))
+# The kernel source hosts various userspace utilities sources.
+# These are packaged separately from the kernel and kernel modules.
+# The source has to be included here to be buildable by the SDK.
+#
+USERSPACE_UTILS_FILES := \
+ tools/build \
+ tools/scripts \
+ tools/usb/usbip \
+ tools/spi
+
+USERSPACE_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(USERSPACE_UTILS_FILES))))
+
all: compile
$(BIN_DIR)/$(SDK_NAME).tar.xz: clean
all: compile
$(BIN_DIR)/$(SDK_NAME).tar.xz: clean
$(SDK_DIRS) $(KERNEL_FILES) | \
$(TAR) -xf - -C $(SDK_BUILD_DIR)
$(SDK_DIRS) $(KERNEL_FILES) | \
$(TAR) -xf - -C $(SDK_BUILD_DIR)
- # Copy usbip sources, this is required for the usbip userspace packages to be buildable by the SDK.
- $(TAR) -cf - -C $(TOPDIR) $(KDIR_BASE)/tools/usb/usbip/ | \
+ $(TAR) -cf - -C $(TOPDIR) $(USERSPACE_FILES) | \
$(TAR) -xf - -C $(SDK_BUILD_DIR)
(cd $(SDK_BUILD_DIR); find $(STAGING_SUBDIR_HOST)/bin $(STAGING_SUBDIR_HOST)/usr/bin \
$(TAR) -xf - -C $(SDK_BUILD_DIR)
(cd $(SDK_BUILD_DIR); find $(STAGING_SUBDIR_HOST)/bin $(STAGING_SUBDIR_HOST)/usr/bin \