Accepting request 247492 from home:michal-m:branches:Base:System

- Do not filter unsupported modules when running a vanilla kernel
  (bnc#871066)
  new patch: 0005-Do-not-filter-unsupported-modules-when-running-a-van.patch
- Renumbered remaining patches.

OBS-URL: https://build.opensuse.org/request/show/247492
OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=76
This commit is contained in:
Jan Engelhardt 2014-09-04 09:27:48 +00:00 committed by Git OBS Bridge
parent 8797ee9329
commit bb5bee2e71
7 changed files with 87 additions and 26 deletions

View File

@ -1,7 +1,7 @@
From 820ce4a006eeb230ee597e7565b17cec464ef15d Mon Sep 17 00:00:00 2001 From ae166d55534d92e12e4892431075539474c59918 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz> From: Michal Marek <mmarek@suse.cz>
Date: Wed, 26 Feb 2014 13:48:55 +0100 Date: Wed, 26 Feb 2014 13:48:55 +0100
Subject: [PATCH 02/10] modprobe: Recognize --allow-unsupported-modules on Subject: [PATCH 1/5] modprobe: Recognize --allow-unsupported-modules on
commandline commandline
The option does not do anything yet, but it does not return error The option does not do anything yet, but it does not return error

View File

@ -1,7 +1,7 @@
From 717e10547654bceebbcb84144be72a40d78e577a Mon Sep 17 00:00:00 2001 From d607994c7b086afae09a8cded8bf6c5e8682541e Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz> From: Michal Marek <mmarek@suse.cz>
Date: Wed, 26 Feb 2014 13:53:38 +0100 Date: Wed, 26 Feb 2014 13:53:38 +0100
Subject: [PATCH 03/10] libkmod-config: Recognize allow_unsupported_modules in Subject: [PATCH 2/5] libkmod-config: Recognize allow_unsupported_modules in
the configuration the configuration
References: fate#316971 References: fate#316971
@ -11,10 +11,10 @@ Patch-mainline: never
1 file changed, 3 insertions(+) 1 file changed, 3 insertions(+)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 32adb8b..3950923 100644 index 0953924..79bfb9b 100644
--- a/libkmod/libkmod-config.c --- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c
@@ -662,6 +662,9 @@ static int kmod_config_parse(struct kmod_config *config, int fd, @@ -667,6 +667,9 @@ static int kmod_config_parse(struct kmod_config *config, int fd,
|| streq(cmd, "config")) { || streq(cmd, "config")) {
ERR(ctx, "%s: command %s is deprecated and not parsed anymore\n", ERR(ctx, "%s: command %s is deprecated and not parsed anymore\n",
filename, cmd); filename, cmd);

View File

@ -1,8 +1,8 @@
From 36bb8bc7f4100d7ffc4d6d0436e36e48fa7c075f Mon Sep 17 00:00:00 2001 From 153da67042852b7667ce4479d14835450c908417 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz> From: Michal Marek <mmarek@suse.cz>
Date: Wed, 5 Mar 2014 14:40:14 +0100 Date: Wed, 5 Mar 2014 14:40:14 +0100
Subject: [PATCH 09/10] libkmod: Implement filtering of unsupported modules Subject: [PATCH 3/5] libkmod: Implement filtering of unsupported modules (off
(off by default) by default)
References: fate#316971 References: fate#316971
Patch-mainline: never Patch-mainline: never
@ -13,10 +13,10 @@ Patch-mainline: never
3 files changed, 42 insertions(+), 2 deletions(-) 3 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 3950923..385a224 100644 index 79bfb9b..9f47cfd 100644
--- a/libkmod/libkmod-config.c --- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c
@@ -663,8 +663,16 @@ static int kmod_config_parse(struct kmod_config *config, int fd, @@ -668,8 +668,16 @@ static int kmod_config_parse(struct kmod_config *config, int fd,
ERR(ctx, "%s: command %s is deprecated and not parsed anymore\n", ERR(ctx, "%s: command %s is deprecated and not parsed anymore\n",
filename, cmd); filename, cmd);
} else if (streq(cmd, "allow_unsupported_modules")) { } else if (streq(cmd, "allow_unsupported_modules")) {
@ -36,10 +36,10 @@ index 3950923..385a224 100644
syntax_error: syntax_error:
ERR(ctx, "%s line %u: ignoring bad line starting with '%s'\n", ERR(ctx, "%s line %u: ignoring bad line starting with '%s'\n",
diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
index 0180124..596db5d 100644 index 93a00c1..3a46b6b 100644
--- a/libkmod/libkmod-internal.h --- a/libkmod/libkmod-internal.h
+++ b/libkmod/libkmod-internal.h +++ b/libkmod/libkmod-internal.h
@@ -118,6 +118,7 @@ struct kmod_config { @@ -119,6 +119,7 @@ struct kmod_config {
struct kmod_list *softdeps; struct kmod_list *softdeps;
struct kmod_list *paths; struct kmod_list *paths;
@ -48,10 +48,10 @@ index 0180124..596db5d 100644
int kmod_config_new(struct kmod_ctx *ctx, struct kmod_config **config, const char * const *config_paths) __attribute__((nonnull(1, 2,3))); int kmod_config_new(struct kmod_ctx *ctx, struct kmod_config **config, const char * const *config_paths) __attribute__((nonnull(1, 2,3)));
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index b94abd4..ee52b97 100644 index e3cc5a7..3a9ce7c 100644
--- a/libkmod/libkmod-module.c --- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c
@@ -769,6 +769,24 @@ KMOD_EXPORT int kmod_module_remove_module(struct kmod_module *mod, @@ -782,6 +782,24 @@ KMOD_EXPORT int kmod_module_remove_module(struct kmod_module *mod,
extern long init_module(const void *mem, unsigned long len, const char *args); extern long init_module(const void *mem, unsigned long len, const char *args);
@ -76,7 +76,7 @@ index b94abd4..ee52b97 100644
/** /**
* kmod_module_insert_module: * kmod_module_insert_module:
* @mod: kmod module * @mod: kmod module
@@ -794,6 +812,7 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod, @@ -807,6 +825,7 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod,
struct kmod_elf *elf; struct kmod_elf *elf;
const char *path; const char *path;
const char *args = options ? options : ""; const char *args = options ? options : "";
@ -84,7 +84,7 @@ index b94abd4..ee52b97 100644
if (mod == NULL) if (mod == NULL)
return -ENOENT; return -ENOENT;
@@ -810,6 +829,18 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod, @@ -823,6 +842,18 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod,
return err; return err;
} }

View File

@ -1,7 +1,7 @@
From 714b9b5241f5fc6120c74f35d6a374e032bad6df Mon Sep 17 00:00:00 2001 From ea7f79db6890b99558adc9badd543e8ab59bc756 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz> From: Michal Marek <mmarek@suse.cz>
Date: Wed, 5 Mar 2014 15:02:44 +0100 Date: Wed, 5 Mar 2014 15:02:44 +0100
Subject: [PATCH 10/10] modprobe: Implement --allow-unsupported-modules Subject: [PATCH 4/5] modprobe: Implement --allow-unsupported-modules
References: fate#316971 References: fate#316971
Patch-mainline: never Patch-mainline: never
@ -15,10 +15,10 @@ Patch-mainline: never
create mode 100644 libkmod/libkmod-unsupported.h create mode 100644 libkmod/libkmod-unsupported.h
diff --git a/Makefile.am b/Makefile.am diff --git a/Makefile.am b/Makefile.am
index 46b7652..9986730 100644 index eb63073..1c3eee4 100644
--- a/Makefile.am --- a/Makefile.am
+++ b/Makefile.am +++ b/Makefile.am
@@ -78,7 +78,9 @@ libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \ @@ -79,7 +79,9 @@ libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \
${liblzma_LIBS} ${zlib_LIBS} ${liblzma_LIBS} ${zlib_LIBS}
noinst_LTLIBRARIES += libkmod/libkmod-internal.la noinst_LTLIBRARIES += libkmod/libkmod-internal.la

View File

@ -0,0 +1,52 @@
From be9bfe0f3724624d4b0240dbe6d580b7ae8b5256 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz>
Date: Fri, 4 Apr 2014 10:08:01 +0200
Subject: [PATCH 5/5] Do not filter unsupported modules when running a vanilla
kernel
References: bnc#871066
Patch-mainline: never
---
libkmod/libkmod-config.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 9f47cfd..9a486c4 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -573,6 +573,18 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
}
/*
+ * Check if kernel is built with the SUSE "suppported-flag" patch
+ */
+static int is_suse_kernel(void)
+{
+ if (access("/proc/sys/kernel/", F_OK) == 0 &&
+ access("/proc/sys/kernel/unsupported", F_OK) == -1 &&
+ errno == ENOENT)
+ return 0;
+ return 1;
+}
+
+/*
* Take an fd and own it. It will be closed on return. filename is used only
* for debug messages
*/
@@ -674,9 +686,10 @@ static int kmod_config_parse(struct kmod_config *config, int fd,
goto syntax_error;
if (streq(param, "yes") || streq(param, "1"))
config->block_unsupported = 0;
- else if (streq(param, "no") || streq(param, "0"))
- config->block_unsupported = 1;
- else
+ else if (streq(param, "no") || streq(param, "0")) {
+ if (is_suse_kernel())
+ config->block_unsupported = 1;
+ } else
goto syntax_error;
} else {
syntax_error:
--
1.8.4.5

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Sep 4 09:16:19 UTC 2014 - mmarek@suse.cz
- Do not filter unsupported modules when running a vanilla kernel
(bnc#871066)
new patch: 0005-Do-not-filter-unsupported-modules-when-running-a-van.patch
- Renumbered remaining patches.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jun 24 13:15:37 UTC 2014 - jengelh@inai.de Tue Jun 24 13:15:37 UTC 2014 - jengelh@inai.de

View File

@ -30,10 +30,11 @@ Url: http://www.jonmasters.org/blog/2011/12/20/libkmod-replaces-modul
#Git-Clone: git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod #Git-Clone: git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod
Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.xz Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.xz
Source2: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.sign Source2: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.sign
Patch2: 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch Patch1: 0001-modprobe-Recognize-allow-unsupported-modules-on-comm.patch
Patch3: 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch Patch2: 0002-libkmod-config-Recognize-allow_unsupported_modules-i.patch
Patch9: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch Patch3: 0003-libkmod-Implement-filtering-of-unsupported-modules-o.patch
Patch10: 0010-modprobe-Implement-allow-unsupported-modules.patch Patch4: 0004-modprobe-Implement-allow-unsupported-modules.patch
Patch5: 0005-Do-not-filter-unsupported-modules-when-running-a-van.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
@ -98,7 +99,7 @@ in %lname.
%prep %prep
%setup -q %setup -q
%patch -P 2 -P 3 -P 9 -P 10 -p1 %patch -P 1 -P 2 -P 3 -P 4 -P 5 -p1
%build %build
autoreconf -fi autoreconf -fi