Skip to content

Commit

Permalink
Merge pull request #530 from yast/master_1094031
Browse files Browse the repository at this point in the history
Master 1094031
  • Loading branch information
schubi2 committed Jul 23, 2018
2 parents 9ad3e26 + d32cb38 commit b6c4a5e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
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
19 changes: 18 additions & 1 deletion src/modules/Bootloader.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# encoding: utf-8

# File:
# modules/Bootloader.ycp
# modules/Bootloader.rb
#
# Module:
# Bootloader installation and configuration
Expand Down 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 b6c4a5e

Please sign in to comment.