Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-kdump for openSUSE:Factory checked in at 2022-05-12 22:57:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-kdump (Old) and /work/SRC/openSUSE:Factory/.yast2-kdump.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-kdump" Thu May 12 22:57:41 2022 rev:110 rq:976059 version:4.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-kdump/yast2-kdump.changes 2022-04-14 17:25:20.063254196 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-kdump.new.1538/yast2-kdump.changes 2022-05-12 22:57:48.484591196 +0200 @@ -1,0 +2,7 @@ +Tue May 10 10:04:49 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Do not limit to kdumptool MaxLow when using fadump (related + to jsc#SLE-21644). +- 4.5.1 + +------------------------------------------------------------------- Old: ---- yast2-kdump-4.5.0.tar.bz2 New: ---- yast2-kdump-4.5.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-kdump.spec ++++++ --- /var/tmp/diff_new_pack.gNSXjc/_old 2022-05-12 22:57:49.424592458 +0200 +++ /var/tmp/diff_new_pack.gNSXjc/_new 2022-05-12 22:57:49.428592463 +0200 @@ -17,7 +17,7 @@ Name: yast2-kdump -Version: 4.5.0 +Version: 4.5.1 Release: 0 Summary: Configuration of kdump License: GPL-2.0-only ++++++ yast2-kdump-4.5.0.tar.bz2 -> yast2-kdump-4.5.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.5.0/package/yast2-kdump.changes new/yast2-kdump-4.5.1/package/yast2-kdump.changes --- old/yast2-kdump-4.5.0/package/yast2-kdump.changes 2022-04-12 13:35:15.000000000 +0200 +++ new/yast2-kdump-4.5.1/package/yast2-kdump.changes 2022-05-10 13:59:24.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue May 10 10:04:49 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Do not limit to kdumptool MaxLow when using fadump (related + to jsc#SLE-21644). +- 4.5.1 + +------------------------------------------------------------------- Wed Apr 06 13:24:58 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz> - Bump version to 4.5.0 (bsc#1198109) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.5.0/package/yast2-kdump.spec new/yast2-kdump-4.5.1/package/yast2-kdump.spec --- old/yast2-kdump-4.5.0/package/yast2-kdump.spec 2022-04-12 13:35:15.000000000 +0200 +++ new/yast2-kdump-4.5.1/package/yast2-kdump.spec 2022-05-10 13:59:24.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-kdump -Version: 4.5.0 +Version: 4.5.1 Release: 0 Summary: Configuration of kdump License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.5.0/src/include/kdump/dialogs.rb new/yast2-kdump-4.5.1/src/include/kdump/dialogs.rb --- old/yast2-kdump-4.5.0/src/include/kdump/dialogs.rb 2022-04-12 13:35:15.000000000 +0200 +++ new/yast2-kdump-4.5.1/src/include/kdump/dialogs.rb 2022-05-10 13:59:24.000000000 +0200 @@ -523,19 +523,6 @@ end def kdump_memory_widget - low_min = Kdump.memory_limits[:min_low].to_i - low_max = Kdump.memory_limits[:max_low].to_i - low_default = Kdump.memory_limits[:default_low].to_i - low_label = if Kdump.high_memory_supported? - _("Kdump &Low Memory [MiB]") - else - _("Kdump Memor&y [MiB]") - end - # TRANSLATORS: %{min}, %{max}, %{default} are variable names which must not be translated. - low_range = format(_("(min: %{min}; max: %{max}; suggested: %{default})"), - min: low_min, - max: low_max, - default: low_default) widgets = [ Left( HBox( @@ -548,18 +535,12 @@ Left( HBox( Left(Label(_("Usable Memory [MiB]:"))), - Left(Label(Id("usable_memory"), "0123456789")), + Left(ReplacePoint(Id("usable_memory_rp"), usable_memory_widget)), HStretch() ) ), VSpacing(1), - Left(IntField(Id("allocated_low_memory"), - Opt(:notify), - low_label, - low_min, - low_max, - 0)), - Left(Label(low_range)) + Left(ReplacePoint(Id("allocated_low_memory_rp"), low_memory_widget)) ] if Kdump.high_memory_supported? high_min = Kdump.memory_limits[:min_high].to_i @@ -614,5 +595,52 @@ "next_button" => Label.OKButton ) end + + private + + # Returns the low memory widget + # + # @param value [Integer] Current value + # @return [Yast::Term] Low memory widget + def low_memory_widget(value = nil) + low_label = if Kdump.high_memory_supported? + _("Kdump &Low Memory [MiB]") + else + _("Kdump Memor&y [MiB]") + end + + limits = Kdump.memory_limits + current = (limits[:min_low]..limits[:max_low]).cover?(value) ? value : limits[:default_low] + + VBox( + IntField( + Id("allocated_low_memory"), + Opt(:notify), + low_label, + limits[:min_low], + limits[:max_low], + current + ), + Label( + # TRANSLATORS: %{min}, %{max}, %{default} are variable names which must not be translated. + format(_("(min: %{min}; max: %{max}; suggested: %{default})"), + min: limits[:min_low], + max: limits[:max_low], + default: limits[:default_low]) + ) + ) + end + + # Returns the usable memory widget + # + # It is just a label, but the idea is to redraw the widget to avoid + # some resizing problems. + # + # @param value [Integer,nil] Current value + # @return [Yast::Term] Usable memory label + def usable_memory_widget(value = nil) + content = value ? value.to_s : "0123456789" + Label(Id("usable_memory"), content) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.5.0/src/include/kdump/uifunctions.rb new/yast2-kdump-4.5.1/src/include/kdump/uifunctions.rb --- old/yast2-kdump-4.5.0/src/include/kdump/uifunctions.rb 2022-04-12 13:35:15.000000000 +0200 +++ new/yast2-kdump-4.5.1/src/include/kdump/uifunctions.rb 2022-05-10 13:59:24.000000000 +0200 @@ -1334,7 +1334,7 @@ # Updates the free memory displayed in the UI def update_usable_memory value = Kdump.total_memory - allocated_memory - UI.ChangeWidget(Id("usable_memory"), :Value, value.to_s) + UI.ReplaceWidget(Id("usable_memory_rp"), usable_memory_widget(value)) end # Function initializes option @@ -1442,11 +1442,21 @@ # If cannot adjust the fadump usage if !Kdump.use_fadump(UI.QueryWidget(Id("use_fadump"), :Value)) UI.ChangeWidget(Id("use_fadump"), :Value, false) + return end + refresh_kdump_memory + update_usable_memory + nil end + def refresh_kdump_memory + widget_id = Id("allocated_low_memory") + value = UI.QueryWidget(widget_id, :Value) + UI.ReplaceWidget(Id("allocated_low_memory_rp"), low_memory_widget(value)) + end + # Function initializes option # "Custom kdump Kernel" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.5.0/src/modules/Kdump.rb new/yast2-kdump-4.5.1/src/modules/Kdump.rb --- old/yast2-kdump-4.5.0/src/modules/Kdump.rb 2022-04-12 13:35:15.000000000 +0200 +++ new/yast2-kdump-4.5.1/src/modules/Kdump.rb 2022-05-10 13:59:24.000000000 +0200 @@ -335,8 +335,19 @@ end end + # Returns the Kdump memory limits + # + # It relies on the calibrator but it adjust the low memory limits when using firmware-assisted + # dumps. The reason is that those limits might contradict the recommended value. See + # jsc#SLE-21644 for more information. + # + # @return [Hash] The hash contains the following keys: :min_low, :max_low, + # :default_low, :min_high, :max_high, :default_high def memory_limits - calibrator.memory_limits + limits = calibrator.memory_limits + return limits unless using_fadump? + + limits.merge(min_low: 0, max_low: total_memory) end # Propose reserved/allocated memory diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-4.5.0/test/kdump_test.rb new/yast2-kdump-4.5.1/test/kdump_test.rb --- old/yast2-kdump-4.5.0/test/kdump_test.rb 2022-04-12 13:35:15.000000000 +0200 +++ new/yast2-kdump-4.5.1/test/kdump_test.rb 2022-05-10 13:59:24.000000000 +0200 @@ -857,4 +857,55 @@ expect(subject.Export).to eq("add_crash_kernel" => false) end end + + describe ".memory_limits" do + let(:limits) do + { + min_low: 72, + max_low: 3154, + default_low: 72, + min_high: 0, + max_high: 4247, + default_high: 323 + } + end + + let(:calibrator) do + instance_double( + Yast::KdumpCalibrator, + total_memory: 16334, + memory_limits: limits + ) + end + + let(:fadump?) { false } + + before do + allow(Yast::Kdump).to receive(:calibrator).and_return(calibrator) + allow(Yast::Kdump).to receive(:using_fadump?).and_return(fadump?) + end + + it "returns a hash containing the memory limits from the calibrator" do + expect(subject.memory_limits).to eq( + min_low: 72, + max_low: 3154, + default_low: 72, + min_high: 0, + max_high: 4247, + default_high: 323 + ) + end + + context "when fadump is enabled" do + let(:fadump?) { true } + + it "returns the total memory as limit :max_low limit" do + expect(subject.memory_limits[:max_low]).to eq(16334) + end + + it "returns :min_low as 0" do + expect(subject.memory_limits[:min_low]).to eq(0) + end + end + end end