Skip to content

Commit

Permalink
megred with SELS15
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Jul 23, 2018
2 parents 9ad3e26 + 302e3c9 commit 88f31f0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/yast2-bootloader.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jul 20 15:12:13 CEST 2018 - schubi@suse.de

- Update: Fixed crash while reading grub settings from installed
system (bsc#1094031).
- 4.1.6

-------------------------------------------------------------------
Thu Jun 28 15:36:26 CEST 2018 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-bootloader.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-bootloader
Version: 4.1.5
Version: 4.1.6
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
17 changes: 17 additions & 0 deletions src/modules/Bootloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
Yast.import "Progress"
Yast.import "Report"
Yast.import "Stage"
Yast.import "Installation"

module Yast
class BootloaderClass < Module
Expand Down Expand Up @@ -422,7 +423,23 @@ def ReadOrProposeIfNeeded
Propose()
else
progress_orig = Progress.set(false)
if Stage.initial && Mode.update
# SCR has been currently set to inst-sys. So we have
# set the SCR to installed system in order to read
# grub settings
old_SCR = WFM.SCRGetDefault
new_SCR = WFM.SCROpen("chroot=#{Yast::Installation.destdir}:scr",
false)
WFM.SCRSetDefault(new_SCR)
end
Read()
if Stage.initial && Mode.update
# settings have been read from the target system
current_bl.read
# reset target system to inst-sys
WFM.SCRSetDefault(old_SCR)
WFM.SCRClose(new_SCR)
end
Progress.set(progress_orig)
end
end
Expand Down
3 changes: 3 additions & 0 deletions test/bootloader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def kernel_line(target)

it "reads configuration in update mode" do
expect(subject).to_not receive(:Propose)
# switching SCR to Yast::Installation.destdir
expect(Yast::WFM).to receive(:SCROpen).with("chroot=#{Yast::Installation.destdir}:scr",
false)
expect(subject).to receive(:Read)
allow(Yast::Mode).to receive(:update).and_return(true)
allow(Yast::Stage).to receive(:initial).and_return(true)
Expand Down

0 comments on commit 88f31f0

Please sign in to comment.