kmod: merge target/native recipes

There's no good reason to keep separate target and native recipes for
kmod, so merge them into a single kmod_29.bb which uses class extension.

The symlinks are not created differently for target vs native builds, as
the native sbindir is in PATH.

(From OE-Core rev: 9abbf481438fba10a7512fb1ad1bff5d48e6fbdc)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2021-12-20 18:26:34 +00:00
committed by Richard Purdie
parent 70341cdbd8
commit c6afe99922
4 changed files with 35 additions and 62 deletions

View File

@@ -294,7 +294,6 @@ RECIPE_MAINTAINER:pn-kernel-devsrc = "Bruce Ashfield <bruce.ashfield@gmail.com>"
RECIPE_MAINTAINER:pn-kexec-tools = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-keymaps = "Alexander Kanavin <alex.kanavin@gmail.com>"
RECIPE_MAINTAINER:pn-kmod = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER:pn-kmod-native = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER:pn-kmscube = "Carlos Rafael Giani <dv@pseudoterminal.org>"
RECIPE_MAINTAINER:pn-l3afpad = "Anuj Mittal <anuj.mittal@intel.com>"
RECIPE_MAINTAINER:pn-lame = "Michael Opdenacker <michael.opdenacker@bootlin.com>"

View File

@@ -1,15 +0,0 @@
# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
require kmod.inc
DEPENDS += "zlib-native"
inherit native
do_install:append (){
for tool in depmod insmod lsmod modinfo modprobe rmmod
do
ln -s kmod ${D}${bindir}/$tool
done
}

View File

@@ -1,37 +0,0 @@
# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Tools for managing Linux kernel modules"
DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \
insert, remove, list, check properties, resolve dependencies and aliases."
HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kmod/"
LICENSE = "GPL-2.0+ & LGPL-2.1+"
LICENSE:libkmod = "LGPL-2.1+"
SECTION = "base"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \
"
inherit autotools gtk-doc pkgconfig manpages
SRCREV = "b6ecfc916a17eab8f93be5b09f4e4f845aabd3d1"
# Lookout for PV bump too when SRCREV is changed
PV = "29"
SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master \
file://depmod-search.conf \
file://avoid_parallel_tests.patch \
"
S = "${WORKDIR}/git"
EXTRA_OECONF +=" --enable-tools --with-zlib"
PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz"
PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
GTKDOC_DOCDIR = "${S}/libkmod/docs"

View File

@@ -1,7 +1,38 @@
# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
require kmod.inc
SUMMARY = "Tools for managing Linux kernel modules"
DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \
insert, remove, list, check properties, resolve dependencies and aliases."
HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kmod/"
LICENSE = "GPL-2.0+ & LGPL-2.1+"
LICENSE:libkmod = "LGPL-2.1+"
SECTION = "base"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \
"
inherit autotools bash-completion gtk-doc pkgconfig manpages update-alternatives
SRCREV = "b6ecfc916a17eab8f93be5b09f4e4f845aabd3d1"
SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master \
file://depmod-search.conf \
file://avoid_parallel_tests.patch \
"
S = "${WORKDIR}/git"
EXTRA_OECONF += "--enable-tools --with-zlib"
PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz"
PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
GTKDOC_DOCDIR = "${S}/libkmod/docs"
DEPENDS += "zlib"
PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
@@ -13,7 +44,7 @@ RREPLACES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod mod
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
EXTRA_OECONF += " --bindir=${base_bindir} --sbindir=${base_sbindir}"
EXTRA_OECONF += "--bindir=${base_bindir} --sbindir=${base_sbindir}"
do_install:append () {
install -dm755 ${D}${base_bindir}
@@ -33,26 +64,21 @@ do_install:append () {
install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf"
}
inherit update-alternatives bash-completion
ALTERNATIVE_PRIORITY = "70"
ALTERNATIVE:kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/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"
FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d"
BBCLASSEXTEND = "nativesdk"
BBCLASSEXTEND = "native nativesdk"