Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Aug 15, 2018
2 parents 0de88de + b6c4a5e commit 7cf7448
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
9 changes: 8 additions & 1 deletion package/yast2-bootloader.changes
@@ -1,9 +1,16 @@
-------------------------------------------------------------------
Tue Jul 10 14:29:55 UTC 2018 - mfilka@suse.com
Wed Aug 15 07:41:01 UTC 2018 - mfilka@suse.com

- bnc#1053559
- do not crash with internal error when GRUB_TERMINAL contains
multiple values
- 4.1.7

-------------------------------------------------------------------
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

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


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

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
19 changes: 18 additions & 1 deletion src/modules/Bootloader.rb
@@ -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
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 7cf7448

Please sign in to comment.