From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Schwarzott Date: Fri, 27 Jul 2007 17:04:50 +0000 Subject: Make rule generator switchable Message-Id: <200707271904.51531.zzam@gentoo.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_zWiqGEavimgliJz" List-Id: To: linux-hotplug@vger.kernel.org --Boundary-00=_zWiqGEavimgliJz Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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) --Boundary-00=_zWiqGEavimgliJz Content-Type: text/x-diff; charset="utf-8"; name="udev-disable-switch-rule-generator.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="udev-disable-switch-rule-generator.diff" 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)" --Boundary-00=_zWiqGEavimgliJz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --Boundary-00=_zWiqGEavimgliJz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --Boundary-00=_zWiqGEavimgliJz--