d9c684105c
- 95resume: Do not resume on iSCSI devices (bsc#999663) *add 0310-95resume-Do-not-resume-on-iSCSI.patch - 95iscsi: ip=ibft is deprecated (bsc#1004437) *add 0311-95iscsi-ip-ibft-is-deprecated.patch - 40network: do not print warning about non-existing file (bsc#1004437) *add 0312-40network-Do-not-print-message-about-tmp-net.ibft0.c.patch - 90dmraid: do not delete partitions (bsc#998860) *add 0309-90dmraid-do-not-delete-partitions.patch - Give-persistent_policy-precedence-over-dev-mapper-names (bsc#908143) *add: 0502-persistent_device_policy_param_enhance.patch - mdadm IMSM_NO_PLATFORM workaround for kdump (bsc#975404) *add: 0308-mdraid_add_IMSM_NO_PLATFORM_env.patch OBS-URL: https://build.opensuse.org/request/show/434686 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=268
59 lines
1.8 KiB
Diff
59 lines
1.8 KiB
Diff
From: Martin Wilck <mwilck@suse.de>
|
|
Date: Wed, 5 Oct 2016 13:54:26 +0200
|
|
Subject: [RFC/PATCH] Give --persistent_policy precedence over /dev/mapper names
|
|
|
|
There is currently no way to override dracut's preference for
|
|
/dev/mapper device names. But using these is problematic in
|
|
different scenarios: For example, if a user has a multipath-
|
|
enabled system but wants to disable multipath, or if the
|
|
names of multipath maps change because of configuration changes
|
|
(e.g. toggling user_friendly_names in /etc/multipath.conf).
|
|
|
|
This patch makes dracut prefer the user-specified
|
|
--persistent_policy names over /dev/mapper names.
|
|
|
|
It might be worthwhile to discuss why dracut prefers /dev/mapper
|
|
of /dev/disk/by-uuid at all. This preference was introduced
|
|
in 9037b63e with the argument "dm devices maintain /dev/mapper/* as
|
|
persistent names", but that's wrong for the scenarios mentioned
|
|
above, and is not a compelling reason for preferring /dev/mapper
|
|
over /dev/disk/by-uuid.
|
|
|
|
References: bsc#908143
|
|
|
|
Signed-off-by: Martin Wilck <mwilck@suse.de>
|
|
---
|
|
dracut-functions.sh | 10 ++++++++--
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
|
index 249d8fb..e97765d 100755
|
|
--- a/dracut-functions.sh
|
|
+++ b/dracut-functions.sh
|
|
@@ -223,14 +223,20 @@ get_devpath_block() {
|
|
|
|
# get a persistent path from a device
|
|
get_persistent_dev() {
|
|
- local i _tmp _dev
|
|
+ local i _tmp _dev _pol
|
|
|
|
_dev=$(get_maj_min "$1")
|
|
[ -z "$_dev" ] && return
|
|
|
|
+ if [[ -n "$persistent_policy" ]]; then
|
|
+ _pol="/dev/disk/${persistent_policy}/*"
|
|
+ else
|
|
+ _pol=
|
|
+ fi
|
|
+
|
|
for i in \
|
|
+ $_pol \
|
|
/dev/mapper/* \
|
|
- /dev/disk/${persistent_policy:-by-uuid}/* \
|
|
/dev/disk/by-uuid/* \
|
|
/dev/disk/by-label/* \
|
|
/dev/disk/by-partuuid/* \
|
|
--
|
|
2.10.0
|
|
|