summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-21 16:19:18 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 10:45:33 +0100
commit5879e0d3a2b3a6d000e33cadf4407c38ae1eb1ab (patch)
tree85fb5c49d989a83d74a8d8a2775f0adfaf5cb98b
parentc32dca4013d851aeb9d661a25cab81daf213121f (diff)
downloadopenembedded-core-5879e0d3a2b3a6d000e33cadf4407c38ae1eb1ab.tar.gz
openembedded-core-5879e0d3a2b3a6d000e33cadf4407c38ae1eb1ab.tar.bz2
openembedded-core-5879e0d3a2b3a6d000e33cadf4407c38ae1eb1ab.zip
kmod: use new update-alternatives
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-rw-r--r--meta/recipes-kernel/kmod/kmod_git.bb39
1 files changed, 18 insertions, 21 deletions
diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb
index fd38d87978..c379a8d142 100644
--- a/meta/recipes-kernel/kmod/kmod_git.bb
+++ b/meta/recipes-kernel/kmod/kmod_git.bb
@@ -3,7 +3,7 @@
require kmod.inc
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
@@ -22,9 +22,9 @@ do_install_append () {
install -dm755 ${D}${base_bindir}
install -dm755 ${D}${base_sbindir}
# add symlinks to kmod
- ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod.kmod
+ ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod
for tool in {ins,rm,dep}mod mod{info,probe}; do
- ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}.kmod
+ ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}
done
# configuration directories
install -dm755 ${D}${base_libdir}/depmod.d
@@ -36,25 +36,22 @@ do_install_append () {
install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
}
-pkg_postinst_kmod() {
- for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/modinfo; do
- bn=`basename $f`
- update-alternatives --install /$f $bn /$f.kmod 60
- done
- update-alternatives --install /bin/lsmod bin-lsmod /bin/lsmod.kmod 60
- update-alternatives --install /sbin/lsmod lsmod /bin/lsmod.kmod 60
- update-alternatives --install /sbin/depmod depmod /sbin/depmod.kmod 60
-}
+inherit update-alternatives
-pkg_prerm_kmod() {
- for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/modinfo; do
- bn=`basename $f`
- update-alternatives --remove $bn /$f.kmod
- done
- update-alternatives --remove bin-lsmod /bin/lsmod.kmod
- update-alternatives --remove lsmod /bin/lsmod.kmod
- update-alternatives --remove depmod /sbin/depmod.kmod
-}
+ALTERNATIVE_PRIORITY = "60"
+
+ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
+
+ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
+ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
+ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
+ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
+ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
+
+ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
+ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
+
+ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
PACKAGES =+ "libkmod"