From patchwork Fri Sep 1 11:28:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 9933941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3810760350 for ; Fri, 1 Sep 2017 11:34:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DF93200F5 for ; Fri, 1 Sep 2017 11:34:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12306205FD; Fri, 1 Sep 2017 11:34:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20999200F5 for ; Fri, 1 Sep 2017 11:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbdIALeO (ORCPT ); Fri, 1 Sep 2017 07:34:14 -0400 Received: from shell.v3.sk ([92.60.52.57]:47210 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863AbdIALeO (ORCPT ); Fri, 1 Sep 2017 07:34:14 -0400 X-Greylist: delayed 354 seconds by postgrey-1.27 at vger.kernel.org; Fri, 01 Sep 2017 07:34:13 EDT Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 5C9886E0BB; Fri, 1 Sep 2017 13:28:17 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id k1IUrymDHoTa; Fri, 1 Sep 2017 13:28:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 98CA26E0BC; Fri, 1 Sep 2017 13:28:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TVG9BmzOogr2; Fri, 1 Sep 2017 13:28:09 +0200 (CEST) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 33C746E0BB; Fri, 1 Sep 2017 13:28:09 +0200 (CEST) From: Lubomir Rintel To: Lucas De Marchi Cc: linux-modules@vger.kernel.org, Lubomir Rintel Subject: [RESEND PATCH] modprobe: install default configuration Date: Fri, 1 Sep 2017 13:28:01 +0200 Message-Id: <20170901112801.11703-1-lkundrak@v3.sk> X-Mailer: git-send-email 2.13.5 Sender: owner-linux-modules@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 . + +# 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