FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 06-07-2011, 11:08 AM
Ales Kozumplik
 
Default multipath: allow mapper/mpath specfifications in kickstart.

On 06/07/2011 12:34 PM, Ales Kozumplik wrote:

Resolves: rhbz#696876
---


The problem is that deviceMatches() and the underlying udev routines can
not recognize a device that does not exist yet (duh). So we need to help
it a little for the multipath case using the data from
idenitfyMultipath(). Suggestions how to better achieve this are welcome.


When the time to push this comes I'll make a similar patch for master.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-13-2011, 05:51 PM
David Cantrell
 
Default multipath: allow mapper/mpath specfifications in kickstart.

Looks good.

On 06/07/2011 09:55 AM, Ales Kozumplik wrote:

Resolves: rhbz#696876
Resolves: rhbz#675322
---
kickstart.py | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 56d67af..0e89fdb 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -21,6 +21,7 @@
from storage.deviceaction import *
from storage.devices import LUKSDevice
from storage.devicelibs.lvm import getPossiblePhysicalExtents
+from storage.devicelibs.mpath import MultipathConfigWriter, identifyMultipaths
from storage.formats import getFormat
from storage.partitioning import clearPartitions
from storage.partitioning import shouldClear
@@ -59,6 +60,10 @@ log = logging.getLogger("anaconda")
stdoutLog = logging.getLogger("anaconda.stdout")
from anaconda_log import logger, logLevelMap, setHandlersLevel

+# deviceMatches is called early, before any multipaths can possibly be coalesced
+# so it needs to know about them in some additional way
+multipaths = None
+
class AnacondaKSScript(Script):
def run(self, chroot, serial, intf = None):
if self.inChroot:
@@ -175,18 +180,36 @@ def getEscrowCertificate(anaconda, url):

return anaconda.id.escrowCertificates[url]

-def deviceMatches(spec):
- if not spec.startswith("/dev/"):
- spec = os.path.normpath("/dev/" + spec)
+def detect_multipaths():
+ global multipaths
+ mcw = MultipathConfigWriter()
+ cfg = mcw.write()
+ with open("/etc/multipath.conf", "w+") as mpath_cfg:
+ mpath_cfg.write(cfg)
+ devices = udev_get_block_devices()
+ (singles, multipaths, partitions) = identifyMultipaths(devices)

- matches = udev_resolve_glob(spec)
- dev = udev_resolve_devspec(spec)
+def deviceMatches(spec):
+ full_spec = spec
+ if not full_spec.startswith("/dev/"):
+ full_spec = os.path.normpath("/dev/" + full_spec)

+ # the regular case
+ matches = udev_resolve_glob(full_spec)
+ dev = udev_resolve_devspec(full_spec)
# udev_resolve_devspec returns None if there's no match, but we don't
# want that ending up in the list.
if dev and dev not in matches:
matches.append(dev)

+ # now see if any mpaths and mpath members match
+ for members in multipaths:
+ mpath_name = udev_device_get_multipath_name(members[0])
+ if mpath_name == spec:
+ # append the mpath
+ matches.append(mpath_name)
+ matches.extend(map(udev_device_get_name, members))
+
return matches

# Remove any existing formatting on a device, but do not remove the partition
@@ -1301,6 +1324,7 @@ def parseKickstart(anaconda, file):
storage.zfcp.ZFCP().startup()
# Note we do NOT call dasd.startup() here, that does not online drives, but
# only checks if they need formatting, which requires zerombr to be known
+ detect_multipaths()

try:
ksparser.readKickstart(file)




--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 11:47 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org