Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2019-03-10 09:30:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-bootloader.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-bootloader"

Sun Mar 10 09:30:03 2019 rev:275 rq:682484 version:4.1.21

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes        
2019-03-04 09:15:22.328654999 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-bootloader.new.28833/yast2-bootloader.changes 
    2019-03-10 09:30:10.292253352 +0100
@@ -1,0 +2,7 @@
+Thu Mar  7 13:36:20 UTC 2019 - [email protected]
+
+- Add option to Disable Simultaneous Multithreading (bsc#1098559)
+- Allow to modify bootloader configuration during upgrade
+- 4.1.21
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.is9XMp/_old  2019-03-10 09:30:11.120253144 +0100
+++ /var/tmp/diff_new_pack.is9XMp/_new  2019-03-10 09:30:11.124253143 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.1.20
+Version:        4.1.21
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-bootloader-4.1.20.tar.bz2 -> yast2-bootloader-4.1.21.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.20/.rubocop.yml 
new/yast2-bootloader-4.1.21/.rubocop.yml
--- old/yast2-bootloader-4.1.20/.rubocop.yml    2019-03-01 08:48:52.000000000 
+0100
+++ new/yast2-bootloader-4.1.21/.rubocop.yml    2019-03-07 15:23:39.000000000 
+0100
@@ -31,7 +31,7 @@
 
 # Configuration parameters: CountComments.
 Metrics/ClassLength:
-  Max: 200
+  Max: 220
   Include:
     - 'src/lib/**/*.rb' # be more strict for new code in lib
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/package/yast2-bootloader.changes 
new/yast2-bootloader-4.1.21/package/yast2-bootloader.changes
--- old/yast2-bootloader-4.1.20/package/yast2-bootloader.changes        
2019-03-01 08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/package/yast2-bootloader.changes        
2019-03-07 15:23:39.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Mar  7 13:36:20 UTC 2019 - [email protected]
+
+- Add option to Disable Simultaneous Multithreading (bsc#1098559)
+- Allow to modify bootloader configuration during upgrade
+- 4.1.21
+
+-------------------------------------------------------------------
 Fri Mar  1 06:16:50 UTC 2019 - [email protected]
 
 - remove resume if user wants noresume (bsc#1079537)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/package/yast2-bootloader.spec 
new/yast2-bootloader-4.1.21/package/yast2-bootloader.spec
--- old/yast2-bootloader-4.1.20/package/yast2-bootloader.spec   2019-03-01 
08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/package/yast2-bootloader.spec   2019-03-07 
15:23:39.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.1.20
+Version:        4.1.21
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/src/autoyast-rnc/bootloader.rnc 
new/yast2-bootloader-4.1.21/src/autoyast-rnc/bootloader.rnc
--- old/yast2-bootloader-4.1.20/src/autoyast-rnc/bootloader.rnc 2019-03-01 
08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/src/autoyast-rnc/bootloader.rnc 2019-03-07 
15:23:39.000000000 +0100
@@ -71,6 +71,7 @@
     boot_extended? &
     boot_mbr? &
     stage1_dev? &
+    smt? &
     element vgamode { text }?
   }
 
@@ -85,6 +86,7 @@
 boot_boot = element boot_boot { "true" | "false" }
 boot_extended = element boot_extended { "true" | "false" }
 boot_mbr = element boot_mbr { "true" | "false" }
+smt = element smt { "true" | "false" }
 
 sections =
   element sections {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/src/lib/bootloader/autoyast_converter.rb 
new/yast2-bootloader-4.1.21/src/lib/bootloader/autoyast_converter.rb
--- old/yast2-bootloader-4.1.20/src/lib/bootloader/autoyast_converter.rb        
2019-03-01 08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/src/lib/bootloader/autoyast_converter.rb        
2019-03-07 15:23:39.000000000 +0100
@@ -37,6 +37,7 @@
         # always nil pmbr as autoyast does not support it yet,
         # so use nil to always use proposed value (bsc#1081967)
         bootloader.pmbr_action = nil
+        bootloader.smt = data["global"]["smt"] == "true" unless 
data["global"]["smt"].nil?
         # TODO: import Initrd
 
         log.warn "autoyast profile contain sections which won't be processed" 
if data["sections"]
@@ -56,6 +57,7 @@
         global = res["global"]
         export_grub2(global, config) if config.name == "grub2"
         export_default(global, config.grub_default)
+        res["global"]["smt"] = config.smt ? "true" : "false"
         # Do not export device map as device name are very unpredictable and 
is used only as
         # work-around when automatic ones do not work for what-ever reasons ( 
it can really safe
         # your day in L3 )
@@ -77,6 +79,14 @@
       end
 
       def import_default(data, default)
+        # import first kernel params as smt can later modify it
+        DEFAULT_KERNEL_PARAMS_MAPPING.each do |key, method|
+          val = data["global"][key]
+          next unless val
+
+          default.public_send(method).replace(val)
+        end
+
         DEFAULT_BOOLEAN_MAPPING.each do |key, method|
           val = data["global"][key]
           next unless val
@@ -98,13 +108,6 @@
           default.public_send(:"#{method}=", val.split.map { |v| v.to_sym })
         end
 
-        DEFAULT_KERNEL_PARAMS_MAPPING.each do |key, method|
-          val = data["global"][key]
-          next unless val
-
-          default.public_send(method).replace(val)
-        end
-
         import_timeout(data, default)
       end
 
@@ -235,6 +238,11 @@
           res[key] = val.enabled? ? "true" : "false" if val.defined?
         end
 
+        DEFAULT_KERNEL_PARAMS_MAPPING.each do |key, method|
+          val = default.public_send(method)
+          res[key] = val.serialize unless val.empty?
+        end
+
         DEFAULT_STRING_MAPPING.each do |key, method|
           val = default.public_send(method)
           res[key] = val.to_s if val
@@ -245,11 +253,6 @@
           res[key] = val.join(" ") if val
         end
 
-        DEFAULT_KERNEL_PARAMS_MAPPING.each do |key, method|
-          val = default.public_send(method)
-          res[key] = val.serialize unless val.empty?
-        end
-
         export_timeout(res, default)
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/src/lib/bootloader/grub2_widgets.rb 
new/yast2-bootloader-4.1.21/src/lib/bootloader/grub2_widgets.rb
--- old/yast2-bootloader-4.1.20/src/lib/bootloader/grub2_widgets.rb     
2019-03-01 08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/src/lib/bootloader/grub2_widgets.rb     
2019-03-07 15:23:39.000000000 +0100
@@ -112,6 +112,34 @@
     end
   end
 
+  # Represents decision if smt is enabled
+  class Smt < CWM::CheckBox
+    include Grub2Widget
+
+    def initialize
+      textdomain "bootloader"
+    end
+
+    def label
+      _("Disable Simultaneous &Multithreading")
+    end
+
+    def help
+      _(
+        "<p><b>Disable Simultaneous Multithreading</b><br>\n" \
+          "To disable sharing physical cores by more virtual ones."
+      )
+    end
+
+    def init
+      self.value = !grub2.smt
+    end
+
+    def store
+      grub2.smt = !value
+    end
+  end
+
   # Represents decision if generic MBR have to be installed on disk
   class GenericMBRWidget < CWM::CheckBox
     include Grub2Widget
@@ -212,7 +240,7 @@
     end
 
     def init
-      self.value = grub_default.kernel_params.serialize
+      self.value = grub_default.kernel_params.serialize.gsub(/nosmt/, "")
     end
 
     def store
@@ -844,9 +872,11 @@
 
     def contents
       console_widget = Yast::Arch.s390 ? CWM::Empty.new("console") : 
ConsoleWidget.new
+      smt_widget = Yast::Arch.x86_64 ? MarginBox(1, 0.5, Smt.new) : 
CWM::Empty.new("smt")
       VBox(
         VSpacing(1),
         MarginBox(1, 0.5, KernelAppendWidget.new),
+        Left(smt_widget),
         MarginBox(1, 0.5, console_widget),
         VStretch()
       )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/src/lib/bootloader/grub2base.rb 
new/yast2-bootloader-4.1.21/src/lib/bootloader/grub2base.rb
--- old/yast2-bootloader-4.1.20/src/lib/bootloader/grub2base.rb 2019-03-01 
08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/src/lib/bootloader/grub2base.rb 2019-03-07 
15:23:39.000000000 +0100
@@ -54,6 +54,7 @@
       @grub_default = ::CFA::Grub2::Default.new
       @sections = ::Bootloader::Sections.new
       @pmbr_action = :nothing
+      @smt = nil # nil means not set explicitly, otherwise boolean
     end
 
     # general functions
@@ -74,6 +75,26 @@
       end
     end
 
+    def smt
+      !grub_default.kernel_params.parameter("nosmt")
+    end
+
+    def explicit_smt
+      @smt
+    end
+
+    def smt=(value)
+      log.info "setting smt to #{value}"
+      @smt = value
+
+      if value
+        matcher = CFA::Matcher.new(key: "nosmt")
+        grub_default.kernel_params.remove_parameter(matcher)
+      elsif !grub_default.kernel_params.parameter("nosmt")
+        grub_default.kernel_params.add_parameter("nosmt", true)
+      end
+    end
+
     def read
       super
 
@@ -192,13 +213,13 @@
 
     def merge_grub_default(other)
       default = grub_default
-      other = other.grub_default
+      other_default = other.grub_default
 
       log.info "before merge default #{default.inspect}"
-      log.info "before merge other #{other.inspect}"
+      log.info "before merge other #{other_default.inspect}"
 
       KERNEL_FLAVORS_METHODS.each do |method|
-        other_params = other.public_send(method)
+        other_params = other_default.public_send(method)
         default_params = default.public_send(method)
         next if other_params.empty?
 
@@ -211,7 +232,11 @@
         default_params.replace(new_kernel_params)
       end
 
-      merge_attributes(default, other)
+      merge_attributes(default, other_default)
+
+      # explicitly set smt
+      self.smt = other.explicit_smt unless other.explicit_smt.nil?
+      log.info "smt after merge #{smt}"
 
       log.info "after merge default #{default.inspect}"
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/src/lib/bootloader/proposal_client.rb 
new/yast2-bootloader-4.1.21/src/lib/bootloader/proposal_client.rb
--- old/yast2-bootloader-4.1.20/src/lib/bootloader/proposal_client.rb   
2019-03-01 08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/src/lib/bootloader/proposal_client.rb   
2019-03-07 15:23:39.000000000 +0100
@@ -4,6 +4,8 @@
 require "bootloader/bootloader_factory"
 require "yast2/popup"
 
+Yast.import "BootArch"
+
 module Bootloader
   # Proposal client for bootloader configuration
   class ProposalClient < ::Installation::ProposalClient
@@ -88,18 +90,6 @@
     end
 
     def ask_user(param)
-      if Yast::Mode.update
-        current_bl = ::Bootloader::BootloaderFactory.current
-
-        # we upgrading grub2, so no change there
-        if grub2_update?(current_bl)
-          ::Yast2::Popup.show(
-            # TRANSLATORS: popup text when user click on link and we forbid to 
continue
-            _("Changing the bootloader configuration during an upgrade is not 
supported.")
-          )
-          return { "workflow_sequence" => :cancel }
-        end
-      end
       chosen_id = param["chosen_id"]
       result = :next
       log.info "ask user called with #{chosen_id}"
@@ -212,7 +202,7 @@
 
       if grub2_update?(current_bl)
         log.info "update of grub2, do not repropose"
-        return false
+        Yast::Bootloader.ReadOrProposeIfNeeded
       elsif old_bootloader == "none"
         log.info "Bootloader not configured, do not repropose"
         # blRead just exits for none bootloader
@@ -233,8 +223,6 @@
         ::Bootloader::BootloaderFactory.current = proposed
       end
 
-      update_required_packages
-
       true
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.20/src/modules/BootArch.rb 
new/yast2-bootloader-4.1.21/src/modules/BootArch.rb
--- old/yast2-bootloader-4.1.20/src/modules/BootArch.rb 2019-03-01 
08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/src/modules/BootArch.rb 2019-03-07 
15:23:39.000000000 +0100
@@ -54,6 +54,7 @@
       if Arch.i386 || Arch.x86_64 || Arch.aarch64 || Arch.ppc
         ret = kernel_cmdline
         ret << " resume=#{resume}" unless resume.empty?
+        ret << propose_smt if Arch.x86_64
         ret << " #{features}" unless features.empty?
         ret << " quiet"
         return ret
@@ -83,8 +84,28 @@
       Arch.i386 || Arch.x86_64 || Arch.s390
     end
 
+    SMT_DEFAULT = true
+    def smt_settings
+      linuxrc_value = Yast::Linuxrc.value_for("disablesmt")
+      product_value = ProductFeatures.GetBooleanFeatureWithFallback("globals", 
"smt", SMT_DEFAULT)
+      log.info "smt settings: linuxrc #{linuxrc_value.inspect} product 
#{product_value.inspect}"
+      # linuxrc cmdline
+      return linuxrc_value == "0" if !linuxrc_value.nil?
+
+      # product features
+      product_value
+    end
+
     publish :function => :DefaultKernelParams, :type => "string (string)"
     publish :function => :ResumeAvailable, :type => "boolean ()"
+
+  private
+
+    DISABLE_SMT = " nosmt".freeze
+
+    def propose_smt
+      smt_settings ? "" : DISABLE_SMT
+    end
   end
 
   BootArch = BootArchClass.new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/test/autoyast_converter_test.rb 
new/yast2-bootloader-4.1.21/test/autoyast_converter_test.rb
--- old/yast2-bootloader-4.1.20/test/autoyast_converter_test.rb 2019-03-01 
08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/test/autoyast_converter_test.rb 2019-03-07 
15:23:39.000000000 +0100
@@ -121,7 +121,8 @@
         "os_prober"    => "true",
         "hiddenmenu"   => "true",
         "timeout"      => 10,
-        "trusted_grub" => "true"
+        "trusted_grub" => "true",
+        "smt"          => "true"
       }
 
       expect(subject.export(bootloader)["global"]).to eq expected_export
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.20/test/bootloader_proposal_client_test.rb 
new/yast2-bootloader-4.1.21/test/bootloader_proposal_client_test.rb
--- old/yast2-bootloader-4.1.20/test/bootloader_proposal_client_test.rb 
2019-03-01 08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/test/bootloader_proposal_client_test.rb 
2019-03-07 15:23:39.000000000 +0100
@@ -84,16 +84,6 @@
 
         subject.ask_user({})
       end
-
-      it "shows unsupported popup when upgrading from grub2 (bsc#1070233)" do
-        allow(Yast::Mode).to receive(:update).and_return(true)
-
-        expect(subject).to receive("old_bootloader").and_return("grub2")
-
-        expect(Yast::Bootloader).to_not receive(:Export)
-        expect(Yast2::Popup).to receive(:show)
-        subject.ask_user({})
-      end
     end
   end
 
@@ -180,17 +170,6 @@
       subject.make_proposal({})
     end
 
-    it "propose no change if old bootloader is grub2" do
-      allow(Yast::Mode).to receive(:update).and_return(true)
-
-      expect(subject).to receive("old_bootloader").and_return("grub2")
-
-      expect(Yast::Bootloader).to_not receive(:Propose)
-      expect(Yast::Bootloader).to_not receive(:Read)
-
-      expect(subject.make_proposal({})).to eq("raw_proposal" => ["do not 
change"])
-    end
-
     it "always resets if storage changed" do
       expect(Yast::Bootloader).to receive(:Reset)
       allow(Yast::BootStorage).to receive(:storage_changed?).and_return(true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.20/test/grub2base_test.rb 
new/yast2-bootloader-4.1.21/test/grub2base_test.rb
--- old/yast2-bootloader-4.1.20/test/grub2base_test.rb  2019-03-01 
08:48:52.000000000 +0100
+++ new/yast2-bootloader-4.1.21/test/grub2base_test.rb  2019-03-07 
15:23:39.000000000 +0100
@@ -117,7 +117,7 @@
         end
       end
 
-      context "when Product explicitelly disable os prober" do
+      context "when Product explicitly disable os prober" do
         before do
           allow(Yast::ProductFeatures).to 
receive(:GetBooleanFeature).and_return(true)
         end


Reply via email to