blob: 69185b2453b631267d6813333a156e3576e570e9 [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
16bindir = "${base_bindir}"
17sbindir = "${base_sbindir}"
18# libdir = "${base_libdir}"
19
20do_install_append () {
21 install -dm755 ${D}${base_bindir}
22 install -dm755 ${D}${base_sbindir}
23 # add symlinks to kmod
Patrick Williamsd7e96312015-09-22 08:09:05 -050024 lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025 for tool in insmod rmmod depmod modinfo modprobe; do
Patrick Williamsd7e96312015-09-22 08:09:05 -050026 lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027 done
28 # configuration directories
29 install -dm755 ${D}${base_libdir}/depmod.d
30 install -dm755 ${D}${base_libdir}/modprobe.d
31 install -dm755 ${D}${sysconfdir}/depmod.d
32 install -dm755 ${D}${sysconfdir}/modprobe.d
33
34 # install depmod.d file for search/ dir
35 install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
36}
37
38do_compile_prepend() {
39 sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
40}
41
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042inherit update-alternatives bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043
44ALTERNATIVE_PRIORITY = "60"
45
46ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
47
48ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
49ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
50ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
51ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
52ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
53
54ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
55ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
56
57ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
58
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050059PACKAGES =+ "libkmod"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060
61FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
62FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"