summaryrefslogtreecommitdiffstats
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 12:04:44 +0100
commit9a686b3481cc1080868e66bbed4d8beb53f1cafa (patch)
treea872c60c64193d63b732b461be81d6e59e5ce982
parentc17ae6f07b4e897e87df6ac7d76daa5bd0fc3995 (diff)
downloadpoky-9a686b3481cc1080868e66bbed4d8beb53f1cafa.tar.gz
kmod: use new update-alternatives
(From OE-Core rev: 5879e0d3a2b3a6d000e33cadf4407c38ae1eb1ab) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 @@
3 3
4require kmod.inc 4require kmod.inc
5 5
6PR = "${INC_PR}.2" 6PR = "${INC_PR}.3"
7 7
8PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" 8PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
9RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" 9RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
@@ -22,9 +22,9 @@ do_install_append () {
22 install -dm755 ${D}${base_bindir} 22 install -dm755 ${D}${base_bindir}
23 install -dm755 ${D}${base_sbindir} 23 install -dm755 ${D}${base_sbindir}
24 # add symlinks to kmod 24 # add symlinks to kmod
25 ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod.kmod 25 ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod
26 for tool in {ins,rm,dep}mod mod{info,probe}; do 26 for tool in {ins,rm,dep}mod mod{info,probe}; do
27 ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}.kmod 27 ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}
28 done 28 done
29 # configuration directories 29 # configuration directories
30 install -dm755 ${D}${base_libdir}/depmod.d 30 install -dm755 ${D}${base_libdir}/depmod.d
@@ -36,25 +36,22 @@ do_install_append () {
36 install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf" 36 install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
37} 37}
38 38
39pkg_postinst_kmod() { 39inherit update-alternatives
40 for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/modinfo; do
41 bn=`basename $f`
42 update-alternatives --install /$f $bn /$f.kmod 60
43 done
44 update-alternatives --install /bin/lsmod bin-lsmod /bin/lsmod.kmod 60
45 update-alternatives --install /sbin/lsmod lsmod /bin/lsmod.kmod 60
46 update-alternatives --install /sbin/depmod depmod /sbin/depmod.kmod 60
47}
48 40
49pkg_prerm_kmod() { 41ALTERNATIVE_PRIORITY = "60"
50 for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/modinfo; do 42
51 bn=`basename $f` 43ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
52 update-alternatives --remove $bn /$f.kmod 44
53 done 45ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
54 update-alternatives --remove bin-lsmod /bin/lsmod.kmod 46ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
55 update-alternatives --remove lsmod /bin/lsmod.kmod 47ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
56 update-alternatives --remove depmod /sbin/depmod.kmod 48ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
57} 49ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
50
51ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
52ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
53
54ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
58 55
59PACKAGES =+ "libkmod" 56PACKAGES =+ "libkmod"
60 57