From: Hannes Reinecke <hare@suse.de>
To: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: dm-devel@redhat.com
Subject: [PATCH 02/11] Provide correct persistent symlinks for user_friendly_names
Date: Thu, 17 Jan 2013 15:59:24 +0100 [thread overview]
Message-ID: <1358434773-2002-3-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1358434773-2002-1-git-send-email-hare@suse.de>
When the option 'user_friendly_names' is set we should provide
both symlinks, the persistent one and that one generated for
user_friendly_names.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
kpartx/kpartx.rules | 4 ++++
kpartx/kpartx_id | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules
index ba5c6cb..8640094 100644
--- a/kpartx/kpartx.rules
+++ b/kpartx/kpartx.rules
@@ -18,10 +18,14 @@ OPTIONS="link_priority=50"
# Create persistent links for multipath tables
ENV{DM_UUID}=="mpath-*", \
SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
+ENV{DM_MPATH}=="?*", ENV{DM_PART}!="?*", \
+ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_MPATH}"
# Create persistent links for partitions
ENV{DM_PART}=="?*", \
SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}"
+ENV{DM_MPATH}=="?*", ENV{DM_PART}=="?*", \
+ SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_MPATH}-part$env{DM_PART}"
# Create dm tables for partitions
ENV{DM_STATE}!="SUSPENDED", ENV{DM_UUID}=="mpath-*", \
diff --git a/kpartx/kpartx_id b/kpartx/kpartx_id
index fa21b5b..afb589c 100644
--- a/kpartx/kpartx_id
+++ b/kpartx/kpartx_id
@@ -55,6 +55,9 @@ if [ "$dmtbl" = "part" ] ; then
# The name of the kpartx table is the name of the parent table
dmname=$($DMSETUP info -c --noheadings -o name -u $dmuuid)
echo "DM_NAME=$dmname"
+ if [ "$dmname" != ${dmuuid#mpath-} ] ; then
+ echo "DM_MPATH=${dmuuid#mpath-}"
+ fi
# We need the dependencies of the parent table to figure out
# the type if the parent is a multipath table
case "$dmuuid" in
@@ -63,7 +66,9 @@ if [ "$dmtbl" = "part" ] ; then
;;
esac
elif [ "$dmtbl" = "mpath" ] ; then
- dmname=$tblname
+ if [ -n "$DM_NAME" -a "$DM_NAME" != "$dmuuid" ] ; then
+ echo "DM_MPATH=$dmuuid"
+ fi
# We need the dependencies of the table to figure out the type
dmdeps=$($DMSETUP deps -u $UUID)
elif [ "$dmtbl" = "dmraid" ] ; then
--
1.7.10.4
next prev parent reply other threads:[~2013-01-17 14:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-17 14:59 [PATCH 00/11] Final round of SLES resync patches Hannes Reinecke
2013-01-17 14:59 ` [PATCH 01/11] Cleanup whitespaces Hannes Reinecke
2013-01-17 14:59 ` Hannes Reinecke [this message]
2013-01-17 14:59 ` [PATCH 03/11] kpartx_id: Generate persistent symlinks for 'wwn' Hannes Reinecke
2013-01-17 14:59 ` [PATCH 04/11] Fix inconsistent entries after merging hwtable with user's config Hannes Reinecke
2013-01-17 14:59 ` [PATCH 05/11] kpartx: Fix DASD name in kpartx_id Hannes Reinecke
2013-01-17 14:59 ` [PATCH 06/11] Break out loop in factorize_hwtable() Hannes Reinecke
2013-01-17 14:59 ` [PATCH 07/11] multipathd: switch to abstract sockets for CLI commands Hannes Reinecke
2013-01-17 14:59 ` [PATCH 08/11] multipathd: log message when check interval has changed Hannes Reinecke
2013-01-17 14:59 ` [PATCH 09/11] multipathd: call 'reconfigure' during startup Hannes Reinecke
2013-01-17 14:59 ` [PATCH 10/11] multipath: do not install rules file Hannes Reinecke
2013-01-17 14:59 ` [PATCH 11/11] kpartx: Deinstall kpartx_id Hannes Reinecke
2013-01-18 16:58 ` [PATCH 00/11] Final round of SLES resync patches Xose Vazquez Perez
2013-01-21 7:15 ` Hannes Reinecke
2013-01-21 18:48 ` Christophe Varoqui
2013-01-18 19:20 ` Christophe Varoqui
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=1358434773-2002-3-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=christophe.varoqui@gmail.com \
--cc=dm-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox