From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Udev integration: udev rules 1/3
Date: Wed, 08 Apr 2009 14:34:02 +0200 [thread overview]
Message-ID: <49DC99BA.8000205@redhat.com> (raw)
This is the basic udev rule for DM. It creates nodes in /dev/mapper directory.
The permission for devices are defined here. This one is parsed as the first
one. If we detect LVM-* prefix in DM UUID, we skip the cookie notification,
because this is handled in another rule (similarly, we do this for other
subsystems, if we need to do more actions -- create more symlinks etc.)
(this rule should have the highest priority of all LVM/DM udev rules)
Peter
# udev rules for DM devices
# This will create nodes in /dev/mapper directory.
KERNEL=="device-mapper", NAME=="mapper/control"
SUBSYSTEM!="block", GOTO="dm_end"
KERNEL!="dm-[0-9]*", GOTO="dm_end"
ACTION!="change|remove", GOTO="dm_end"
# "dm" sysfs subdirectory is available in newer DM versions only.
# We have to check for its existence and use dmsetup tool instead
# to get the DM name and UUID if this subdirectory is not present.
ACTION=="change", TEST=="dm", ENV{DM_NAME}="$attr{dm/name}", ENV{DM_UUID}="$attr{dm/uuid}"
ACTION=="change", TEST!="dm", IMPORT{PROGRAM}="/sbin/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o name"
# Default permissions for DM devices.
KERNEL=="dm-[0-9]*", OWNER="root", GROUP="root", MODE="0600"
# You can define your own permissions for DM devices here.
# ENV{DM_NAME}=="my_device", OWNER="peter", GROUP="peter", MODE="0644"
ACTION=="change", NAME="mapper/$env{DM_NAME}"
# We won't send notifications for known subsystems since
# these have their own dedicated rules and the notification
# will be done after they finish their own actions.
ENV{DM_UUID}=="LVM-?*", GOTO="dm_end"
ENV{COOKIE}=="[0-9]*", RUN+="/sbin/dmsetup notify $env{COOKIE}", OPTIONS+="last_rule"
LABEL="dm_end"
next reply other threads:[~2009-04-08 12:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 12:34 Peter Rajnoha [this message]
2009-04-09 10:37 ` [PATCH] Udev integration: udev rules 1/3 Peter Rajnoha
2009-04-15 18:07 ` Alasdair G Kergon
2009-04-20 9:57 ` Peter Rajnoha
2009-04-21 19:52 ` Dave Wysochanski
2009-04-22 9:44 ` Peter Rajnoha
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=49DC99BA.8000205@redhat.com \
--to=prajnoha@redhat.com \
--cc=lvm-devel@redhat.com \
/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 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.