[PATCH rhel7-branch] iscsi: pass rd.* options of devices to be mouted in dracut (#1192398)

Radek Vykydal rvykydal at redhat.com
Mon Feb 16 10:31:46 UTC 2015


Resolves: rhbz#1192398

When root is on iSCSI device, we mark all mountpoints on iSCSI to be
mounted before switchroot (x-initrd.mount in fstab, #740106).

We need to add also dracut parameters to setup devices the mountpoints
depend on (ie rd.lvm.lv).

Choosing a safer approach here. Better would be getting the mountpoints needing
dracut options from fsset instance where the logic for selecting the
mountpoints is already used when setting the fstab flag. (Instead of
duplicating the logic in bootloader code)

---
 pyanaconda/bootloader.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index f9305da..938d4eb 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -826,6 +826,14 @@ class BootLoader(object):
         if usr_device:
             dracut_devices.extend([usr_device])
 
+        netdevs = storage.devicetree.getDevicesByInstance(NetworkStorageDevice)
+        rootdev = storage.rootDevice
+        if any(rootdev.dependsOn(netdev) for netdev in netdevs):
+            dracut_devices = set(dracut_devices)
+            for dev in storage.mountpoints.values():
+                if any(dev.dependsOn(netdev) for netdev in netdevs):
+                    dracut_devices.add(dev)
+
         done = []
         for device in dracut_devices:
             for dep in storage.devices:
-- 
1.9.3



More information about the anaconda-patches mailing list