All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Udev integration: udev rules 2/3
@ 2009-04-08 12:35 Peter Rajnoha
  2009-04-15 18:12 ` Alasdair G Kergon
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Rajnoha @ 2009-04-08 12:35 UTC (permalink / raw)
  To: lvm-devel

This one is for LVM -- to create symlinks under /dev directory.
That's all :)

# udev rules for LVM 
# This will create LVM symlinks in /dev directory.

SUBSYSTEM!="block", GOTO="lvm_end"
KERNEL!="dm-[0-9]*", GOTO="lvm_end"
ACTION!="change|remove", GOTO="lvm_end"

ACTION=="change", IMPORT{PROGRAM}="/sbin/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o name,uuid,subsystem,vg_name,lv_name,lv_layer"
ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"

# Do not create symlinks for hidden subdevices.
ENV{DM_LV_NAME}=="?*_mlog", GOTO="notify"
ENV{DM_LV_NAME}=="?*_mimage_[0-9]*", GOTO="notify"

# Create symlinks for top level devices only.
ENV{DM_VG_NAME}=="?*", ENV{DM_LV_NAME}=="?*", ENV{DM_LV_LAYER}!="?*", SYMLINK+="$env{DM_VG_NAME}/$env{DM_LV_NAME}"

LABEL="notify", ENV{COOKIE}=="[0-9]*", RUN+="/sbin/dmsetup notify $env{COOKIE}", OPTIONS+="last_rule"

LABEL="lvm_end"



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

* [PATCH] Udev integration: udev rules 2/3
  2009-04-08 12:35 [PATCH] Udev integration: udev rules 2/3 Peter Rajnoha
@ 2009-04-15 18:12 ` Alasdair G Kergon
  2009-04-20 10:07   ` Peter Rajnoha
  2009-04-20 10:15   ` Peter Rajnoha
  0 siblings, 2 replies; 4+ messages in thread
From: Alasdair G Kergon @ 2009-04-15 18:12 UTC (permalink / raw)
  To: lvm-devel

On Wed, Apr 08, 2009 at 02:35:35PM +0200, Peter Rajnoha wrote:
> # udev rules for LVM 
> # This will create LVM symlinks in /dev directory.
 
Again, describe in more detail what the script is doing.
Needs (C) notices too.

> SUBSYSTEM!="block", GOTO="lvm_end"
> KERNEL!="dm-[0-9]*", GOTO="lvm_end"
> ACTION!="change|remove", GOTO="lvm_end"
> 
> ACTION=="change", IMPORT{PROGRAM}="/sbin/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o name,uuid,subsystem,vg_name,lv_name,lv_layer"

If we already have the name (e.g. from sysfs), I think we talked about adding
a 'split up this name' command to dmsetup which does not perform any ioctls.

> ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"

Seems to be some repetition here.  Does udev support including files inline
within other files?
 
> # Do not create symlinks for hidden subdevices.
> ENV{DM_LV_NAME}=="?*_mlog", GOTO="notify"
> ENV{DM_LV_NAME}=="?*_mimage_[0-9]*", GOTO="notify"

I think the rule was based on lv_layer: if it exists, don't create symlink, otherwise do.
- Don't think mirrors need to be singled out, do they?
 
Alasdair
-- 
agk at redhat.com



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

* [PATCH] Udev integration: udev rules 2/3
  2009-04-15 18:12 ` Alasdair G Kergon
@ 2009-04-20 10:07   ` Peter Rajnoha
  2009-04-20 10:15   ` Peter Rajnoha
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Rajnoha @ 2009-04-20 10:07 UTC (permalink / raw)
  To: lvm-devel

On 04/15/2009 08:12 PM, Alasdair G Kergon wrote:
> On Wed, Apr 08, 2009 at 02:35:35PM +0200, Peter Rajnoha wrote:
>> # udev rules for LVM 
>> # This will create LVM symlinks in /dev directory.
>  
> Again, describe in more detail what the script is doing.
> Needs (C) notices too.

ok, I'll add that...

>> SUBSYSTEM!="block", GOTO="lvm_end"
>> KERNEL!="dm-[0-9]*", GOTO="lvm_end"
>> ACTION!="change|remove", GOTO="lvm_end"
>>
>> ACTION=="change", IMPORT{PROGRAM}="/sbin/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o name,uuid,subsystem,vg_name,lv_name,lv_layer"
> 
> If we already have the name (e.g. from sysfs), I think we talked about adding
> a 'split up this name' command to dmsetup which does not perform any ioctls.
> 
>> ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"
> 
> Seems to be some repetition here.  Does udev support including files inline
> within other files?

Unfortunately not (or I haven't found it documented). The only thing we can do
about including files is IMPORT{FILE} rule, but this is restricted to KEY=VALUE
pairs only...

Peter



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

* [PATCH] Udev integration: udev rules 2/3
  2009-04-15 18:12 ` Alasdair G Kergon
  2009-04-20 10:07   ` Peter Rajnoha
@ 2009-04-20 10:15   ` Peter Rajnoha
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Rajnoha @ 2009-04-20 10:15 UTC (permalink / raw)
  To: lvm-devel

On 04/15/2009 08:12 PM, Alasdair G Kergon wrote:
> On Wed, Apr 08, 2009 at 02:35:35PM +0200, Peter Rajnoha wrote:
>> ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"
> 
> Seems to be some repetition here.  Does udev support including files inline
> within other files?

This just reminds me one thing -- we don't have to assign DM_UUID and DM_NAME
vars in the rules following the basic DM udev rules. Once it's assigned,
it's set in the other rules as well, so we can save a little with this,
no need to read it again.

Peter



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

end of thread, other threads:[~2009-04-20 10:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-08 12:35 [PATCH] Udev integration: udev rules 2/3 Peter Rajnoha
2009-04-15 18:12 ` Alasdair G Kergon
2009-04-20 10:07   ` Peter Rajnoha
2009-04-20 10:15   ` Peter Rajnoha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.