linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] modprobe: install default configuration
@ 2016-03-02 15:18 Lubomir Rintel
  2016-03-02 15:55 ` Marco d'Itri
  0 siblings, 1 reply; 11+ messages in thread
From: Lubomir Rintel @ 2016-03-02 15:18 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules, Lubomir Rintel

Some network devices have an awful habit of creating interfaces when loaded,
despite not asked for. Worse even, they do so while being autoloaded due to an
attempt to create a device via netlink:

  # rmmod dummy
  # ip link add dummy0 type dummy
  RTNETLINK answers: File exists

The kernel maintainers seem opposed to fixing this in kernel (despite a similar
thing has been done with loop block devices) [1]. Let's fix this my overriding the
defaults from userspace.

[1] http://comments.gmane.org/gmane.linux.kernel/2124714
---
 Makefile.am                |  4 ++++
 modprobe.d/50-default.conf | 24 ++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 modprobe.d/50-default.conf

diff --git a/Makefile.am b/Makefile.am
index 2d9f2cf..9f89485 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -103,6 +103,10 @@ bashcompletiondir=@bashcompletiondir@
 dist_bashcompletion_DATA = \
 	shell-completion/bash/kmod
 
+modprobeddir=$(prefix)/lib/modprobe.d
+dist_modprobed_DATA = \
+	modprobe.d/50-default.conf
+
 install-exec-hook:
 	if test "$(libdir)" != "$(rootlibdir)"; then \
 		$(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
diff --git a/modprobe.d/50-default.conf b/modprobe.d/50-default.conf
new file mode 100644
index 0000000..70d21f2
--- /dev/null
+++ b/modprobe.d/50-default.conf
@@ -0,0 +1,24 @@
+# default module parameters
+#
+# This file is part of kmod.
+#
+# Copyright 2016 Lubomir Rintel
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+# See modprobe.d(5) for the description of the files in this directory,
+
+options bonding max_bonds=0
+options dummy numdummies=0
+options ifb numifbs=0
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-06-14 12:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-02 15:18 [PATCH] modprobe: install default configuration Lubomir Rintel
2016-03-02 15:55 ` Marco d'Itri
2016-03-02 16:07   ` De Marchi, Lucas
2016-03-02 16:28     ` Lubomir Rintel
2016-03-04  5:02       ` Lucas De Marchi
2016-03-29 10:27         ` Lubomir Rintel
2016-04-13  4:11           ` Lucas De Marchi
2016-04-23 18:18             ` Lubomir Rintel
2016-06-14 12:55               ` Lucas De Marchi
2016-03-02 17:10     ` Marco d'Itri
2016-03-04  5:04       ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).