1 ################################################################################
5 ################################################################################
8 KMOD_SOURCE
= kmod-
$(KMOD_VERSION
).
tar.xz
9 KMOD_SITE
= $(BR2_KERNEL_MIRROR
)/linux
/utils
/kernel
/kmod
10 KMOD_INSTALL_STAGING
= YES
11 KMOD_DEPENDENCIES
= host-pkgconf
12 HOST_KMOD_DEPENDENCIES
= host-pkgconf
14 # license info for libkmod only, conditionally add more below
15 KMOD_LICENSE
= LGPLv2.1
+ (library
)
16 KMOD_LICENSE_FILES
= libkmod
/COPYING
18 # --gc-sections triggers binutils ld segfault
19 # https://sourceware.org/bugzilla/show_bug.cgi?id=21180
20 ifeq ($(BR2_microblaze
),y
)
21 KMOD_CONF_ENV
+= cc_cv_LDFLAGS__Wl___gc_sections
=false
24 # static linking not supported, see
25 # https://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/?id=b7016153ec8
26 KMOD_CONF_OPTS
= --disable-static
--enable-shared
28 KMOD_CONF_OPTS
+= --disable-manpages
29 HOST_KMOD_CONF_OPTS
= --disable-manpages
31 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
32 KMOD_DEPENDENCIES
+= zlib
33 KMOD_CONF_OPTS
+= --with-zlib
36 ifeq ($(BR2_PACKAGE_XZ
),y
)
37 KMOD_DEPENDENCIES
+= xz
38 KMOD_CONF_OPTS
+= --with-xz
41 ifeq ($(BR2_PACKAGE_PYTHON
)$(BR2_PACKAGE_PYTHON3
),y
)
42 KMOD_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_PYTHON
),python
,python3
)
43 KMOD_CONF_OPTS
+= --enable-python
46 ifeq ($(BR2_PACKAGE_KMOD_TOOLS
),y
)
48 # add license info for kmod tools
49 KMOD_LICENSE
:= $(KMOD_LICENSE
), GPLv2
+ (tools
)
50 KMOD_LICENSE_FILES
+= COPYING
52 # take precedence over busybox implementation
53 KMOD_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_BUSYBOX
),busybox
)
55 # /sbin is really /usr/sbin with merged /usr, so adjust relative symlink
56 ifeq ($(BR2_ROOTFS_MERGED_USR
),y
)
57 KMOD_BIN_PATH
= ..
/bin
/kmod
59 KMOD_BIN_PATH
= ..
/usr
/bin
/kmod
62 define KMOD_INSTALL_TOOLS
63 for i in depmod insmod lsmod modinfo modprobe rmmod
; do \
64 ln
-sf
$(KMOD_BIN_PATH
) $(TARGET_DIR
)/sbin
/$$i; \
68 KMOD_POST_INSTALL_TARGET_HOOKS
+= KMOD_INSTALL_TOOLS
70 KMOD_CONF_OPTS
+= --disable-tools
73 # We only install depmod, since that's the only tool used for the
75 define HOST_KMOD_INSTALL_TOOLS
76 mkdir
-p
$(HOST_DIR
)/sbin
/
77 ln
-sf ..
/usr
/bin
/kmod
$(HOST_DIR
)/sbin
/depmod
80 HOST_KMOD_POST_INSTALL_HOOKS
+= HOST_KMOD_INSTALL_TOOLS
82 $(eval
$(autotools-package
))
83 $(eval
$(host-autotools-package
))