mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 21:52:39 +02:00
* PROVIDES does not need _${PN}
* CONFLICTS should be RCONFLICTS
* opkg needs RREPLACES to automatically remove older module-init-tools
instead of just reporting it conflicts with kmod
SHR root@gjama ~ $ opkg install kmod
Installing kmod (7+git02629fa02e96763db7460a930239cc93649a52f8-r0.0) to root...
Downloading http://jama.dyndns-home.com/org.openembedded.shr-core//armv4t/kmod_7+git02629fa02e96763db7460a930239cc93649a52f8-r0.0_armv4t.ipk.
Removing package module-init-tools-depmod from root...
update-alternatives: removing //sbin/depmod as no more alternatives exist for it
Removing package module-init-tools from root...
update-alternatives: Linking //sbin/insmod to ../bin/busybox
update-alternatives: Linking //sbin/modprobe to ../bin/busybox
update-alternatives: Linking //sbin/rmmod to ../bin/busybox
update-alternatives: removing //sbin/modinfo as no more alternatives exist for it
update-alternatives: removing //bin/lsmod as no more alternatives exist for it
update-alternatives: Linking //sbin/lsmod to ../bin/busybox
Configuring kmod.
update-alternatives: Linking //sbin/insmod to /sbin/insmod.kmod
update-alternatives: Linking //sbin/modprobe to /sbin/modprobe.kmod
update-alternatives: Linking //sbin/rmmod to /sbin/rmmod.kmod
update-alternatives: Linking //sbin/modinfo to /sbin/modinfo.kmod
update-alternatives: Linking //bin/lsmod to /bin/lsmod.kmod
update-alternatives: Linking //sbin/lsmod to /bin/lsmod.kmod
update-alternatives: Linking //sbin/depmod to /sbin/depmod.kmod
(From OE-Core rev: 8de7f8045f28aecfe796afcdb013c557ce9d1372)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
63 lines
2.5 KiB
BlitzBasic
63 lines
2.5 KiB
BlitzBasic
# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
|
|
# Released under the MIT license (see COPYING.MIT for the terms)
|
|
|
|
require kmod.inc
|
|
|
|
PR = "${INC_PR}.1"
|
|
|
|
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"
|
|
RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
|
|
RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
|
|
|
|
# to force user to remove old module-init-tools and replace them with kmod variants
|
|
RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
|
|
|
|
# autotools set prefix to /usr, however we want them in /bin and /sbin
|
|
bindir = "${base_bindir}"
|
|
sbindir = "${base_sbindir}"
|
|
libdir = "${base_libdir}"
|
|
|
|
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
|
|
for tool in {ins,rm,dep}mod mod{info,probe}; do
|
|
ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}.kmod
|
|
done
|
|
# configuration directories
|
|
install -dm755 ${D}${base_libdir}/depmod.d
|
|
install -dm755 ${D}${base_libdir}/modprobe.d
|
|
install -dm755 ${D}${sysconfdir}/depmod.d
|
|
install -dm755 ${D}${sysconfdir}/modprobe.d
|
|
|
|
# install depmod.d file for search/ dir
|
|
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
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
PACKAGES =+ "libkmod"
|
|
|
|
FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
|
|
FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"
|