Skip to content

Commit

Permalink
Merge pull request #166 from yast/netdev_fix_SLE-12-GA
Browse files Browse the repository at this point in the history
add option _netdev to fstab in case of network devices (bnc #949683)
  • Loading branch information
gabi2 committed Nov 11, 2015
2 parents 8f64243 + b97a286 commit 2499e86
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
7 changes: 7 additions & 0 deletions package/yast2-storage.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Nov 11 14:21:32 CET 2015 - gs@suse.de

- Add _netdev flag for iSCSI and FCoE backed fstab entries
(bsc#949683, patch provided by david.bond@microfocus.com)
- version 3.1.45.1

-------------------------------------------------------------------
Tue Sep 22 15:50:00 UTC 2015 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-storage.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-storage
Version: 3.1.45
Version: 3.1.45.1
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
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 2499e86

Please sign in to comment.