2018-03-09 09:51:45 +01:00
|
|
|
From 5ed5ab09ff7d4fb581aec3a35f2eff24eaa838f9 Mon Sep 17 00:00:00 2001
|
2014-03-05 16:59:07 +01:00
|
|
|
From: Michal Marek <mmarek@suse.cz>
|
|
|
|
Date: Wed, 5 Mar 2014 15:02:44 +0100
|
2018-03-09 09:51:45 +01:00
|
|
|
Subject: [PATCH] modprobe: Implement --allow-unsupported-modules
|
2014-03-05 16:59:07 +01:00
|
|
|
|
|
|
|
References: fate#316971
|
|
|
|
Patch-mainline: never
|
|
|
|
---
|
2018-03-09 09:51:45 +01:00
|
|
|
Makefile.am | 4 +++-
|
|
|
|
libkmod/libkmod-unsupported.c | 9 +++++++++
|
|
|
|
libkmod/libkmod-unsupported.h | 8 ++++++++
|
|
|
|
tools/modprobe.c | 8 +++++++-
|
2015-04-21 18:20:20 +02:00
|
|
|
4 files changed, 27 insertions(+), 2 deletions(-)
|
2014-03-05 16:59:07 +01:00
|
|
|
create mode 100644 libkmod/libkmod-unsupported.c
|
|
|
|
create mode 100644 libkmod/libkmod-unsupported.h
|
|
|
|
|
2018-03-09 09:51:45 +01:00
|
|
|
diff --git a/Makefile.am b/Makefile.am
|
|
|
|
index 26384ccd6de1..d9856f77f8f6 100644
|
|
|
|
--- a/Makefile.am
|
|
|
|
+++ b/Makefile.am
|
|
|
|
@@ -106,7 +106,9 @@ libkmod_libkmod_la_LIBADD = \
|
|
|
|
${libpkcs7asn1c_LIBS}
|
2014-03-05 16:59:07 +01:00
|
|
|
|
|
|
|
noinst_LTLIBRARIES += libkmod/libkmod-internal.la
|
|
|
|
-libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
|
|
|
|
+libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES) \
|
|
|
|
+ libkmod/libkmod-unsupported.c \
|
|
|
|
+ libkmod/libkmod-unsupported.h
|
|
|
|
libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \
|
|
|
|
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
|
|
|
|
libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES)
|
2018-03-09 09:51:45 +01:00
|
|
|
diff --git a/libkmod/libkmod-unsupported.c b/libkmod/libkmod-unsupported.c
|
|
|
|
new file mode 100644
|
|
|
|
index 000000000000..7ef9fc875b46
|
2014-03-05 16:59:07 +01:00
|
|
|
--- /dev/null
|
2018-03-09 09:51:45 +01:00
|
|
|
+++ b/libkmod/libkmod-unsupported.c
|
2014-03-05 16:59:07 +01:00
|
|
|
@@ -0,0 +1,9 @@
|
|
|
|
+#include "libkmod-internal.h"
|
|
|
|
+#include "libkmod-unsupported.h"
|
|
|
|
+
|
|
|
|
+void kmod_internal_allow_unsupported(struct kmod_ctx *ctx)
|
|
|
|
+{
|
|
|
|
+ struct kmod_config *config = (struct kmod_config *)kmod_get_config(ctx);
|
|
|
|
+
|
|
|
|
+ config->block_unsupported = 0;
|
|
|
|
+}
|
2018-03-09 09:51:45 +01:00
|
|
|
diff --git a/libkmod/libkmod-unsupported.h b/libkmod/libkmod-unsupported.h
|
|
|
|
new file mode 100644
|
|
|
|
index 000000000000..a95b4a22fd14
|
2014-03-05 16:59:07 +01:00
|
|
|
--- /dev/null
|
2018-03-09 09:51:45 +01:00
|
|
|
+++ b/libkmod/libkmod-unsupported.h
|
2014-03-05 16:59:07 +01:00
|
|
|
@@ -0,0 +1,8 @@
|
|
|
|
+#pragma once
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+ * This function implements the --allow-unsupported-modules modprobe
|
|
|
|
+ * option. It is not part of the kmod API and not exported by the shared
|
|
|
|
+ * library
|
|
|
|
+ */
|
|
|
|
+void kmod_internal_allow_unsupported(struct kmod_ctx *ctx);
|
2018-03-09 09:51:45 +01:00
|
|
|
diff --git a/tools/modprobe.c b/tools/modprobe.c
|
|
|
|
index c0b7c6854375..1f6f28666183 100644
|
|
|
|
--- a/tools/modprobe.c
|
|
|
|
+++ b/tools/modprobe.c
|
2014-11-16 21:44:45 +01:00
|
|
|
@@ -38,6 +38,8 @@
|
2014-03-05 16:59:07 +01:00
|
|
|
|
|
|
|
#include "kmod.h"
|
2014-11-16 21:44:45 +01:00
|
|
|
|
2015-04-21 18:20:20 +02:00
|
|
|
+#include "libkmod/libkmod-unsupported.h"
|
2014-11-16 21:44:45 +01:00
|
|
|
+
|
|
|
|
static int log_priority = LOG_CRIT;
|
|
|
|
static int use_syslog = 0;
|
|
|
|
#define LOG(...) log_printf(log_priority, __VA_ARGS__)
|
2018-03-09 09:51:45 +01:00
|
|
|
@@ -729,6 +731,7 @@ static int do_modprobe(int argc, char **orig_argv)
|
2014-03-05 16:59:07 +01:00
|
|
|
int do_remove = 0;
|
|
|
|
int do_show_config = 0;
|
|
|
|
int do_show_modversions = 0;
|
|
|
|
+ int allow_unsupported = 0;
|
|
|
|
int err;
|
|
|
|
|
|
|
|
argv = prepend_options_from_env(&argc, orig_argv);
|
2018-03-09 09:51:45 +01:00
|
|
|
@@ -812,7 +815,7 @@ static int do_modprobe(int argc, char **orig_argv)
|
2014-03-05 16:59:07 +01:00
|
|
|
kversion = optarg;
|
|
|
|
break;
|
|
|
|
case 128:
|
|
|
|
- /* --allow-unsupported-modules does nothing for now */
|
|
|
|
+ allow_unsupported = 1;
|
|
|
|
break;
|
|
|
|
case 's':
|
|
|
|
env_modprobe_options_append("-s");
|
2018-03-09 09:51:45 +01:00
|
|
|
@@ -885,6 +888,9 @@ static int do_modprobe(int argc, char **orig_argv)
|
2014-03-05 16:59:07 +01:00
|
|
|
|
|
|
|
log_setup_kmod_log(ctx, verbose);
|
|
|
|
|
|
|
|
+ if (allow_unsupported)
|
|
|
|
+ kmod_internal_allow_unsupported(ctx);
|
|
|
|
+
|
|
|
|
kmod_load_resources(ctx);
|
|
|
|
|
|
|
|
if (do_show_config)
|
2018-03-09 09:51:45 +01:00
|
|
|
--
|
|
|
|
2.13.6
|
|
|
|
|