summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kmod/kmod
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/kmod/kmod')
-rw-r--r--meta/recipes-kernel/kmod/kmod/0001-Add-missing-O_CLOEXEC-in-kmod_module_get_size.patch27
-rw-r--r--meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch41
-rw-r--r--meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch21
-rw-r--r--meta/recipes-kernel/kmod/kmod/depmod-search.conf6
-rw-r--r--meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch38
-rw-r--r--meta/recipes-kernel/kmod/kmod/ptest.patch25
-rwxr-xr-xmeta/recipes-kernel/kmod/kmod/run-ptest5
7 files changed, 163 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kmod/kmod/0001-Add-missing-O_CLOEXEC-in-kmod_module_get_size.patch b/meta/recipes-kernel/kmod/kmod/0001-Add-missing-O_CLOEXEC-in-kmod_module_get_size.patch
new file mode 100644
index 0000000000..77624ce151
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/0001-Add-missing-O_CLOEXEC-in-kmod_module_get_size.patch
@@ -0,0 +1,27 @@
1From 74c26943f1228870022d116a1fda25be3a55a38e Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
3Date: Wed, 18 Jun 2014 20:51:00 -0400
4Subject: [PATCH] Add missing O_CLOEXEC in kmod_module_get_size()
5
6Upstream-Status: Backport
7Signed-off-by: Saul Wold <sgw@linux.intel.com>
8---
9 libkmod/libkmod-module.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
13index e3cc5a7..b81b451 100644
14--- a/libkmod/libkmod-module.c
15+++ b/libkmod/libkmod-module.c
16@@ -1783,7 +1783,7 @@ KMOD_EXPORT long kmod_module_get_size(const struct kmod_module *mod)
17 * loaded.
18 */
19 snprintf(line, sizeof(line), "/sys/module/%s", mod->name);
20- dfd = open(line, O_RDONLY);
21+ dfd = open(line, O_RDONLY|O_CLOEXEC);
22 if (dfd < 0)
23 return -errno;
24
25--
261.8.3.1
27
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..2320b92eba
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -0,0 +1,41 @@
1From 0c4dbadc9db3cda1cfca64e44ea08c6e89919ea7 Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Tue, 10 Sep 2013 13:44:18 +0800
4Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh
5
6We can't use htobe* and be*toh functions because they are not
7available on older versions of glibc, For example, shipped on Centos 5.5.
8
9Change to directly calling bswap_* as defined in+byteswap.h.
10
11Upstream-Status: Inappropriate
12
13Signed-off-by: Ting Liu <b28495@freescale.com>
14---
15 libkmod/libkmod-signature.c | 3 ++-
16 1 files changed, 2 insertions(+), 1 deletions(-)
17
18diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
19index 6b80caa..3544a36 100644
20--- a/libkmod/libkmod-signature.c
21+++ b/libkmod/libkmod-signature.c
22@@ -19,6 +19,7 @@
23 */
24
25 #include <endian.h>
26+#include <byteswap.h>
27 #include <stdint.h>
28 #include <stdlib.h>
29 #include <string.h>
30@@ -121,7 +122,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
31 modsig->hash >= PKEY_HASH__LAST ||
32 modsig->id_type >= PKEY_ID_TYPE__LAST)
33 return false;
34- sig_len = be32toh(get_unaligned(&modsig->sig_len));
35+ sig_len = bswap_32(get_unaligned(&modsig->sig_len));
36 if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len))
37 return false;
38
39--
401.7.5.4
41
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 @@
1Avoid parallel-tests as it remove
2buildtest-TESTS and runtest-TESTS targets required by ptest.
3In automake 1.13.4 parallel-tests is assumed by defauls.
4In order to have buildtest-TESTS and runtest-TESTS targets
5serial-tests is now required
6
7Signed-off-by: Tudor Florea <tudor.florea@enea.com>
8Upstream-Status: Inappropriate (disable feature incompatible with ptest)
9
10diff -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
5search 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 @@
1From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Wed, 22 Jan 2014 01:06:40 -0500
4Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is
5 defined or not
6
7O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
8it, we need check before use.
9
10This patch is much more like a workaround, since it may need fcntl() use
11FD_CLOEXEC to replace.
12
13This problem was reported by "Ting Liu <b28495@freescale.com>"
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15
16Upstream-Status: Pending
17---
18 libkmod/libkmod-internal.h | 4 ++++
19 1 file changed, 4 insertions(+)
20
21diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
22index 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--
371.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 @@
1Add 'install-ptest' rule.
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -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..598dd2cb5f
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/run-ptest
@@ -0,0 +1,5 @@
1#!/bin/sh
2touch testsuite/stamp-rootfs
3tar xf testmodule.tar
4make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL
5find testsuite -name *.ko -exec rm -f {} \;