Skip to content

Commit

Permalink
add option _netdev to fstab in case of network devices (bnc #949683)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabi2 committed Nov 11, 2015
1 parent 8f64243 commit fed2658
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/modules/FileSystems.rb
Expand Up @@ -1758,6 +1758,7 @@ def DefaultFstabOptions(part)

if Ops.get_string(part, "mount", "") != "/"
need_nofail = false
need_netdev = false
assertInit

devs = Convert.convert(
Expand All @@ -1774,16 +1775,21 @@ def DefaultFstabOptions(part)
# USB since those might actually not be present during boot
# iSCSI since the boot scripts need it
hotplug_transports = [::Storage::USB, ::Storage::ISCSI]
network_transports = [::Storage::ISCSI, ::Storage::FCOE]

usedby_devices.each do |usedby_device|
dp = ::Storage::ContVolInfo.new()
if @sint.getContVolInfo(usedby_device, dp)==0 &&
dp.ctype == ::Storage::DISK
disk = dp.cdevice
infos = ::Storage::DiskInfo.new()
if @sint.getDiskInfo(disk, infos)==0 &&
Builtins.contains(hotplug_transports, infos.transport)
need_nofail = true
if @sint.getDiskInfo(disk, infos)==0
if Builtins.contains(hotplug_transports, infos.transport)
need_nofail = true
end
if Builtins.contains(network_transports, infos.transport)
need_netdev = true
end
end
end
end
Expand All @@ -1794,6 +1800,12 @@ def DefaultFstabOptions(part)
end
fst_default = Ops.add(fst_default, "nofail")
end
if need_netdev
if !Builtins.isempty(fst_default)
fst_default = Ops.add(fst_default, ",")
end
fst_default = Ops.add(fst_default, "_netdev")
end
end
end

Expand Down

0 comments on commit fed2658

Please sign in to comment.