linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Schwarzott <zzam@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: Make rule generator switchable
Date: Fri, 27 Jul 2007 17:04:50 +0000	[thread overview]
Message-ID: <200707271904.51531.zzam@gentoo.org> (raw)

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

Hi there!

I thought about making rule generator/persistent-net user switchable. As this 
was not possible yet, I implemented one possibility. This reads udev.conf 
from write_(cd|net)_rules and aborts if there is:
persistent_cd_generator="disabled"

Is there a better method to do this? If not, how about including this, and 
perhaps commented out part for config file.

#Disable generation of persistent-rules for cd devices
#persistent_cd_generator="disabled"

# Disable generation of persistent-rules for network devices
#persistent_net_generator="disabled"


Matthias
-- 
Matthias Schwarzott (zzam)

[-- Attachment #2: udev-disable-switch-rule-generator.diff --]
[-- Type: text/x-diff, Size: 1057 bytes --]

diff --git a/extras/rule_generator/write_cd_rules b/extras/rule_generator/write_cd_rules
index bd951c5..21b48e9 100644
--- a/extras/rule_generator/write_cd_rules
+++ b/extras/rule_generator/write_cd_rules
@@ -14,6 +14,11 @@
 RULES_FILE="/etc/udev/rules.d/70-persistent-cd.rules"
 
 . /lib/udev/rule_generator.functions
+[ -r /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+if [ "$persistent_cd_generator" = "disabled" ]; then
+	exit 1
+fi
 
 find_next_available() {
 	raw_find_next_available "$(find_all_rules 'SYMLINK+=' $1)"
diff --git a/extras/rule_generator/write_net_rules b/extras/rule_generator/write_net_rules
index b873b5b..37c0130 100644
--- a/extras/rule_generator/write_net_rules
+++ b/extras/rule_generator/write_net_rules
@@ -19,6 +19,11 @@
 RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules'
 
 . /lib/udev/rule_generator.functions
+[ -r /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+if [ "$persistent_net_generator" = "disabled" ]; then
+	exit 1
+fi
 
 interface_name_taken() {
 	local value="$(find_all_rules 'NAME=' $INTERFACE)"

[-- Attachment #3: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

             reply	other threads:[~2007-07-27 17:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-27 17:04 Matthias Schwarzott [this message]
2007-07-27 17:55 ` Make rule generator switchable Kay Sievers
2007-07-27 18:05 ` Bill Nottingham
2007-07-27 18:17 ` Kay Sievers
2007-07-27 18:32 ` Marco d'Itri
2007-07-27 19:10 ` Matthias Schwarzott
2007-07-27 20:04 ` Matthias Schwarzott
2007-08-01 19:31 ` Matthias Schwarzott
2007-08-02  9:06 ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200707271904.51531.zzam@gentoo.org \
    --to=zzam@gentoo.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).