linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Make rule generator switchable
@ 2007-07-27 17:04 Matthias Schwarzott
  2007-07-27 17:55 ` Kay Sievers
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Matthias Schwarzott @ 2007-07-27 17:04 UTC (permalink / raw)
  To: linux-hotplug

[-- 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

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

end of thread, other threads:[~2007-08-02  9:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-27 17:04 Make rule generator switchable Matthias Schwarzott
2007-07-27 17:55 ` 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

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).