blob: bd21d2ff7318fe3c3000176d8dee043ce29f7275 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require kmod.inc
5
6DEPENDS += "zlib"
7PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
8RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
9RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
10RREPLACES_${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
13RCONFLICTS_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 Bishop1a4b7ee2018-12-16 17:11:34 -080016EXTRA_OECONF += " --bindir=${base_bindir} --sbindir=${base_sbindir}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
18do_install_append () {
19 install -dm755 ${D}${base_bindir}
20 install -dm755 ${D}${base_sbindir}
21 # add symlinks to kmod
Patrick Williamsd7e96312015-09-22 08:09:05 -050022 lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023 for tool in insmod rmmod depmod modinfo modprobe; do
Patrick Williamsd7e96312015-09-22 08:09:05 -050024 lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025 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
36do_compile_prepend() {
37 sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
38}
39
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050040inherit update-alternatives bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080042ALTERNATIVE_PRIORITY = "70"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043
44ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
45
46ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
47ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
48ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
49ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
50ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
51
52ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
53ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
54
55ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
56
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050057PACKAGES =+ "libkmod"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058
59FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
60FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"