kmod: Fix tool links when BR2_ROOTFS_MERGED_USR
authorChris Lesiak <chris.lesiak@licor.com>
Mon, 26 Oct 2015 13:51:48 +0000 (08:51 -0500)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 26 Oct 2015 16:48:02 +0000 (17:48 +0100)
[Peter: use KMOD_BIN_PATH instead of doubling logic, add comment explaining
why this is needed]
Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/kmod/kmod.mk

index e07e6019e9a6e193e68bdb2001c84eea816e80f0..3742a032dc0e8df5768d727866ddc5448a9bd3ea 100644 (file)
@@ -46,9 +46,16 @@ KMOD_LICENSE_FILES += COPYING
 # take precedence over busybox implementation
 KMOD_DEPENDENCIES += $(if $(BR2_PACKAGE_BUSYBOX),busybox)
 
+# /sbin is really /usr/sbin with merged /usr, so adjust relative symlink
+ifeq ($(BR2_ROOTFS_MERGED_USR),y)
+KMOD_BIN_PATH = ../bin/kmod
+else
+KMOD_BIN_PATH = ../usr/bin/kmod
+endif
+
 define KMOD_INSTALL_TOOLS
        for i in depmod insmod lsmod modinfo modprobe rmmod; do \
-               ln -sf ../usr/bin/kmod $(TARGET_DIR)/sbin/$$i; \
+               ln -sf $(KMOD_BIN_PATH) $(TARGET_DIR)/sbin/$$i; \
        done
 endef