blob: 9b6634906669f7e2dcf05984bcdf343ce638d8f7 [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMMARY = "Tools for managing Linux kernel modules"
5DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \
6 insert, remove, list, check properties, resolve dependencies and aliases."
7HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kmod/"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00008LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
9LICENSE:libkmod = "LGPL-2.1-or-later"
Andrew Geissler595f6302022-01-24 19:11:47 +000010SECTION = "base"
11
12LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
13 file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
14 file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \
15 "
16inherit autotools bash-completion gtk-doc pkgconfig manpages update-alternatives
17
18SRCREV = "b6ecfc916a17eab8f93be5b09f4e4f845aabd3d1"
19
20SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master \
21 file://depmod-search.conf \
22 file://avoid_parallel_tests.patch \
Patrick Williamsde0582f2022-04-08 10:23:27 -050023 file://0001-depmod-Add-support-for-excluding-a-directory.patch \
Andrew Geissler595f6302022-01-24 19:11:47 +000024 "
25
26S = "${WORKDIR}/git"
27
28EXTRA_OECONF += "--enable-tools"
29
30PACKAGECONFIG ??= "zlib"
31PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
32PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
33PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
34PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
35PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz"
36PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
37PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
38
39GTKDOC_DOCDIR = "${S}/libkmod/docs"
40
41PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
42RPROVIDES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
43RCONFLICTS:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
44RREPLACES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
45
46# to force user to remove old module-init-tools and replace them with kmod variants
47RCONFLICTS:libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
48
49# autotools set prefix to /usr, however we want them in /bin and /sbin
50EXTRA_OECONF += "--bindir=${base_bindir} --sbindir=${base_sbindir}"
51
52do_install:append () {
53 install -dm755 ${D}${base_bindir}
54 install -dm755 ${D}${base_sbindir}
55 # add symlinks to kmod
56 ln -rs ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
57 for tool in insmod rmmod depmod modinfo modprobe; do
58 ln -rs ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
59 done
60 # configuration directories
61 install -dm755 ${D}${nonarch_base_libdir}/depmod.d
62 install -dm755 ${D}${nonarch_base_libdir}/modprobe.d
63 install -dm755 ${D}${sysconfdir}/depmod.d
64 install -dm755 ${D}${sysconfdir}/modprobe.d
65
66 # install depmod.d file for search/ dir
67 install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf"
Patrick Williamsde0582f2022-04-08 10:23:27 -050068
69 # Add .debug to the exclude path for depmod
70 echo "exclude .debug" > ${D}${nonarch_base_libdir}/depmod.d/exclude.conf
Andrew Geissler595f6302022-01-24 19:11:47 +000071}
72
73ALTERNATIVE_PRIORITY = "70"
74
75ALTERNATIVE:kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
76
77ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
78ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
79ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
80ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
81ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
82ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
83ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
84ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
85
86PACKAGES =+ "libkmod"
87FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
88FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d"
89
90BBCLASSEXTEND = "native nativesdk"