* 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
* Re: Make rule generator switchable
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
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Kay Sievers @ 2007-07-27 17:55 UTC (permalink / raw)
To: linux-hotplug
On 7/27/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> 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"
Just don't install the rules then? Why would you want to run the
scripts at all, if you don't need them?
How should todays boxes work without persistent network names? They
are as needed as LABEL, UUID, or /dev/disk/ for block devices. The old
way of having luck to get the same kernel device names across reboots,
just doesn't work today.
Thanks,
Kay
-------------------------------------------------------------------------
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/
_______________________________________________
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 [flat|nested] 9+ messages in thread
* Re: Make rule generator switchable
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
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Bill Nottingham @ 2007-07-27 18:05 UTC (permalink / raw)
To: linux-hotplug
Kay Sievers (kay.sievers@vrfy.org) said:
> How should todays boxes work without persistent network names? They
> are as needed as LABEL, UUID, or /dev/disk/ for block devices. The old
> way of having luck to get the same kernel device names across reboots,
> just doesn't work today.
The problem with the persistent net rule generator is when it's run - it
is never run (at least under Fedora and related distributions) at a time
when it's actually able to *write* rules.
Bill
-------------------------------------------------------------------------
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/
_______________________________________________
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 [flat|nested] 9+ messages in thread
* Re: Make rule generator switchable
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
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Kay Sievers @ 2007-07-27 18:17 UTC (permalink / raw)
To: linux-hotplug
On Fri, 2007-07-27 at 14:05 -0400, Bill Nottingham wrote:
> Kay Sievers (kay.sievers@vrfy.org) said:
> > How should todays boxes work without persistent network names? They
> > are as needed as LABEL, UUID, or /dev/disk/ for block devices. The old
> > way of having luck to get the same kernel device names across reboots,
> > just doesn't work today.
>
> The problem with the persistent net rule generator is when it's run - it
> is never run (at least under Fedora and related distributions) at a time
> when it's actually able to *write* rules.
Not a problem, it writes temporary rules to /dev/.udev, you are
expected to copy over, if you system does not allow to write to /etc at
that time.
Kay
-------------------------------------------------------------------------
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/
_______________________________________________
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 [flat|nested] 9+ messages in thread
* Re: Make rule generator switchable
2007-07-27 17:04 Make rule generator switchable Matthias Schwarzott
` (2 preceding siblings ...)
2007-07-27 18:17 ` Kay Sievers
@ 2007-07-27 18:32 ` Marco d'Itri
2007-07-27 19:10 ` Matthias Schwarzott
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Marco d'Itri @ 2007-07-27 18:32 UTC (permalink / raw)
To: linux-hotplug
On Jul 27, Kay Sievers <kay.sievers@vrfy.org> wrote:
> Just don't install the rules then? Why would you want to run the
> scripts at all, if you don't need them?
Debian uses a symlink because there are some situations where it does
not work (the most common one still unsolved is Sun systems with
multiple ethernet interfaces having the same MAC address).
--
ciao,
Marco
-------------------------------------------------------------------------
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/
_______________________________________________
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 [flat|nested] 9+ messages in thread
* Re: Make rule generator switchable
2007-07-27 17:04 Make rule generator switchable Matthias Schwarzott
` (3 preceding siblings ...)
2007-07-27 18:32 ` Marco d'Itri
@ 2007-07-27 19:10 ` Matthias Schwarzott
2007-07-27 20:04 ` Matthias Schwarzott
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Matthias Schwarzott @ 2007-07-27 19:10 UTC (permalink / raw)
To: linux-hotplug
On Friday 27 July 2007, you wrote:
>
> Just don't install the rules then? Why would you want to run the
> scripts at all, if you don't need them?
>
> How should todays boxes work without persistent network names? They
> are as needed as LABEL, UUID, or /dev/disk/ for block devices. The old
> way of having luck to get the same kernel device names across reboots,
> just doesn't work today.
>
A nice situation where it does not work is: xen domains with random mac.
Or: cloning installations that have same hw and just one NIC but as they have
different macs persistent-net will fail.
Matthias
--
Matthias Schwarzott (zzam)
-------------------------------------------------------------------------
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/
_______________________________________________
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 [flat|nested] 9+ messages in thread
* Re: Make rule generator switchable
2007-07-27 17:04 Make rule generator switchable Matthias Schwarzott
` (4 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: Matthias Schwarzott @ 2007-07-27 20:04 UTC (permalink / raw)
To: linux-hotplug
On Freitag, 27. Juli 2007, Marco d'Itri wrote:
> On Jul 27, Kay Sievers <kay.sievers@vrfy.org> wrote:
> > Just don't install the rules then? Why would you want to run the
> > scripts at all, if you don't need them?
>
> Debian uses a symlink because there are some situations where it does
> not work (the most common one still unsolved is Sun systems with
> multiple ethernet interfaces having the same MAC address).
Gentoo does not uses symlinks, but we up to now miss some setup to selectively
disable rules.
Other way I thought of was: Adding ENV{DISABLE_PERSISTENT_NET}!="?*" to the
rule, and then getting that var into udev. Perhaps injecting it via
udevcontrol directly after starting udevd.
Matthias
--
Matthias Schwarzott (zzam)
-------------------------------------------------------------------------
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/
_______________________________________________
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 [flat|nested] 9+ messages in thread
* Re: Make rule generator switchable
2007-07-27 17:04 Make rule generator switchable Matthias Schwarzott
` (5 preceding siblings ...)
2007-07-27 20:04 ` Matthias Schwarzott
@ 2007-08-01 19:31 ` Matthias Schwarzott
2007-08-02 9:06 ` Kay Sievers
7 siblings, 0 replies; 9+ messages in thread
From: Matthias Schwarzott @ 2007-08-01 19:31 UTC (permalink / raw)
To: linux-hotplug
On Freitag, 27. Juli 2007, Kay Sievers wrote:
> On 7/27/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > 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"
>
> Just don't install the rules then? Why would you want to run the
> scripts at all, if you don't need them?
>
Well, the problem here is:
If you unpack a basic gentoo stage you get an already installed udev. WITH the
persistent-net rules.
Should we rely on the user to remove it and always remove it again after
update.
Or Add some install time flag to udev package - but package manager portage
will not remove the file if already existing for config-protection issues.
I clain: There is no sane way to disable specific rules config-wise.
Is there no possibilities to inject some env vars into udev without calling
udevcontrol - but perhaps from udev.conf ?
Matthias
--
Matthias Schwarzott (zzam)
-------------------------------------------------------------------------
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/
_______________________________________________
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 [flat|nested] 9+ messages in thread
* Re: Make rule generator switchable
2007-07-27 17:04 Make rule generator switchable Matthias Schwarzott
` (6 preceding siblings ...)
2007-08-01 19:31 ` Matthias Schwarzott
@ 2007-08-02 9:06 ` Kay Sievers
7 siblings, 0 replies; 9+ messages in thread
From: Kay Sievers @ 2007-08-02 9:06 UTC (permalink / raw)
To: linux-hotplug
On 8/1/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> On Freitag, 27. Juli 2007, Kay Sievers wrote:
> > On 7/27/07, Matthias Schwarzott <zzam@gentoo.org> wrote:
> > > 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"
> >
> > Just don't install the rules then? Why would you want to run the
> > scripts at all, if you don't need them?
> >
> Well, the problem here is:
> If you unpack a basic gentoo stage you get an already installed udev. WITH the
> persistent-net rules.
> Should we rely on the user to remove it and always remove it again after
> update.
>
> Or Add some install time flag to udev package - but package manager portage
> will not remove the file if already existing for config-protection issues.
For RPM you would just create a subpackage, which contain the rules
and scripts, which the user can install or remove if needed. Btw,
default udev rules are not configuration files. They are not meant to
be edited by end users and expected to be replaced by every package
update, so installing with a "disable flag" should probably at least
rename the existing rules file do disable it.
> I clain: There is no sane way to disable specific rules config-wise.
> Is there no possibilities to inject some env vars into udev without calling
> udevcontrol - but perhaps from udev.conf ?
Create a rules file to set these values? If possible, all policy
should live in the rules files itself. For the net rules, you could
probably just do:
SUBSYSTEM="net", NAME="%k"
to disable the rules generator.
Kay
-------------------------------------------------------------------------
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/
_______________________________________________
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 [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).