diff options
Diffstat (limited to 'meta/recipes-kernel/kmod')
-rw-r--r-- | meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 26 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod-native_git.bb | 18 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod.inc | 42 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch | 136 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch | 40 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch | 5 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch | 36 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/gtkdocdir.patch | 33 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/ptest.patch | 25 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod_31.bb | 89 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod_git.bb | 60 |
11 files changed, 279 insertions, 231 deletions
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb index 9a172675af..29f34d7f36 100644 --- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb +++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb @@ -1,7 +1,8 @@ SUMMARY = "Wrapper script for the Linux kernel module dependency indexer" LICENSE = "MIT" -S = "${WORKDIR}" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" INHIBIT_DEFAULT_DEPS = "1" # The kernel and the staging dir for it is machine specific @@ -21,20 +22,29 @@ do_install() { #!/bin/sh # Expected to be called as: depmodwrapper -a KERNEL_VERSION if [ "\$1" != "-a" -o "\$2" != "-b" ]; then - echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2 + echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION [KERNEL_PACKAGE_NAME]" >&2 exit 1 fi +kernelpkgname="kernel" +# If no KERNEL_PACKAGE_NAME, assume "kernel". +[ -z "\$5" ] || kernelpkgname="\$5" + kernelabi="" -if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; then - kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion") +if [ -r "${PKGDATA_DIR}/\${kernelpkgname}-depmod/\${kernelpkgname}-abiversion" ]; then + kernelabi=\$(cat "${PKGDATA_DIR}/\${kernelpkgname}-depmod/\${kernelpkgname}-abiversion") +fi + +if [ ! -e "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then + mkdir -p "\$3${nonarch_base_libdir}/depmod.d" + echo "exclude .debug" > "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" fi -if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then - echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2 - exec env depmod "\$1" "\$2" "\$3" "\$4" +if [ ! -r ${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then + echo "Unable to read: ${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4" >&2 + exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" "\$4" else - exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4" + exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4" "\$4" fi EOF chmod +x ${D}${bindir_crossscripts}/depmodwrapper diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb deleted file mode 100644 index f0e274ed79..0000000000 --- a/meta/recipes-kernel/kmod/kmod-native_git.bb +++ /dev/null @@ -1,18 +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 - -SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \ - " - -do_install_append (){ - for tool in depmod insmod lsmod modinfo modprobe rmmod - do - ln -s kmod ${D}${bindir}/$tool - done -} diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc deleted file mode 100644 index 6d0e031c6f..0000000000 --- a/meta/recipes-kernel/kmod/kmod.inc +++ /dev/null @@ -1,42 +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://packages.profusion.mobi/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 \ - " -inherit autotools gtk-doc pkgconfig manpages - -SRCREV = "58133a96c894c043e48c74ddf0bfe8db90bac62f" -# Lookout for PV bump too when SRCREV is changed -PV = "26" - -SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \ - file://depmod-search.conf \ - file://avoid_parallel_tests.patch \ - file://fix-O_CLOEXEC.patch \ - " - -S = "${WORKDIR}/git" - -EXTRA_AUTORECONF += "--install --symlink" -EXTRA_OECONF +=" --enable-tools --with-zlib" - -CACHED_CONFIGUREVARS += "ac_cv_path_DOLT_BASH='/usr/bin/env bash'" - -PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" -PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" -PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" - -GTKDOC_DOCDIR = "${S}/libkmod/docs" - -do_configure_append () { - sed -i 's#}libtool#}${TARGET_SYS}-libtool#' ${B}/doltlibtool -} diff --git a/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch b/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch new file mode 100644 index 0000000000..6a7f9ded4f --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch @@ -0,0 +1,136 @@ +From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 9 Dec 2023 17:35:59 -0800 +Subject: [PATCH] Use portable implementation for basename API + +musl has removed the non-prototype declaration of basename from +string.h [1] which now results in build errors with clang-17+ compiler + +Implement GNU basename behavior using strchr which is portable across libcs + +Fixes +../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +71 | "Commands:\n", basename(argv[0])); +| ^ + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://github.com/kmod-project/kmod/pull/32] + +Suggested-by: Rich Felker + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libkmod/libkmod-config.c | 2 +- + shared/util.c | 4 ++-- + shared/util.h | 7 +++++++ + testsuite/testsuite.c | 2 +- + tools/depmod.c | 2 +- + tools/kmod.c | 4 ++-- + 6 files changed, 14 insertions(+), 7 deletions(-) + +diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c +index e83621b..8aa555a 100644 +--- a/libkmod/libkmod-config.c ++++ b/libkmod/libkmod-config.c +@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx, + bool is_single = false; + + if (name == NULL) { +- name = basename(path); ++ name = gnu_basename(path); + is_single = true; + } + +diff --git a/shared/util.c b/shared/util.c +index e2bab83..0e16670 100644 +--- a/shared/util.c ++++ b/shared/util.c +@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t * + + char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len) + { +- char *modname; ++ const char *modname; + +- modname = basename(path); ++ modname = gnu_basename(path); + if (modname == NULL || modname[0] == '\0') + return NULL; + +diff --git a/shared/util.h b/shared/util.h +index c4a3916..073dc5a 100644 +--- a/shared/util.h ++++ b/shared/util.h +@@ -5,6 +5,7 @@ + #include <stdbool.h> + #include <stdlib.h> + #include <stdio.h> ++#include <string.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <time.h> +@@ -76,6 +77,12 @@ do { \ + __p->__v = (val); \ + } while(0) + ++static _always_inline_ const char *gnu_basename(const char *s) ++{ ++ const char *p = strrchr(s, '/'); ++ return p ? p+1 : s; ++} ++ + static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u) + { + return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1)); +diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c +index 318343a..aafc987 100644 +--- a/testsuite/testsuite.c ++++ b/testsuite/testsuite.c +@@ -70,7 +70,7 @@ static void help(void) + + printf("Usage:\n" + "\t%s [options] <test>\n" +- "Options:\n", basename(progname)); ++ "Options:\n", gnu_basename(progname)); + + for (itr = options, itr_short = options_short; + itr->name != NULL; itr++, itr_short++) +diff --git a/tools/depmod.c b/tools/depmod.c +index 43fc354..cfb15b1 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -762,7 +762,7 @@ static int cfg_files_insert_sorted(struct cfg_file ***p_files, size_t *p_n_files + if (name != NULL) + namelen = strlen(name); + else { +- name = basename(dir); ++ name = gnu_basename(dir); + namelen = strlen(name); + dirlen -= namelen + 1; + } +diff --git a/tools/kmod.c b/tools/kmod.c +index 55689c0..df91e5c 100644 +--- a/tools/kmod.c ++++ b/tools/kmod.c +@@ -68,7 +68,7 @@ static int kmod_help(int argc, char *argv[]) + "Options:\n" + "\t-V, --version show version\n" + "\t-h, --help show this help\n\n" +- "Commands:\n", basename(argv[0])); ++ "Commands:\n", gnu_basename(argv[0])); + + for (i = 0; i < ARRAY_SIZE(kmod_cmds); i++) { + if (kmod_cmds[i]->help != NULL) { +@@ -156,7 +156,7 @@ static int handle_kmod_compat_commands(int argc, char *argv[]) + const char *cmd; + size_t i; + +- cmd = basename(argv[0]); ++ cmd = gnu_basename(argv[0]); + + for (i = 0; i < ARRAY_SIZE(kmod_compat_cmds); i++) { + if (streq(kmod_compat_cmds[i]->name, cmd)) +-- +2.43.0 + diff --git a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch deleted file mode 100644 index 0ec20fad99..0000000000 --- a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 38d6871d9c98e0080426ea375e390728485b2bc2 Mon Sep 17 00:00:00 2001 -From: Ting Liu <b28495@freescale.com> -Date: Tue, 10 Sep 2013 06:00:20 +0000 -Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh - -We can't use htobe* and be*toh functions because they are not -available on older versions of glibc, For example, shipped on Centos 5.5. - -Change to directly calling bswap_* as defined in+byteswap.h. - -Upstream-Status: Inappropriate - -Signed-off-by: Ting Liu <b28495@freescale.com> -Signed-off-by: Chen Qi <Qi.Chen@windriver.com> - ---- - libkmod/libkmod-signature.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c -index 48d0145..dd2c6fa 100644 ---- a/libkmod/libkmod-signature.c -+++ b/libkmod/libkmod-signature.c -@@ -18,6 +18,7 @@ - */ - - #include <endian.h> -+#include <byteswap.h> - #include <inttypes.h> - #ifdef ENABLE_OPENSSL - #include <openssl/cms.h> -@@ -343,7 +344,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat - modsig->hash >= PKEY_HASH__LAST || - modsig->id_type >= PKEY_ID_TYPE__LAST) - return false; -- sig_len = be32toh(get_unaligned(&modsig->sig_len)); -+ sig_len = bswap_32(get_unaligned(&modsig->sig_len)); - if (sig_len == 0 || - size < (int64_t)(modsig->signer_len + modsig->key_id_len + sig_len)) - return false; diff --git a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch index 990c338fa9..04a8204815 100644 --- a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch +++ b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch @@ -20,7 +20,7 @@ diff --git a/configure.ac b/configure.ac index ee72283..60980c0 100644 --- a/configure.ac +++ b/configure.ac -@@ -14,7 +14,7 @@ AC_USE_SYSTEM_EXTENSIONS +@@ -14,8 +14,8 @@ AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_PREFIX_DEFAULT([/usr]) AM_MAINTAINER_MODE([enable]) @@ -28,4 +28,5 @@ index ee72283..60980c0 100644 +AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests]) AM_SILENT_RULES([yes]) LT_INIT([disable-static pic-only]) - DOLT + + AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by kmod])]) diff --git a/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch deleted file mode 100644 index 07e4a1f538..0000000000 --- a/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 5f55e6806cd8ae1a6c8ec1e6cb38ad292cfc1df9 Mon Sep 17 00:00:00 2001 -From: Robert Yang <liezhi.yang@windriver.com> -Date: Wed, 22 Jan 2014 01:06:40 -0500 -Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is - defined or not - -O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have -it, we need check before use. - -This patch is much more like a workaround, since it may need fcntl() use -FD_CLOEXEC to replace. - -This problem was reported by "Ting Liu <b28495@freescale.com>" -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> - -Upstream-Status: Pending - ---- - libkmod/libkmod-internal.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h -index a65ddd1..a4f4b77 100644 ---- a/libkmod/libkmod-internal.h -+++ b/libkmod/libkmod-internal.h -@@ -10,6 +10,10 @@ - - #include "libkmod.h" - -+#ifndef O_CLOEXEC -+#define O_CLOEXEC 0 -+#endif -+ - static _always_inline_ _printf_format_(2, 3) void - kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {} - diff --git a/meta/recipes-kernel/kmod/kmod/gtkdocdir.patch b/meta/recipes-kernel/kmod/kmod/gtkdocdir.patch new file mode 100644 index 0000000000..a34ea466e8 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/gtkdocdir.patch @@ -0,0 +1,33 @@ +From dd59095f70f774f6d1e767010e25b35ef6db4c4b Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@arm.com> +Date: Fri, 8 Dec 2023 22:35:45 +0000 +Subject: [PATCH] configure: set docdir in GTK_DOC_CHECK + +By passing --docdir in the GTK_DOC_CHECK arguments (to match +autogen.sh) autoreconf will work out of the box. + +Without this autoreconf fails due to the documentation not being in +./docs, the default location. + +Upstream-Status: Submitted [https://lore.kernel.org/linux-modules/20231208224511.1363066-1-ross.burton@arm.com/T/#u] +Signed-off-by: Ross Burton <ross.burton@arm.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index de01e08..67696c4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -255,7 +255,7 @@ AS_IF([test "x$enable_coverage" = "xyes"], [ + AM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = "xyes"]) + + m4_ifdef([GTK_DOC_CHECK], [ +-GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat]) ++GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat --docdir libkmod/docs]) + ], [ + AM_CONDITIONAL([ENABLE_GTK_DOC], false)]) + +-- +2.34.1 + diff --git a/meta/recipes-kernel/kmod/kmod/ptest.patch b/meta/recipes-kernel/kmod/kmod/ptest.patch deleted file mode 100644 index 831dbcb909..0000000000 --- a/meta/recipes-kernel/kmod/kmod/ptest.patch +++ /dev/null @@ -1,25 +0,0 @@ -Add 'install-ptest' rule. - -Signed-off-by: Tudor Florea <tudor.florea@enea.com> -Upstream-Status: Pending - -diff -ruN a/Makefile.am b/Makefile.am ---- a/Makefile.am 2013-07-12 17:11:05.278331557 +0200 -+++ b/Makefile.am 2013-07-12 17:14:27.033788016 +0200 -@@ -204,6 +204,16 @@ - - distclean-local: $(DISTCLEAN_LOCAL_HOOKS) - -+install-ptest: -+ @$(MKDIR_P) $(DESTDIR)/testsuite -+ @for file in $(TESTSUITE); do \ -+ install $$file $(DESTDIR)/testsuite; \ -+ done; -+ @sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile -+ @$(MKDIR_P) $(DESTDIR)/tools -+ @cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools -+ @cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite -+ - # ------------------------------------------------------------------------------ - # custom release helpers - # ------------------------------------------------------------------------------ diff --git a/meta/recipes-kernel/kmod/kmod_31.bb b/meta/recipes-kernel/kmod/kmod_31.bb new file mode 100644 index 0000000000..718a5565b4 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod_31.bb @@ -0,0 +1,89 @@ +# 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-or-later & LGPL-2.1-or-later" +LICENSE:libkmod = "LGPL-2.1-or-later" +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 = "aff617ea871d0568cc491bd116c0be1e857463bb" + +SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master;protocol=https \ + file://depmod-search.conf \ + file://avoid_parallel_tests.patch \ + file://0001-Use-portable-implementation-for-basename-API.patch \ + file://gtkdocdir.patch \ + " + +S = "${WORKDIR}/git" + +EXTRA_OECONF += "--enable-tools" + +PACKAGECONFIG ??= "zlib xz openssl" +PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" +PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" +PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" +PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" +PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz" +PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" +PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" + +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 +EXTRA_OECONF += "--bindir=${base_bindir} --sbindir=${base_sbindir}" + +do_install:append () { + install -dm755 ${D}${base_bindir} + install -dm755 ${D}${base_sbindir} + # add symlinks to kmod + ln -rs ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod + for tool in insmod rmmod depmod modinfo modprobe; do + ln -rs ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} + done + # configuration directories + install -dm755 ${D}${nonarch_base_libdir}/depmod.d + install -dm755 ${D}${nonarch_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 "${UNPACKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf" + + # Add .debug to the exclude path for depmod + echo "exclude .debug" > ${D}${nonarch_base_libdir}/depmod.d/exclude.conf +} + +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}" + +PACKAGES =+ "libkmod" +FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" +FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb deleted file mode 100644 index bd21d2ff73..0000000000 --- a/meta/recipes-kernel/kmod/kmod_git.bb +++ /dev/null @@ -1,60 +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" -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 -EXTRA_OECONF += " --bindir=${base_bindir} --sbindir=${base_sbindir}" - -do_install_append () { - install -dm755 ${D}${base_bindir} - install -dm755 ${D}${base_sbindir} - # add symlinks to kmod - lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod - for tool in insmod rmmod depmod modinfo modprobe; do - lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} - 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" -} - -do_compile_prepend() { - sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status -} - -inherit update-alternatives bash-completion - -ALTERNATIVE_PRIORITY = "70" - -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" - -FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" -FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d" |