Linux-Modules Archive on lore.kernel.org
 help / Atom feed
* [RESEND PATCH] modprobe: install default configuration
@ 2017-09-01 11:28 Lubomir Rintel
  2017-09-08 21:03 ` Lucas De Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Lubomir Rintel @ 2017-09-01 11:28 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
---
This seems to have slipped through the cracks.

 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 2a1eb50..b114db8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -105,6 +105,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.13.5


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

* Re: [RESEND PATCH] modprobe: install default configuration
  2017-09-01 11:28 [RESEND PATCH] modprobe: install default configuration Lubomir Rintel
@ 2017-09-08 21:03 ` Lucas De Marchi
  2017-09-08 21:30   ` md
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2017-09-08 21:03 UTC (permalink / raw)
  To: Lubomir Rintel; +Cc: Lucas De Marchi, linux-modules, jeyu

On Fri, Sep 1, 2017 at 4:28 AM, Lubomir Rintel <lkundrak@v3.sk> wrote:
> 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
> ---
> This seems to have slipped through the cracks.
>
>  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 2a1eb50..b114db8 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -105,6 +105,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.13.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-modules" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


It seems you forgot to follow up on the feedback I gave last time and
asked for opinions.

https://lkml.org/lkml/2016/6/14/336

CC'ing Jessica as well for opinions who is maintaining the kernel part.

Lucas De Marchi

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

* Re: [RESEND PATCH] modprobe: install default configuration
  2017-09-08 21:03 ` Lucas De Marchi
@ 2017-09-08 21:30   ` md
  0 siblings, 0 replies; 3+ messages in thread
From: md @ 2017-09-08 21:30 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: Lubomir Rintel, Lucas De Marchi, linux-modules, jeyu

[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]

On Sep 08, Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:

> On Fri, Sep 1, 2017 at 4:28 AM, Lubomir Rintel <lkundrak@v3.sk> wrote:
> > 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:
I agree that this behaviour by dummy, bonding, etc is unfortunate
and annoying; however, I do not believe that user space tools
maintainers overriding the decisions of kernel maintainers will help
creating an healty environment.

As the Debian kmod maintainer I would also be seriously concerned about
carrying this change since it would break existing configurations on
upgrades.

> It seems you forgot to follow up on the feedback I gave last time and
> asked for opinions.
> 
> https://lkml.org/lkml/2016/6/14/336
I think that this would create excessive complexity and force everybody 
to learn the semantics of this new directive.
If you really believe that copying the whole file would be bad then just 
split the directives in multiple files.

-- 
ciao,
Marco

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 11:28 [RESEND PATCH] modprobe: install default configuration Lubomir Rintel
2017-09-08 21:03 ` Lucas De Marchi
2017-09-08 21:30   ` md

Linux-Modules Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-modules/0 linux-modules/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-modules linux-modules/ https://lore.kernel.org/linux-modules \
		linux-modules@vger.kernel.org linux-modules@archiver.kernel.org
	public-inbox-index linux-modules


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-modules


AGPL code for this site: git clone https://public-inbox.org/ public-inbox