Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | # Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> |
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) |
| 3 | |
| 4 | SUMMARY = "Tools for managing Linux kernel modules" |
| 5 | DESCRIPTION = "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." |
| 7 | HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kmod/" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 8 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" |
| 9 | LICENSE:libkmod = "LGPL-2.1-or-later" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 10 | SECTION = "base" |
| 11 | |
| 12 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ |
| 13 | file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ |
| 14 | file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \ |
| 15 | " |
| 16 | inherit autotools bash-completion gtk-doc pkgconfig manpages update-alternatives |
| 17 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 18 | SRCREV = "5d46434a63ae0160150a0efdde1914873697e273" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 19 | |
| 20 | SRC_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 \ |
| 23 | " |
| 24 | |
| 25 | S = "${WORKDIR}/git" |
| 26 | |
| 27 | EXTRA_OECONF += "--enable-tools" |
| 28 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 29 | PACKAGECONFIG ??= "zlib xz" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 30 | PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" |
| 31 | PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" |
| 32 | PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" |
| 33 | PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" |
| 34 | PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz" |
| 35 | PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" |
| 36 | PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" |
| 37 | |
| 38 | GTKDOC_DOCDIR = "${S}/libkmod/docs" |
| 39 | |
| 40 | PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 41 | RPROVIDES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 42 | RCONFLICTS:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 43 | RREPLACES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 44 | |
| 45 | # to force user to remove old module-init-tools and replace them with kmod variants |
| 46 | RCONFLICTS:libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 47 | |
| 48 | # autotools set prefix to /usr, however we want them in /bin and /sbin |
| 49 | EXTRA_OECONF += "--bindir=${base_bindir} --sbindir=${base_sbindir}" |
| 50 | |
| 51 | do_install:append () { |
| 52 | install -dm755 ${D}${base_bindir} |
| 53 | install -dm755 ${D}${base_sbindir} |
| 54 | # add symlinks to kmod |
| 55 | ln -rs ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod |
| 56 | for tool in insmod rmmod depmod modinfo modprobe; do |
| 57 | ln -rs ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} |
| 58 | done |
| 59 | # configuration directories |
| 60 | install -dm755 ${D}${nonarch_base_libdir}/depmod.d |
| 61 | install -dm755 ${D}${nonarch_base_libdir}/modprobe.d |
| 62 | install -dm755 ${D}${sysconfdir}/depmod.d |
| 63 | install -dm755 ${D}${sysconfdir}/modprobe.d |
| 64 | |
| 65 | # install depmod.d file for search/ dir |
| 66 | install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf" |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 67 | |
| 68 | # Add .debug to the exclude path for depmod |
| 69 | echo "exclude .debug" > ${D}${nonarch_base_libdir}/depmod.d/exclude.conf |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | ALTERNATIVE_PRIORITY = "70" |
| 73 | |
| 74 | ALTERNATIVE:kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" |
| 75 | |
| 76 | ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" |
| 77 | ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" |
| 78 | ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" |
| 79 | ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" |
| 80 | ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" |
| 81 | ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" |
| 82 | ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" |
| 83 | ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" |
| 84 | |
| 85 | PACKAGES =+ "libkmod" |
| 86 | FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" |
| 87 | FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d" |
| 88 | |
| 89 | BBCLASSEXTEND = "native nativesdk" |