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" |
| 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" |
| 11 | |
| 12 | # to force user to remove old module-init-tools and replace them with kmod variants |
| 13 | RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
| 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 | |
| 18 | do_install_append () { |
| 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 |
| 27 | install -dm755 ${D}${base_libdir}/depmod.d |
| 28 | install -dm755 ${D}${base_libdir}/modprobe.d |
| 29 | install -dm755 ${D}${sysconfdir}/depmod.d |
| 30 | install -dm755 ${D}${sysconfdir}/modprobe.d |
| 31 | |
| 32 | # install depmod.d file for search/ dir |
| 33 | install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf" |
| 34 | } |
| 35 | |
| 36 | do_compile_prepend() { |
| 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 | |
| 44 | ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" |
| 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 | |
| 59 | FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" |
| 60 | FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d" |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 61 | |
| 62 | BBCLASSEXTEND = "nativesdk" |