package/kmod: use the correct path for kmod
PATCH 1/1 package/kmod: use the correct path for kmod
Content-Transfer-Encoding: 8bit
kmod install path is always /usr/bin/kmod instead
of /bin/kmod.
So if we link modprobe/lsmod/... to /bin/kmod
We will get error like:
Quoted 2 lines
# modprobe -sh: modprobe: not found
because it points to:
Quoted 2 lines
# ls -liah /sbin/modprobe 2551 lrwxrwxrwx 1 root root 11 Sep 25 10:05 /sbin/modprobe -> ../bin/kmod
and kmod is under /usr/bin/kmod instead of /bin/kmod.
--- package/kmod/kmod.mk | 5 ----- 1 file changed, 5 deletions(-)
package/kmod/kmod.mk +0 -5
@@ -73,12 +73,7 @@ ifeq ($(BR2_PACKAGE_KMOD_TOOLS),y) KMOD_LICENSE += , GPL-2.0+ (tools) KMOD_LICENSE_FILES += COPYING -# /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 \
Signature · 6 lines
2.37.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello,
Quoted 11 lines · On Wed, 12 Oct 2022 09:34:39 +0800 Li Chen<[email protected]> wrote:
Content-Transfer-Encoding: 8bit
kmod install path is always
/usr/bin/kmodinstead
of/bin/kmod.So if we link modprobe/lsmod/... to
/bin/kmodWe will get error like:
Quoted 2 lines
# modprobe -sh: modprobe: not found
Quoted 7 lines
because it points to:
Quoted 2 lines
# ls -liah /sbin/modprobe 2551 lrwxrwxrwx 1 root root 11 Sep 25 10:05 /sbin/modprobe -> ../bin/kmodand kmod is under
/usr/bin/kmodinstead of/bin/kmod.Signed-off-by Li Chen <[email protected]>
Are you testing a BR2_ROOTFS_MERGED_USR enabled or a BR2_ROOTFS_MERGED_USR disabled configuration?
If you're testing a BR2_ROOTFS_MERGED_USR enabled configuration, then the "modprobe" symlink, even if created in /sbin is in fact in /usr/sbin, because /sbin is a symlink to /usr/sbin. So actually the symlink is /usr/sbin/modprobe -> ../bin/kmod, which is correct as kmod is indeed in /usr/bin/kmod.
If you're testing a BR2_ROOTFS_MERGED_USR disabled configuration, then the "modprobe" symlink is really in /sbin, and /sbin/modprobe is a symlink to ../usr/bin/kmod, which is correct.
(Of course, I didn't do a test, so maybe my reasoning is wrong, but the current logic appears correct at first sight).
Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Thomas,
---- On Thu, 13 Oct 2022 04:40:08 +0800 Thomas Petazzoni wrote ---
Quoted 33 lines
Hello,
Quoted 11 lines · On Wed, 12 Oct 2022 09:34:39 +0800 Li [email protected]> wrote:
Content-Transfer-Encoding: 8bit
kmod install path is always
/usr/bin/kmodinstead
of/bin/kmod.So if we link modprobe/lsmod/... to
/bin/kmodWe will get error like:
Quoted 2 lines
# modprobe -sh: modprobe: not foundQuoted 7 lines
because it points to:
Quoted 2 lines
# ls -liah /sbin/modprobe 2551 lrwxrwxrwx 1 root root 11 Sep 25 10:05 /sbin/modprobe -> ../bin/kmodand kmod is under
/usr/bin/kmodinstead of/bin/kmod.Signed-off-by Li Chen [email protected]>Are you testing a
BR2_ROOTFS_MERGED_USRenabled or aBR2_ROOTFS_MERGED_USRdisabled configuration?If you're testing a
BR2_ROOTFS_MERGED_USRenabled configuration, then the "modprobe" symlink, even if created in /sbin is in fact in/usr/sbin, because /sbin is a symlink to/usr/sbin. So actually the symlink is/usr/sbin/modprobe-> ../bin/kmod, which is correct as kmod is indeed in/usr/bin/kmod.
Quoted 6 lines
If you're testing a
BR2_ROOTFS_MERGED_USRdisabled configuration, then the "modprobe" symlink is really in /sbin, and/sbin/modprobeis a symlink to ../usr/bin/kmod, which is correct.(Of course, I didn't do a test, so maybe my reasoning is wrong, but the current logic appears correct at first sight).
Thanks for your reply,
I cannot reproduce this issue now somehow. I will update this thread if I come across it again someday.
Regards,
Li
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot