Skip to content

Commit

Permalink
Merge branch 'SLE-15-GA' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed May 9, 2018
2 parents 14c019a + 8c97862 commit 0a91dbf
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 7 deletions.
7 changes: 7 additions & 0 deletions package/yast2-bootloader.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue May 8 14:02:52 UTC 2018 - knut.anderssen@suse.com

- Use "none" bootloader when the boot filesystem is nfs
(bsc#1090752).
- 4.0.31

-------------------------------------------------------------------
Tue May 8 07:29:07 UTC 2018 - jreidinger@suse.com

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


Name: yast2-bootloader
Version: 4.0.30
Version: 4.0.31
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
1 change: 1 addition & 0 deletions src/lib/bootloader/device_map.rb
Expand Up @@ -118,6 +118,7 @@ def order_boot_device
# want to modify its MBR. So we get disk of such partition and change order to add it
# to top of device map. For details see bnc#887808,bnc#880439
priority_disks = Yast::BootStorage.boot_disks
return if priority_disks.empty?
# if none of priority disk is hd0, then choose one and assign it
return if any_first_device?(priority_disks)

Expand Down
4 changes: 4 additions & 0 deletions src/lib/bootloader/proposal_client.rb
Expand Up @@ -32,6 +32,10 @@ def initialize
].freeze

def make_proposal(attrs)
if Yast::BootStorage.boot_filesystem.is?(:nfs)
::Bootloader::BootloaderFactory.current_name = "none"
return construct_proposal_map
end
force_reset = attrs["force_reset"]
storage_read = Yast::BootStorage.storage_read?
storage_changed = Yast::BootStorage.storage_changed?
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Bootloader.rb
Expand Up @@ -204,7 +204,7 @@ def Summary(simple_mode: false)
# kokso: additional warning that root partition is nfs type -> bootloader will not be installed
if BootStorage.boot_filesystem.is?(:nfs)
log.info "Bootloader::Summary() -> Boot partition is nfs type, bootloader will not be installed."
return _("The boot partition is of type NFS. Bootloader cannot be installed.")
return [_("The boot partition is of type NFS. Bootloader cannot be installed.")]
end

::Bootloader::BootloaderFactory.current.summary(simple_mode: simple_mode)
Expand Down
10 changes: 5 additions & 5 deletions test/bootloader_proposal_client_test.rb
Expand Up @@ -117,11 +117,11 @@
expect(subject.make_proposal({})).to include("raw_proposal")
end

# FIXME: create yaml file with root on nfs
xit "do not check installation errors if install on nfs" do
expect(Yast::BootStorage).to receive(:disk_with_boot_partition).and_return("/dev/nfs").at_least(:once)

expect(subject.make_proposal({})).to_not include("warning")
it "proposes a none bootloader if the boot filesystem is nfs" do
devicegraph_stub("nfs_root.xml")
subject.make_proposal({})
expect(Yast::BootStorage.boot_filesystem.is?(:nfs)).to eq(true)
expect(::Bootloader::BootloaderFactory.current.name).to eq("none")
end

it "report warning if no bootloader selected" do
Expand Down
27 changes: 27 additions & 0 deletions test/data/nfs_root.xml
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<!-- generated by libstorage-ng version 3.3.104, thalassa.suse.de, 2018-01-18 17:17:43 GMT -->
<Devicegraph>
<Devices>
<Nfs>
<sid>42</sid>
<server>srv</server>
<path>/srv/nfs</path>
</Nfs>
<MountPoint>
<sid>43</sid>
<path>/</path>
<mount-by>device</mount-by>
<mount-type>nfs</mount-type>
<active>true</active>
<in-etc-fstab>true</in-etc-fstab>
<freq>0</freq>
<passno>0</passno>
</MountPoint>
</Devices>
<Holders>
<User>
<source-sid>42</source-sid>
<target-sid>43</target-sid>
</User>
</Holders>
</Devicegraph>

0 comments on commit 0a91dbf

Please sign in to comment.