kmod/0011-Do-not-filter-unsupported-modules-when-running-a-van.patch

53 lines
1.5 KiB
Diff
Raw Normal View History

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