From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- .../recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 46 ++++++++++++++++ poky/meta/recipes-kernel/kmod/kmod-native_git.bb | 18 +++++++ poky/meta/recipes-kernel/kmod/kmod.inc | 42 +++++++++++++++ ...alling-bswap_-instead-of-htobe-and-be-toh.patch | 39 ++++++++++++++ .../kmod/kmod/avoid_parallel_tests.patch | 26 +++++++++ .../recipes-kernel/kmod/kmod/depmod-search.conf | 6 +++ .../recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch | 35 ++++++++++++ poky/meta/recipes-kernel/kmod/kmod/ptest.patch | 25 +++++++++ poky/meta/recipes-kernel/kmod/kmod/run-ptest | 5 ++ poky/meta/recipes-kernel/kmod/kmod_git.bb | 62 ++++++++++++++++++++++ 10 files changed, 304 insertions(+) create mode 100644 poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb create mode 100644 poky/meta/recipes-kernel/kmod/kmod-native_git.bb create mode 100644 poky/meta/recipes-kernel/kmod/kmod.inc create mode 100644 poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch create mode 100644 poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch create mode 100644 poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf create mode 100644 poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch create mode 100644 poky/meta/recipes-kernel/kmod/kmod/ptest.patch create mode 100755 poky/meta/recipes-kernel/kmod/kmod/run-ptest create mode 100644 poky/meta/recipes-kernel/kmod/kmod_git.bb (limited to 'poky/meta/recipes-kernel/kmod') diff --git a/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb new file mode 100644 index 000000000..9a172675a --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb @@ -0,0 +1,46 @@ +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" + +DEPENDS += "kmod-native" +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 + +kernelabi="" +if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; then + kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion") +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" +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}" + +PACKAGES = "" +inherit nopackages diff --git a/poky/meta/recipes-kernel/kmod/kmod-native_git.bb b/poky/meta/recipes-kernel/kmod/kmod-native_git.bb new file mode 100644 index 000000000..f0e274ed7 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod-native_git.bb @@ -0,0 +1,18 @@ +# Copyright (C) 2012 Khem Raj +# 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/poky/meta/recipes-kernel/kmod/kmod.inc b/poky/meta/recipes-kernel/kmod/kmod.inc new file mode 100644 index 000000000..29885fbe7 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod.inc @@ -0,0 +1,42 @@ +# Copyright (C) 2012 Khem Raj +# 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 = "aca4eca103d6699543f7ed663335c28c2e9908bb" +# Lookout for PV bump too when SRCREV is changed +PV = "25+git${SRCPV}" + +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/poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch new file mode 100644 index 000000000..b722183b6 --- /dev/null +++ b/poky/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 +Signed-off-by: Chen Qi +--- + 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 ++#include + #include + #include + #include +@@ -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/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch new file mode 100644 index 000000000..5f45fce93 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch @@ -0,0 +1,26 @@ +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 +Upstream-Status: Inappropriate (disable feature incompatible with ptest) + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac ++++ git/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]) + DOLT diff --git a/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf new file mode 100644 index 000000000..527c0bb6e --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf @@ -0,0 +1,6 @@ +# +# /etc/depmod.d/depmod.conf +# + +search updates extramodules built-in + diff --git a/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch new file mode 100644 index 000000000..5d9d40c38 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch @@ -0,0 +1,35 @@ +From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001 +From: Robert Yang +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 " +Signed-off-by: Robert Yang + +Upstream-Status: Pending +--- + libkmod/libkmod-internal.h | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: git/libkmod/libkmod-internal.h +=================================================================== +--- git.orig/libkmod/libkmod-internal.h ++++ git/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/poky/meta/recipes-kernel/kmod/kmod/ptest.patch b/poky/meta/recipes-kernel/kmod/kmod/ptest.patch new file mode 100644 index 000000000..831dbcb90 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod/ptest.patch @@ -0,0 +1,25 @@ +Add 'install-ptest' rule. + +Signed-off-by: Tudor Florea +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/poky/meta/recipes-kernel/kmod/kmod/run-ptest b/poky/meta/recipes-kernel/kmod/kmod/run-ptest new file mode 100755 index 000000000..598dd2cb5 --- /dev/null +++ b/poky/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/poky/meta/recipes-kernel/kmod/kmod_git.bb b/poky/meta/recipes-kernel/kmod/kmod_git.bb new file mode 100644 index 000000000..69185b245 --- /dev/null +++ b/poky/meta/recipes-kernel/kmod/kmod_git.bb @@ -0,0 +1,62 @@ +# Copyright (C) 2012 Khem Raj +# 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 +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 + 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 = "60" + +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" -- cgit v1.2.3