Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [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 | require kmod.inc |
| 5 | |
| 6 | DEPENDS += "zlib" |
| 7 | PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 8 | RPROVIDES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 9 | RCONFLICTS:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 10 | RREPLACES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | |
| 12 | # to force user to remove old module-init-tools and replace them with kmod variants |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 13 | RCONFLICTS:libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
| 15 | # autotools set prefix to /usr, however we want them in /bin and /sbin |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 16 | EXTRA_OECONF += " --bindir=${base_bindir} --sbindir=${base_sbindir}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 18 | do_install:append () { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | install -dm755 ${D}${base_bindir} |
| 20 | install -dm755 ${D}${base_sbindir} |
| 21 | # add symlinks to kmod |
Patrick Williams | d7e9631 | 2015-09-22 08:09:05 -0500 | [diff] [blame] | 22 | lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | for tool in insmod rmmod depmod modinfo modprobe; do |
Patrick Williams | d7e9631 | 2015-09-22 08:09:05 -0500 | [diff] [blame] | 24 | lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | done |
| 26 | # configuration directories |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 27 | install -dm755 ${D}${nonarch_base_libdir}/depmod.d |
| 28 | install -dm755 ${D}${nonarch_base_libdir}/modprobe.d |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | install -dm755 ${D}${sysconfdir}/depmod.d |
| 30 | install -dm755 ${D}${sysconfdir}/modprobe.d |
| 31 | |
| 32 | # install depmod.d file for search/ dir |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 33 | install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | } |
| 35 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 36 | do_compile:prepend() { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status |
| 38 | } |
| 39 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 40 | inherit update-alternatives bash-completion |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 42 | ALTERNATIVE_PRIORITY = "70" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 44 | ALTERNATIVE:kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | |
| 46 | ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" |
| 47 | ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" |
| 48 | ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" |
| 49 | ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" |
| 50 | ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" |
| 51 | |
| 52 | ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" |
| 53 | ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" |
| 54 | |
| 55 | ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" |
| 56 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 57 | PACKAGES =+ "libkmod" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 59 | FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 60 | FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d" |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 61 | |
| 62 | BBCLASSEXTEND = "nativesdk" |