diff options
Diffstat (limited to 'meta/recipes-kernel/kmod')
-rw-r--r-- | meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 46 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod-native_git.bb | 18 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod.inc | 38 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch | 39 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch | 21 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/depmod-search.conf | 6 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch | 38 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/ptest.patch | 25 | ||||
-rwxr-xr-x | meta/recipes-kernel/kmod/kmod/run-ptest | 3 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod_git.bb | 71 |
10 files changed, 305 insertions, 0 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..ec20bf8d30 --- /dev/null +++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | |||
@@ -0,0 +1,46 @@ | |||
1 | SUMMARY = "Wrapper script for the Linux kernel module dependency indexer" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
4 | |||
5 | INHIBIT_DEFAULT_DEPS = "1" | ||
6 | # The kernel and the staging dir for it is machine specific | ||
7 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
8 | |||
9 | # We need the following for the sstate code to process the wrapper | ||
10 | SSTATE_SCAN_FILES += "depmodwrapper" | ||
11 | |||
12 | do_install() { | ||
13 | install -d ${D}${bindir_crossscripts}/ | ||
14 | |||
15 | cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF | ||
16 | #!/bin/sh | ||
17 | # Expected to be called as: depmodwrapper -a KERNEL_VERSION | ||
18 | if [ "\$1" != "-a" -o "\$2" != "-b" ]; then | ||
19 | echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2 | ||
20 | exit 1 | ||
21 | fi | ||
22 | if [ ! -r ${STAGING_KERNEL_DIR}/kernel-abiversion ]; then | ||
23 | echo "Unable to read: ${STAGING_KERNEL_DIR}/kernel-abiversion" >&2 | ||
24 | else | ||
25 | kernelabi=\$(cat ${STAGING_KERNEL_DIR}/kernel-abiversion) | ||
26 | if [ "\$kernelabi" != "\$4" ]; then | ||
27 | echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2 | ||
28 | exit 1 | ||
29 | fi | ||
30 | fi | ||
31 | |||
32 | if [ ! -r ${STAGING_KERNEL_DIR}/System.map-\$4 ]; then | ||
33 | echo "Unable to read: ${STAGING_KERNEL_DIR}/System.map-\$4" >&2 | ||
34 | exec env depmod "\$1" "\$2" "\$3" "\$4" | ||
35 | else | ||
36 | exec env depmod "\$1" "\$2" "\$3" -F "${STAGING_KERNEL_DIR}/System.map-\$4" "\$4" | ||
37 | fi | ||
38 | EOF | ||
39 | chmod +x ${D}${bindir_crossscripts}/depmodwrapper | ||
40 | } | ||
41 | |||
42 | SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess" | ||
43 | |||
44 | depmodwrapper_sysroot_preprocess () { | ||
45 | sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
46 | } | ||
diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb new file mode 100644 index 0000000000..f0e274ed79 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod-native_git.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | # Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | require kmod.inc | ||
5 | |||
6 | DEPENDS += "zlib-native" | ||
7 | |||
8 | inherit native | ||
9 | |||
10 | SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \ | ||
11 | " | ||
12 | |||
13 | do_install_append (){ | ||
14 | for tool in depmod insmod lsmod modinfo modprobe rmmod | ||
15 | do | ||
16 | ln -s kmod ${D}${bindir}/$tool | ||
17 | done | ||
18 | } | ||
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc new file mode 100644 index 0000000000..47445eb8bf --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod.inc | |||
@@ -0,0 +1,38 @@ | |||
1 | # Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | SUMMARY = "Tools for managing Linux kernel modules" | ||
5 | DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \ | ||
6 | insert, remove, list, check properties, resolve dependencies and aliases." | ||
7 | HOMEPAGE = "http://packages.profusion.mobi/kmod/" | ||
8 | LICENSE = "GPL-2.0+ & LGPL-2.1+" | ||
9 | LICENSE_libkmod = "LGPL-2.1+" | ||
10 | SECTION = "base" | ||
11 | |||
12 | DEPENDS += "pkgconfig-native" | ||
13 | |||
14 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ | ||
15 | file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ | ||
16 | " | ||
17 | inherit autotools gtk-doc ptest | ||
18 | |||
19 | SRCREV = "36c4bb928a6a7962dd0ad3aa64c0b18120ca5b46" | ||
20 | # Lookout for PV bump too when SRCREV is changed | ||
21 | PV = "16+git${SRCPV}" | ||
22 | |||
23 | SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \ | ||
24 | file://depmod-search.conf \ | ||
25 | file://run-ptest \ | ||
26 | file://ptest.patch \ | ||
27 | file://avoid_parallel_tests.patch \ | ||
28 | file://fix-O_CLOEXEC.patch \ | ||
29 | " | ||
30 | |||
31 | S = "${WORKDIR}/git" | ||
32 | |||
33 | EXTRA_AUTORECONF += "--install --symlink" | ||
34 | EXTRA_OECONF +="--enable-debug --enable-logging --enable-tools --disable-manpages --with-zlib" | ||
35 | |||
36 | do_configure_prepend () { | ||
37 | gtkdocize --docdir ${S}/libkmod/docs || touch ${S}/libkmod/docs/gtk-doc.make | ||
38 | } | ||
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..82b83b36b7 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 0c4dbadc9db3cda1cfca64e44ea08c6e89919ea7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <b28495@freescale.com> | ||
3 | Date: Tue, 10 Sep 2013 13:44:18 +0800 | ||
4 | Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh | ||
5 | |||
6 | We can't use htobe* and be*toh functions because they are not | ||
7 | available on older versions of glibc, For example, shipped on Centos 5.5. | ||
8 | |||
9 | Change to directly calling bswap_* as defined in+byteswap.h. | ||
10 | |||
11 | Signed-off-by: Ting Liu <b28495@freescale.com> | ||
12 | --- | ||
13 | libkmod/libkmod-signature.c | 3 ++- | ||
14 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c | ||
17 | index 6b80caa..3544a36 100644 | ||
18 | --- a/libkmod/libkmod-signature.c | ||
19 | +++ b/libkmod/libkmod-signature.c | ||
20 | @@ -19,6 +19,7 @@ | ||
21 | */ | ||
22 | |||
23 | #include <endian.h> | ||
24 | +#include <byteswap.h> | ||
25 | #include <stdint.h> | ||
26 | #include <stdlib.h> | ||
27 | #include <string.h> | ||
28 | @@ -121,7 +122,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat | ||
29 | modsig->hash >= PKEY_HASH__LAST || | ||
30 | modsig->id_type >= PKEY_ID_TYPE__LAST) | ||
31 | return false; | ||
32 | - sig_len = be32toh(modsig->sig_len); | ||
33 | + sig_len = bswap_32(modsig->sig_len); | ||
34 | if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len)) | ||
35 | return false; | ||
36 | |||
37 | -- | ||
38 | 1.7.5.4 | ||
39 | |||
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..4c37d44836 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Avoid parallel-tests as it remove | ||
2 | buildtest-TESTS and runtest-TESTS targets required by ptest. | ||
3 | In automake 1.13.4 parallel-tests is assumed by defauls. | ||
4 | In order to have buildtest-TESTS and runtest-TESTS targets | ||
5 | serial-tests is now required | ||
6 | |||
7 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
8 | Upstream-Status: Inappropriate (disable feature incompatible with ptest) | ||
9 | |||
10 | diff -ruN a/configure.ac b/configure.ac | ||
11 | --- a/configure.ac 2013-09-02 15:05:18.662366800 +0200 | ||
12 | +++ b/configure.ac 2013-11-28 09:26:49.557066764 +0200 | ||
13 | @@ -8,7 +8,7 @@ | ||
14 | AC_CONFIG_SRCDIR([libkmod/libkmod.c]) | ||
15 | AC_CONFIG_AUX_DIR([build-aux]) | ||
16 | AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules | ||
17 | - tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests]) | ||
18 | + tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests]) | ||
19 | AC_PROG_CC_STDC | ||
20 | AC_USE_SYSTEM_EXTENSIONS | ||
21 | AC_SYS_LARGEFILE | ||
diff --git a/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/meta/recipes-kernel/kmod/kmod/depmod-search.conf new file mode 100644 index 0000000000..527c0bb6ee --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/depmod-search.conf | |||
@@ -0,0 +1,6 @@ | |||
1 | # | ||
2 | # /etc/depmod.d/depmod.conf | ||
3 | # | ||
4 | |||
5 | search updates extramodules built-in | ||
6 | |||
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 @@ | |||
1 | From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Wed, 22 Jan 2014 01:06:40 -0500 | ||
4 | Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is | ||
5 | defined or not | ||
6 | |||
7 | O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have | ||
8 | it, we need check before use. | ||
9 | |||
10 | This patch is much more like a workaround, since it may need fcntl() use | ||
11 | FD_CLOEXEC to replace. | ||
12 | |||
13 | This problem was reported by "Ting Liu <b28495@freescale.com>" | ||
14 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | --- | ||
18 | libkmod/libkmod-internal.h | 4 ++++ | ||
19 | 1 file changed, 4 insertions(+) | ||
20 | |||
21 | diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h | ||
22 | index 0180124..100b40f 100644 | ||
23 | --- a/libkmod/libkmod-internal.h | ||
24 | +++ b/libkmod/libkmod-internal.h | ||
25 | @@ -9,6 +9,10 @@ | ||
26 | #include "macro.h" | ||
27 | #include "libkmod.h" | ||
28 | |||
29 | +#ifndef O_CLOEXEC | ||
30 | +#define O_CLOEXEC 0 | ||
31 | +#endif | ||
32 | + | ||
33 | static _always_inline_ _printf_format_(2, 3) void | ||
34 | kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {} | ||
35 | |||
36 | -- | ||
37 | 1.7.10.4 | ||
38 | |||
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 @@ | |||
1 | Add 'install-ptest' rule. | ||
2 | |||
3 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
4 | Upstream-Status: Pending | ||
5 | |||
6 | diff -ruN a/Makefile.am b/Makefile.am | ||
7 | --- a/Makefile.am 2013-07-12 17:11:05.278331557 +0200 | ||
8 | +++ b/Makefile.am 2013-07-12 17:14:27.033788016 +0200 | ||
9 | @@ -204,6 +204,16 @@ | ||
10 | |||
11 | distclean-local: $(DISTCLEAN_LOCAL_HOOKS) | ||
12 | |||
13 | +install-ptest: | ||
14 | + @$(MKDIR_P) $(DESTDIR)/testsuite | ||
15 | + @for file in $(TESTSUITE); do \ | ||
16 | + install $$file $(DESTDIR)/testsuite; \ | ||
17 | + done; | ||
18 | + @sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile | ||
19 | + @$(MKDIR_P) $(DESTDIR)/tools | ||
20 | + @cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools | ||
21 | + @cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite | ||
22 | + | ||
23 | # ------------------------------------------------------------------------------ | ||
24 | # custom release helpers | ||
25 | # ------------------------------------------------------------------------------ | ||
diff --git a/meta/recipes-kernel/kmod/kmod/run-ptest b/meta/recipes-kernel/kmod/kmod/run-ptest new file mode 100755 index 0000000000..37adec3d2f --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | touch testsuite/stamp-rootfs | ||
3 | make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL | ||
diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb new file mode 100644 index 0000000000..c55cbd3e1e --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod_git.bb | |||
@@ -0,0 +1,71 @@ | |||
1 | # Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | require kmod.inc | ||
5 | |||
6 | DEPENDS += "zlib" | ||
7 | PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
8 | RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
9 | RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
10 | RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
11 | |||
12 | # to force user to remove old module-init-tools and replace them with kmod variants | ||
13 | RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
14 | |||
15 | # autotools set prefix to /usr, however we want them in /bin and /sbin | ||
16 | bindir = "${base_bindir}" | ||
17 | sbindir = "${base_sbindir}" | ||
18 | # libdir = "${base_libdir}" | ||
19 | |||
20 | do_install_append () { | ||
21 | install -dm755 ${D}${base_bindir} | ||
22 | install -dm755 ${D}${base_sbindir} | ||
23 | # add symlinks to kmod | ||
24 | ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod | ||
25 | for tool in insmod rmmod depmod modinfo modprobe; do | ||
26 | ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool} | ||
27 | done | ||
28 | # configuration directories | ||
29 | install -dm755 ${D}${base_libdir}/depmod.d | ||
30 | install -dm755 ${D}${base_libdir}/modprobe.d | ||
31 | install -dm755 ${D}${sysconfdir}/depmod.d | ||
32 | install -dm755 ${D}${sysconfdir}/modprobe.d | ||
33 | |||
34 | # install depmod.d file for search/ dir | ||
35 | install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf" | ||
36 | |||
37 | } | ||
38 | |||
39 | do_compile_prepend() { | ||
40 | sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status | ||
41 | } | ||
42 | |||
43 | do_compile_ptest () { | ||
44 | oe_runmake buildtest-TESTS rootfs | ||
45 | } | ||
46 | |||
47 | INHIBIT_PACKAGE_STRIP = "${@base_contains("DISTRO_FEATURES", "ptest", "1", "0", d)}" | ||
48 | INSANE_SKIP_${PN}-ptest = "arch" | ||
49 | |||
50 | inherit update-alternatives | ||
51 | |||
52 | ALTERNATIVE_PRIORITY = "60" | ||
53 | |||
54 | ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" | ||
55 | |||
56 | ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" | ||
57 | ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" | ||
58 | ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" | ||
59 | ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" | ||
60 | ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" | ||
61 | |||
62 | ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" | ||
63 | ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" | ||
64 | |||
65 | ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" | ||
66 | |||
67 | PACKAGES =+ "libkmod ${PN}-bash-completion" | ||
68 | |||
69 | FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" | ||
70 | FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d" | ||
71 | FILES_${PN}-bash-completion = "${datadir}/bash-completion" | ||