Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2018-06-19 11:53:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-bootloader.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-bootloader"

Tue Jun 19 11:53:02 2018 rev:264 rq:616895 version:4.1.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes        
2018-06-03 12:31:24.602722883 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new/yast2-bootloader.changes   
2018-06-19 11:53:07.485509173 +0200
@@ -1,0 +2,25 @@
+Thu Jun 14 12:16:02 UTC 2018 - [email protected]
+
+- Warn user when updating with different boot technology
+  (bsc#1081355)
+- 4.1.4
+
+-------------------------------------------------------------------
+Tue Jun 12 14:02:46 UTC 2018 - [email protected]
+
+- Do not propose obsolete kernel parameters (bsc#1047222)
+- 4.1.3
+
+-------------------------------------------------------------------
+Fri Jun  8 10:58:26 UTC 2018 - [email protected]
+
+- fix typo in parted path (bsc#1030620)
+- 4.1.2
+
+-------------------------------------------------------------------
+Thu Jun  7 12:38:40 UTC 2018 - [email protected]
+
+- Use full path to parted (bsc#1030620)
+- 4.1.1
+
+-------------------------------------------------------------------

Old:
----
  yast2-bootloader-4.1.0.tar.bz2

New:
----
  yast2-bootloader-4.1.4.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.wIh1I2/_old  2018-06-19 11:53:09.701426901 +0200
+++ /var/tmp/diff_new_pack.wIh1I2/_new  2018-06-19 11:53:09.705426752 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.1.0
+Version:        4.1.4
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-bootloader-4.1.0.tar.bz2 -> yast2-bootloader-4.1.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.0/package/yast2-bootloader.changes 
new/yast2-bootloader-4.1.4/package/yast2-bootloader.changes
--- old/yast2-bootloader-4.1.0/package/yast2-bootloader.changes 2018-05-31 
09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/package/yast2-bootloader.changes 2018-06-14 
17:24:49.000000000 +0200
@@ -1,4 +1,29 @@
 -------------------------------------------------------------------
+Thu Jun 14 12:16:02 UTC 2018 - [email protected]
+
+- Warn user when updating with different boot technology
+  (bsc#1081355)
+- 4.1.4
+
+-------------------------------------------------------------------
+Tue Jun 12 14:02:46 UTC 2018 - [email protected]
+
+- Do not propose obsolete kernel parameters (bsc#1047222)
+- 4.1.3
+
+-------------------------------------------------------------------
+Fri Jun  8 10:58:26 UTC 2018 - [email protected]
+
+- fix typo in parted path (bsc#1030620)
+- 4.1.2
+
+-------------------------------------------------------------------
+Thu Jun  7 12:38:40 UTC 2018 - [email protected]
+
+- Use full path to parted (bsc#1030620)
+- 4.1.1
+
+-------------------------------------------------------------------
 Wed May 30 06:04:06 UTC 2018 - [email protected]
 
 - Fix detection of GPT disk to properly set pmbr flag (bsc#1093887)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.0/package/yast2-bootloader.spec 
new/yast2-bootloader-4.1.4/package/yast2-bootloader.spec
--- old/yast2-bootloader-4.1.0/package/yast2-bootloader.spec    2018-05-31 
09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/package/yast2-bootloader.spec    2018-06-14 
17:24:49.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.1.0
+Version:        4.1.4
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.0/src/lib/bootloader/grub2base.rb 
new/yast2-bootloader-4.1.4/src/lib/bootloader/grub2base.rb
--- old/yast2-bootloader-4.1.0/src/lib/bootloader/grub2base.rb  2018-05-31 
09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/src/lib/bootloader/grub2base.rb  2018-06-14 
17:24:49.000000000 +0200
@@ -70,7 +70,7 @@
       end
 
       devices.each do |dev|
-        Yast::Execute.locally("parted", "-s", dev, "disk_set", "pmbr_boot", 
action_parted)
+        Yast::Execute.locally("/usr/sbin/parted", "-s", dev, "disk_set", 
"pmbr_boot", action_parted)
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.0/src/lib/bootloader/proposal_client.rb 
new/yast2-bootloader-4.1.4/src/lib/bootloader/proposal_client.rb
--- old/yast2-bootloader-4.1.0/src/lib/bootloader/proposal_client.rb    
2018-05-31 09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/src/lib/bootloader/proposal_client.rb    
2018-06-14 17:24:49.000000000 +0200
@@ -7,6 +7,46 @@
 module Bootloader
   # Proposal client for bootloader configuration
   class ProposalClient < ::Installation::ProposalClient
+    # Error when during update media is booted by different technology than 
target system.
+    class MismatchBootloader < RuntimeError
+      include Yast::I18n
+
+      def initialize(old_bootloader, new_bootloader)
+        @old_bootloader = old_bootloader
+        @new_bootloader = new_bootloader
+
+        raise "Invalid old bootloader #{old_bootloader}" unless 
boot_map[old_bootloader]
+        raise "Invalid new bootloader #{new_bootloader}" unless 
boot_map[new_bootloader]
+
+        super("Mismatching bootloaders")
+      end
+
+      def boot_map
+        textdomain "bootloader"
+
+        {
+          # TRANSLATORS: kind of boot. It is term for way how x86_64 can boot
+          "grub2"     => _("Legacy BIOS boot"),
+          # TRANSLATORS: kind of boot. It is term for way how x86_64 can boot
+          "grub2-efi" => _("EFI boot")
+        }
+      end
+
+      def user_message
+        textdomain "bootloader"
+
+        # TRANSLATORS: keep %{} intact. It will be replaced by kind of boot
+        format(_(
+                 "Cannot upgrade the bootloader because of a mismatch of the 
boot technology. " \
+       "The upgraded system uses <i>%{old_boot}</i> while the installation 
medium " \
+       "has been booted using <i>%{new_boot}</i>.<br><br>" \
+       "This scenario is not supported, the upgraded system may not boot " \
+       "or the upgrade process can fail later."
+        ),
+          old_boot: boot_map[@old_bootloader], new_boot: 
boot_map[@new_bootloader])
+      end
+    end
+
     include Yast::I18n
     include Yast::Logger
 
@@ -32,47 +72,19 @@
     ].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?
-      log.info "Storage changed: #{storage_changed} force_reset 
#{force_reset}."
-      log.info "Storage read previously #{storage_read.inspect}"
-      # clear storage-ng devices cache otherwise it crashes (bsc#1071931)
-      Yast::BootStorage.reset_disks if storage_changed
-
-      if reset_needed?(force_reset, storage_changed && storage_read)
-        # force re-calculation of bootloader proposal
-        # this deletes any internally cached values, a new proposal will
-        # not be partially based on old data now any more
-        log.info "Recalculation of bootloader configuration"
-        Yast::Bootloader.Reset
-      end
-
-      if Yast::Mode.update
-        return { "raw_proposal" => [_("do not change")] } unless 
propose_for_update(force_reset)
-      elsif Yast::Bootloader.proposed_cfg_changed
-        # do nothing as user already modify it
-      else
-        # in installation always propose missing stuff
-        # current below use proposed value if not already set
-        # If set, then use same bootloader, but propose it again
-        bl = ::Bootloader::BootloaderFactory.current
-        bl.propose
-      end
-
-      update_required_packages
-
-      construct_proposal_map
+      make_proposal_raising(attrs)
     rescue ::Bootloader::NoRoot
       {
         "label_proposal" => [],
         "warning_level"  => :fatal,
         "warning"        => _("Cannot detect device mounted as root. Please 
check partitioning.")
       }
+    rescue MismatchBootloader => e
+      {
+        "label_proposal" => [],
+        "warning_level"  => :warning,
+        "warning"        => e.user_message
+      }
     end
 
     def ask_user(param)
@@ -123,6 +135,45 @@
 
   private
 
+    # make proposal without handling of exceptions
+    def make_proposal_raising(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?
+      log.info "Storage changed: #{storage_changed} force_reset 
#{force_reset}."
+      log.info "Storage read previously #{storage_read.inspect}"
+      # clear storage-ng devices cache otherwise it crashes (bsc#1071931)
+      Yast::BootStorage.reset_disks if storage_changed
+
+      if reset_needed?(force_reset, storage_changed && storage_read)
+        # force re-calculation of bootloader proposal
+        # this deletes any internally cached values, a new proposal will
+        # not be partially based on old data now any more
+        log.info "Recalculation of bootloader configuration"
+        Yast::Bootloader.Reset
+      end
+
+      if Yast::Mode.update
+        return { "raw_proposal" => [_("do not change")] } unless 
propose_for_update(force_reset)
+      elsif Yast::Bootloader.proposed_cfg_changed
+        # do nothing as user already modify it
+      else
+        # in installation always propose missing stuff
+        # current below use proposed value if not already set
+        # If set, then use same bootloader, but propose it again
+        bl = ::Bootloader::BootloaderFactory.current
+        bl.propose
+      end
+
+      update_required_packages
+
+      construct_proposal_map
+    end
+
     # returns if proposal should be reseted
     # logic in this condition:
     # when reset is forced or user do not modify proposal, reset proposal,
@@ -169,6 +220,9 @@
         ::Bootloader::BootloaderFactory.current.read
 
         return false
+      # old one is grub2, but mismatch of EFI and non-EFI (bsc#1081355)
+      elsif old_bootloader =~ /grub2/ && old_bootloader != current_bl.name
+        raise MismatchBootloader.new(old_bootloader, current_bl.name)
       elsif !current_bl.proposed? || force_reset
         # Repropose the type. A regular Reset/Propose is not enough.
         # For more details see bnc#872081
@@ -185,7 +239,7 @@
     end
 
     def grub2_update?(current_bl)
-      ["grub2", "grub2-efi"].include?(old_bootloader) &&
+      [current_bl.name].include?(old_bootloader) &&
         !current_bl.proposed? &&
         !Yast::Bootloader.proposed_cfg_changed
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.0/src/modules/BootArch.rb 
new/yast2-bootloader-4.1.4/src/modules/BootArch.rb
--- old/yast2-bootloader-4.1.0/src/modules/BootArch.rb  2018-05-31 
09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/src/modules/BootArch.rb  2018-06-14 
17:24:49.000000000 +0200
@@ -41,6 +41,7 @@
     ].freeze
 
     # Get parameters for the default kernel
+    # @note for possible arguments for kernel see `man kernel-command-line`
     # @param [String] resume string device to resume from (or empty not to set 
it)
     # @return [String] parameters for default kernel
     def DefaultKernelParams(resume)
@@ -54,8 +55,7 @@
         ret = kernel_cmdline
         ret << " resume=#{resume}" unless resume.empty?
         ret << " #{features}" unless features.empty?
-        ret.gsub!(/(?:\A|\s)splash=\S*/, "")
-        ret << " splash=silent quiet showopts"
+        ret << " quiet"
         return ret
       elsif Arch.s390
         termparm = if ENV["TERM"] == "linux"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.0/test/boot_arch_test.rb 
new/yast2-bootloader-4.1.4/test/boot_arch_test.rb
--- old/yast2-bootloader-4.1.0/test/boot_arch_test.rb   2018-05-31 
09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/test/boot_arch_test.rb   2018-06-14 
17:24:49.000000000 +0200
@@ -55,15 +55,6 @@
         expect(subject.DefaultKernelParams("/dev/sda2")).to 
include("console=ttyS0")
       end
 
-      it "removes splash param from command line or product file and add it 
silent" do
-        allow(Yast::Kernel).to receive(:GetCmdLine).and_return("splash=verbose 
splash=quit splash=hell")
-
-        expect(subject.DefaultKernelParams("/dev/sda2")).to 
include("splash=silent")
-        expect(subject.DefaultKernelParams("/dev/sda2")).to_not 
include("splash=verbose")
-        expect(subject.DefaultKernelParams("/dev/sda2")).to_not 
include("splash=quit")
-        expect(subject.DefaultKernelParams("/dev/sda2")).to_not 
include("splash=hell")
-      end
-
       it "adds passed parameter as resume device" do
         expect(subject.DefaultKernelParams("/dev/sda2")).to 
include("resume=/dev/sda2")
       end
@@ -72,8 +63,8 @@
         expect(subject.DefaultKernelParams("")).to_not include("resume")
       end
 
-      it "adds splash=silent quit showopts parameters" do
-        expect(subject.DefaultKernelParams("/dev/sda2")).to include(" 
splash=silent quiet showopts")
+      it "adds \"quiet\" parameter" do
+        expect(subject.DefaultKernelParams("/dev/sda2")).to include(" quiet")
       end
     end
 
@@ -129,15 +120,15 @@
       end
 
       it "returns parameters from current command line" do
-        allow(Yast::Kernel).to receive(:GetCmdLine).and_return("console=ttyS0 
splash=verbose")
+        allow(Yast::Kernel).to receive(:GetCmdLine).and_return("console=ttyS0")
         # just to test that it do not add product features
         allow(Yast::ProductFeatures).to 
receive(:GetStringFeature).and_return("console=ttyS1")
 
-        expect(subject.DefaultKernelParams("/dev/sda2")).to eq "console=ttyS0 
resume=/dev/sda2 console=ttyS1 splash=silent quiet showopts"
+        expect(subject.DefaultKernelParams("/dev/sda2")).to eq "console=ttyS0 
resume=/dev/sda2 console=ttyS1 quiet"
       end
 
-      it "adds splash=silent quit showopts parameters" do
-        expect(subject.DefaultKernelParams("/dev/sda2")).to include(" 
splash=silent quiet showopts")
+      it "adds \"quiet\" parameter" do
+        expect(subject.DefaultKernelParams("/dev/sda2")).to include(" quiet")
       end
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.0/test/bootloader_proposal_client_test.rb 
new/yast2-bootloader-4.1.4/test/bootloader_proposal_client_test.rb
--- old/yast2-bootloader-4.1.0/test/bootloader_proposal_client_test.rb  
2018-05-31 09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/test/bootloader_proposal_client_test.rb  
2018-06-14 17:24:49.000000000 +0200
@@ -5,6 +5,8 @@
 require "bootloader/bootloader_factory"
 require "bootloader/main_dialog"
 
+Yast.import "Mode"
+
 describe Bootloader::ProposalClient do
   before do
     Bootloader::BootloaderFactory.clear_cache
@@ -84,7 +86,6 @@
       end
 
       it "shows unsupported popup when upgrading from grub2 (bsc#1070233)" do
-        Yast.import "Mode"
         allow(Yast::Mode).to receive(:update).and_return(true)
 
         expect(subject).to receive("old_bootloader").and_return("grub2")
@@ -154,7 +155,6 @@
     end
 
     it "call bootloader propose in common installation" do
-      Yast.import "Mode"
       allow(Yast::Mode).to receive(:update).and_return(false)
       expect(Bootloader::BootloaderFactory.current).to receive(:propose)
 
@@ -162,10 +162,9 @@
     end
 
     it "reproprose from scrach during update if old bootloader is not grub2" do
-      Yast.import "Mode"
       allow(Yast::Mode).to receive(:update).and_return(true)
 
-      expect(subject).to receive("old_bootloader").and_return("grub").twice
+      expect(subject).to 
receive("old_bootloader").and_return("grub").at_least(:once)
 
       expect(Yast::Bootloader).to receive(:Reset).at_least(:once)
       expect(Bootloader::BootloaderFactory).to 
receive(:proposed).and_call_original
@@ -174,7 +173,6 @@
     end
 
     it "do not propose during update if if old bootloader is none" do
-      Yast.import "Mode"
       allow(Yast::Mode).to receive(:update).and_return(true)
 
       expect(subject).to receive("old_bootloader").and_return("none").twice
@@ -183,7 +181,6 @@
     end
 
     it "propose no change if old bootloader is grub2" do
-      Yast.import "Mode"
       allow(Yast::Mode).to receive(:update).and_return(true)
 
       expect(subject).to receive("old_bootloader").and_return("grub2")
@@ -208,7 +205,6 @@
     end
 
     it "do not resets configuration in automode and even if force_reset 
passed" do
-      Yast.import "Mode"
       allow(Yast::Mode).to receive(:autoinst).and_return(true)
       expect(Yast::Bootloader).to_not receive(:Reset)
 
@@ -222,5 +218,13 @@
       expect(Yast::PackagesProposal).to 
receive(:AddResolvables).with("yast2-bootloader", :package, packages_to_propose)
       subject.make_proposal({})
     end
+
+    it "returns warning if old system use different boot technology then new 
one" do
+      allow(Yast::Mode).to receive(:update).and_return(true)
+
+      expect(subject).to 
receive("old_bootloader").and_return("grub2-efi").at_least(:once)
+
+      expect(subject.make_proposal({})["warning_level"]).to eq :warning
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.0/test/grub2base_test.rb 
new/yast2-bootloader-4.1.4/test/grub2base_test.rb
--- old/yast2-bootloader-4.1.0/test/grub2base_test.rb   2018-05-31 
09:58:37.000000000 +0200
+++ new/yast2-bootloader-4.1.4/test/grub2base_test.rb   2018-06-14 
17:24:49.000000000 +0200
@@ -241,20 +241,10 @@
           expect(subject.grub_default.kernel_params.serialize).to 
include("product_aurora=shot")
         end
 
-        it "removes splash argument and always add splash=silent" do
-          kernel_params = "splash=verbose,theme:st_theme verbose suse=rulezz"
-          allow(Yast::Kernel).to receive(:GetCmdLine).and_return(kernel_params)
-
-          subject.propose
-
-          expect(subject.grub_default.kernel_params.serialize).to_not 
include("splash=verbose,theme:st_theme")
-          expect(subject.grub_default.kernel_params.serialize).to 
include("splash=silent")
-        end
-
-        it "adds quiet and showopts arguments" do
+        it "adds \"quiet\" argument" do
           subject.propose
 
-          expect(subject.grub_default.kernel_params.serialize).to 
include("quiet showopts")
+          expect(subject.grub_default.kernel_params.serialize).to 
include("quiet")
         end
       end
 


Reply via email to