[PATCH 6/8] Add a dracutSetupString method to devices.py classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a dracutSetupString method to devices.py classes, this can be used
to ask devices used for / to return a string to add to the kernelcmdline
so that dracut can find /. For most devices nothing is needed, but for
iscsi some cmdline arguments are needed.
---
 storage/devices.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index f6600b5..9b9fd8e 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -317,6 +317,9 @@ class Device(object):
 
         return False
 
+    def dracutSetupString(self):
+        return ""
+
     @property
     def status(self):
         """ This device's status.
@@ -2937,6 +2940,22 @@ class iScsiDiskDevice(DiskDevice, NetworkStorageDevice):
         NetworkStorageDevice.__init__(self, host_address=self.node.address)
         log.debug("created new iscsi disk %s %s:%d" % (self.node.name, self.node.address, self.node.port))
 
+    def dracutSetupString(self):
+        if self.ibft:
+            return "iscsi_firmware"
+
+        netroot="netroot=iscsi:"
+        auth = self.node.getAuth()
+        if auth:
+            netroot += "%s:%s" % (auth.username, auth.password)
+            if len(auth.reverse_username) or len(auth.reverse_password):
+                netroot += ":%s:%s" % (auth.reverse_username,
+                                       auth.reverse_password)
+
+        netroot += "@%s::%d::%s" % (self.node.address, self.node.port,
+                                    self.node.name)
+
+        return netroot
 
 class FcoeDiskDevice(DiskDevice, NetworkStorageDevice):
     """ An FCoE disk. """
-- 
1.6.2.2

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux