diff options
Diffstat (limited to 'meta/recipes-kernel/kmod')
12 files changed, 263 insertions, 61 deletions
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb new file mode 100644 index 0000000000..44d013f29d --- /dev/null +++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb @@ -0,0 +1,48 @@ +SUMMARY = "Wrapper script for the Linux kernel module dependency indexer" +LICENSE = "MIT" + +S = "${WORKDIR}" + +INHIBIT_DEFAULT_DEPS = "1" +# The kernel and the staging dir for it is machine specific +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# We need the following for the sstate code to process the wrapper +SSTATE_SCAN_FILES += "depmodwrapper" +EXTRA_STAGING_FIXMES += "PKGDATA_DIR" + +do_populate_sysroot[depends] = "" + +do_install() { + install -d ${D}${bindir_crossscripts}/ + + cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF +#!/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 + exit 1 +fi +if [ ! -r ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion ]; then + echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" >&2 +else + kernelabi=\$(cat ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion) + if [ "\$kernelabi" != "\$4" ]; then + echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2 + exit 1 + fi +fi + +if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ]; then + echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2 + exec env depmod "\$1" "\$2" "\$3" "\$4" +else + exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4" +fi +EOF + chmod +x ${D}${bindir_crossscripts}/depmodwrapper +} + +SYSROOT_DIRS += "${bindir_crossscripts}" + +inherit nopackages diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb index 8cbcdf8ad7..f0e274ed79 100644 --- a/meta/recipes-kernel/kmod/kmod-native_git.bb +++ b/meta/recipes-kernel/kmod/kmod-native_git.bb @@ -2,10 +2,13 @@ # Released under the MIT license (see COPYING.MIT for the terms) require kmod.inc + +DEPENDS += "zlib-native" + inherit native -PR = "${INC_PR}.1" -SRC_URI += "file://fix-undefined-O_CLOEXEC.patch" +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 diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc index 3cd963f651..ba80fc57a3 100644 --- a/meta/recipes-kernel/kmod/kmod.inc +++ b/meta/recipes-kernel/kmod/kmod.inc @@ -1,34 +1,45 @@ # 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" -PV = "9" -INC_PR = "r0" -DEPENDS += "pkgconfig-native" - -LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ " -inherit autotools gtk-doc +inherit autotools gtk-doc pkgconfig manpages + +SRCREV = "65a885df5f6f15222b44fd695c5eaca17e837a14" +# Lookout for PV bump too when SRCREV is changed +PV = "23+git${SRCPV}" SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \ file://depmod-search.conf \ - file://0001-man-disable-man-page-generation-because-we-don-t-hav.patch \ + file://avoid_parallel_tests.patch \ + file://fix-O_CLOEXEC.patch \ + file://kcmdline_quotes.patch \ " -SRCREV = "62081c0f68905b22f375156d4532fd37fa5c8d33" - S = "${WORKDIR}/git" EXTRA_AUTORECONF += "--install --symlink" -EXTRA_OECONF +="--enable-debug --enable-logging --enable-tools" +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" do_configure_prepend () { - gtkdocize --docdir ${S}/libkmod/docs || touch ${S}/libkmod/docs/gtk-doc.make + gtkdocize --docdir ${S}/libkmod/docs --srcdir ${S} +} + +do_configure_append () { + sed -i 's#}libtool#}${TARGET_SYS}-libtool#' ${B}/doltlibtool } diff --git a/meta/recipes-kernel/kmod/kmod/0001-man-disable-man-page-generation-because-we-don-t-hav.patch b/meta/recipes-kernel/kmod/kmod/0001-man-disable-man-page-generation-because-we-don-t-hav.patch deleted file mode 100644 index 5361b847c9..0000000000 --- a/meta/recipes-kernel/kmod/kmod/0001-man-disable-man-page-generation-because-we-don-t-hav.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ce6f0cabb65e67dd4d31e1e555db8bc6eaf435d3 Mon Sep 17 00:00:00 2001 -From: Martin Jansa <Martin.Jansa@gmail.com> -Date: Fri, 24 Feb 2012 07:35:38 +0100 -Subject: [PATCH] man: disable man page generation because we don't have - working xsltproc - -Upstream-Status: Inappropriate [build system specific change] - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - Makefile.am | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 141c102..a8bdfd1 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -1,4 +1,4 @@ --SUBDIRS = . libkmod/docs man -+SUBDIRS = . libkmod/docs - - DISTCLEAN_LOCAL_HOOKS = - EXTRA_DIST = --- -1.7.8.4 - 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 new file mode 100644 index 0000000000..b722183b68 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch @@ -0,0 +1,39 @@ +Subject: 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 6fc06fc..912185a 100644 +--- a/libkmod/libkmod-signature.c ++++ b/libkmod/libkmod-signature.c +@@ -18,6 +18,7 @@ + */ + + #include <endian.h> ++#include <byteswap.h> + #include <inttypes.h> + #include <stdio.h> + #include <stdlib.h> +@@ -127,7 +128,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; +-- +1.9.1 + diff --git a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch new file mode 100644 index 0000000000..feafcb9b7c --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch @@ -0,0 +1,29 @@ +Avoid parallel-tests as it remove +buildtest-TESTS and runtest-TESTS targets required by ptest. +In automake 1.13.4 parallel-tests is assumed by defauls. +In order to have buildtest-TESTS and runtest-TESTS targets +serial-tests is now required + +Signed-off-by: Tudor Florea <tudor.florea@enea.com> +Upstream-Status: Inappropriate (disable feature incompatible with ptest) + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index eb0f9d1..a539968 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -14,7 +14,7 @@ AC_USE_SYSTEM_EXTENSIONS + AC_SYS_LARGEFILE + AC_PREFIX_DEFAULT([/usr]) + AM_MAINTAINER_MODE([enable]) +-AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests]) ++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]) + +-- +1.9.1 + diff --git a/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch new file mode 100644 index 0000000000..8161d6128d --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch @@ -0,0 +1,38 @@ +From bd43367eee868059770188fd9e9db38520dc6fff 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 0180124..100b40f 100644 +--- a/libkmod/libkmod-internal.h ++++ b/libkmod/libkmod-internal.h +@@ -9,6 +9,10 @@ + #include "macro.h" + #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, ...) {} + +-- +1.7.10.4 + diff --git a/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch deleted file mode 100644 index 3177e9a1a9..0000000000 --- a/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch +++ /dev/null @@ -1,17 +0,0 @@ -Upstream-Status: Not applicable - -Index: git/libkmod/libkmod-private.h -=================================================================== ---- git.orig/libkmod/libkmod-private.h -+++ git/libkmod/libkmod-private.h -@@ -1,6 +1,10 @@ - #ifndef _LIBKMOD_PRIVATE_H_ - #define _LIBKMOD_PRIVATE_H_ - -+#ifndef O_CLOEXEC -+# define O_CLOEXEC 0 -+#endif -+ - #include <stdbool.h> - #include <stdio.h> - #include <syslog.h> diff --git a/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch b/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch new file mode 100644 index 0000000000..46bdec59a7 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch @@ -0,0 +1,44 @@ +From 4a6f92a10680e7e36807f5e2ae8e497e8d73a048 Mon Sep 17 00:00:00 2001 +From: James Minor <james.minor@ni.com> +Date: Fri, 20 Jan 2017 17:15:50 -0600 +Subject: [PATCH] libkmod: Fix handling of quotes in kernel command line + +If a module parameter on the command line contains quotes, any +spaces inside those quotes should be included as part of the +parameter. + +Signed-off-by: James Minor <james.minor@ni.com> + +Upstream-Status: Accepted +--- + libkmod/libkmod-config.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c +index 57fbe37..ea40d19 100644 +--- a/libkmod/libkmod-config.c ++++ b/libkmod/libkmod-config.c +@@ -497,6 +497,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) + char buf[KCMD_LINE_SIZE]; + int fd, err; + char *p, *modname, *param = NULL, *value = NULL, is_module = 1; ++ bool is_quoted = false; + + fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC); + if (fd < 0) { +@@ -514,6 +515,12 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) + } + + for (p = buf, modname = buf; *p != '\0' && *p != '\n'; p++) { ++ if (*p == '"') { ++ is_quoted = !is_quoted; ++ continue; ++ } ++ if (is_quoted) ++ continue; + switch (*p) { + case ' ': + *p = '\0'; +-- +1.9.1 + diff --git a/meta/recipes-kernel/kmod/kmod/ptest.patch b/meta/recipes-kernel/kmod/kmod/ptest.patch new file mode 100644 index 0000000000..831dbcb909 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/ptest.patch @@ -0,0 +1,25 @@ +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/run-ptest b/meta/recipes-kernel/kmod/kmod/run-ptest new file mode 100755 index 0000000000..598dd2cb5f --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/run-ptest @@ -0,0 +1,5 @@ +#!/bin/sh +touch testsuite/stamp-rootfs +tar xf testmodule.tar +make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL +find testsuite -name *.ko -exec rm -f {} \; diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb index ca6b004a6c..69185b2453 100644 --- a/meta/recipes-kernel/kmod/kmod_git.bb +++ b/meta/recipes-kernel/kmod/kmod_git.bb @@ -3,8 +3,7 @@ require kmod.inc -PR = "${INC_PR}.0" - +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" @@ -22,9 +21,9 @@ 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 + lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod for tool in insmod rmmod depmod modinfo modprobe; do - ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool} + lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} done # configuration directories install -dm755 ${D}${base_libdir}/depmod.d @@ -36,7 +35,11 @@ do_install_append () { install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf" } -inherit update-alternatives +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 = "60" |
