diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2012-05-21 16:19:18 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 12:04:44 +0100 |
commit | 9a686b3481cc1080868e66bbed4d8beb53f1cafa (patch) | |
tree | a872c60c64193d63b732b461be81d6e59e5ce982 | |
parent | c17ae6f07b4e897e87df6ac7d76daa5bd0fc3995 (diff) | |
download | poky-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.bb | 39 |
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 | ||
4 | require kmod.inc | 4 | require kmod.inc |
5 | 5 | ||
6 | PR = "${INC_PR}.2" | 6 | PR = "${INC_PR}.3" |
7 | 7 | ||
8 | PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | 8 | PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" |
9 | RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | 9 | RPROVIDES_${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 | ||
39 | pkg_postinst_kmod() { | 39 | inherit 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 | ||
49 | pkg_prerm_kmod() { | 41 | ALTERNATIVE_PRIORITY = "60" |
50 | for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/modinfo; do | 42 | |
51 | bn=`basename $f` | 43 | ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" |
52 | update-alternatives --remove $bn /$f.kmod | 44 | |
53 | done | 45 | ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" |
54 | update-alternatives --remove bin-lsmod /bin/lsmod.kmod | 46 | ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" |
55 | update-alternatives --remove lsmod /bin/lsmod.kmod | 47 | ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" |
56 | update-alternatives --remove depmod /sbin/depmod.kmod | 48 | ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" |
57 | } | 49 | ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" |
50 | |||
51 | ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" | ||
52 | ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" | ||
53 | |||
54 | ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" | ||
58 | 55 | ||
59 | PACKAGES =+ "libkmod" | 56 | PACKAGES =+ "libkmod" |
60 | 57 | ||