Skip to contentSkip to conversation

kmod: Fix tool links when BR2_ROOTFS_MERGED_USR

PATCH New Chris Lesiak 2 participants 2 messages Oct 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kmod: Fix tool links when BR2_ROOTFS_MERGED_USR

#1 lore raw

PATCH 1/1 kmod: Fix tool links when BR2_ROOTFS_MERGED_USR

Quoted 17 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Chris" == Chris Lesiak <[email protected]> writes:

From 259a889fc3eb5196a9b69a624effe56b9e6dcfeb Mon Sep 17 00:00:00 2001

From: Chris Lesiak <[email protected]>
Date: Mon, 26 Oct 2015 08:51:48 -0500
Subject: [PATCH] kmod: Fix tool links when BR2_ROOTFS_MERGED_USR

---
 package/kmod/kmod.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/kmod/kmod.mk +0 -0
index e07e601..84ef7c3 100644

package/kmod/kmod.mk KMOD_LICENSE_FILES += COPYING · line 47

Quoted 2 lines
package/kmod/kmod.mk +0 -0
@@ -46,11 +46,19 @@ KMOD_LICENSE_FILES += COPYING
 # take precedence over busybox implementation
 KMOD_DEPENDENCIES += $(if $(BR2_PACKAGE_BUSYBOX),busybox)

I was a bit confused that things didn't work as ../usr/bin/kmod seems a sensible path from /sbin, but the symlink is resolved first so it really starts from /usr/sbin.

package/kmod/kmod.mk KMOD_LICENSE_FILES += COPYING · line 60

Quoted 13 lines
package/kmod/kmod.mk +8 -0
+ifeq ($(BR2_ROOTFS_MERGED_USR),y)
+define KMOD_INSTALL_TOOLS
+	for i in depmod insmod lsmod modinfo modprobe rmmod; do \
+		ln -sf ../bin/kmod $(TARGET_DIR)/usr/sbin/$$i; \
+	done
+endef
+else
 define KMOD_INSTALL_TOOLS
 	for i in depmod insmod lsmod modinfo modprobe rmmod; do \
 		ln -sf ../usr/bin/kmod $(TARGET_DIR)/sbin/$$i; \
 	done
 endef
+endif

Instead of having the logic twice with the risks of getting them out of sync in the future, I've instead added a KMOD_BIN_PATH (that is either ../bin/kmod or ../usr/bin/kmod) and used that.

There isn't really any good reason to use $(TARGET_DIR)/usr/sbin/$$i over $(TARGET_DIR/sbin/$$i as ln follows the symlink, so I've left that as is.

Committed with those changes, thanks.

Signature · 1 line
Bye, Peter Korsgaard