[PATCH blivet rhel7-branch] iscsi: mount partitions in initramfs for root on iscsi (#740106)

Radek Vykydal rvykydal at redhat.com
Fri Sep 5 13:04:53 UTC 2014


/ and /usr are mounted automatically, for other partitions
x-initrd.mount option is needed in /etc/fstab

Resolves: rhbz#740106
---
 blivet/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index a4264f3..b1cfd8e 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -2917,6 +2917,10 @@ class FSSet(object):
             devices += self.swapDevices
 
         netdevs = self.devicetree.getDevicesByInstance(NetworkStorageDevice)
+
+        rootdev = devices[0]
+        root_on_netdev = any(rootdev.dependsOn(netdev) for netdev in netdevs)
+
         for device in devices:
             # why the hell do we put swap in the fstab, anyway?
             if not device.format.mountable and device.format.type != "swap":
@@ -2943,6 +2947,8 @@ class FSSet(object):
             for netdev in netdevs:
                 if device.dependsOn(netdev):
                     options = options + ",_netdev"
+                    if root_on_netdev and device.format.mountpoint not in ["/", "/usr"]:
+                        options = options + ",x-initrd.mount"
                     break
             if device.encrypted:
                 options += ",x-systemd.device-timeout=0"
-- 
1.9.3



More information about the anaconda-patches mailing list