Hello community, here is the log from the commit of package yast2-kdump for openSUSE:Factory checked in at 2014-01-30 09:02:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-kdump (Old) and /work/SRC/openSUSE:Factory/.yast2-kdump.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-kdump" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-kdump/yast2-kdump.changes 2014-01-14 16:36:04.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-kdump.new/yast2-kdump.changes 2014-01-30 09:02:28.000000000 +0100 @@ -1,0 +2,12 @@ +Wed Jan 29 15:24:47 UTC 2014 - [email protected] + +- Fix internal error popup during installation(BNC#861075) +- 3.1.4 + +------------------------------------------------------------------- +Thu Jan 23 09:27:46 UTC 2014 - [email protected] + +- run a tool to propose the crashkernel value (FATE#315241) +- 3.1.3 + +------------------------------------------------------------------- Old: ---- yast2-kdump-3.1.2.tar.bz2 New: ---- yast2-kdump-3.1.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-kdump.spec ++++++ --- /var/tmp/diff_new_pack.Bl4Jk2/_old 2014-01-30 09:02:28.000000000 +0100 +++ /var/tmp/diff_new_pack.Bl4Jk2/_new 2014-01-30 09:02:28.000000000 +0100 @@ -17,9 +17,10 @@ Name: yast2-kdump -Version: 3.1.2 +Version: 3.1.4 Release: 0 +Url: https://github.com/yast/yast-kdump BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 ++++++ yast2-kdump-3.1.2.tar.bz2 -> yast2-kdump-3.1.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/package/yast2-kdump.changes new/yast2-kdump-3.1.4/package/yast2-kdump.changes --- old/yast2-kdump-3.1.2/package/yast2-kdump.changes 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/package/yast2-kdump.changes 2014-01-29 17:15:41.000000000 +0100 @@ -1,4 +1,16 @@ ------------------------------------------------------------------- +Wed Jan 29 15:24:47 UTC 2014 - [email protected] + +- Fix internal error popup during installation(BNC#861075) +- 3.1.4 + +------------------------------------------------------------------- +Thu Jan 23 09:27:46 UTC 2014 - [email protected] + +- run a tool to propose the crashkernel value (FATE#315241) +- 3.1.3 + +------------------------------------------------------------------- Fri Jan 10 16:25:05 CET 2014 - [email protected] - Added command-line support for firmware-assisted dump diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/package/yast2-kdump.spec new/yast2-kdump-3.1.4/package/yast2-kdump.spec --- old/yast2-kdump-3.1.2/package/yast2-kdump.spec 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/package/yast2-kdump.spec 2014-01-29 17:15:41.000000000 +0100 @@ -17,9 +17,10 @@ Name: yast2-kdump -Version: 3.1.2 +Version: 3.1.4 Release: 0 +Url: https://github.com/yast/yast-kdump BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/src/clients/kdump.rb new/yast2-kdump-3.1.4/src/clients/kdump.rb --- old/yast2-kdump-3.1.2/src/clients/kdump.rb 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/src/clients/kdump.rb 2014-01-29 17:15:41.000000000 +0100 @@ -420,7 +420,7 @@ CommandLine.Print( Builtins.sformat( _("Allocate memory (MB) for kdump is: %1"), - Kdump.alocated_memory + Kdump.allocated_memory ) ) else @@ -737,7 +737,7 @@ if Ops.get(options, "enable") != nil && Ops.get(options, "alloc_mem") != nil Kdump.add_crashkernel_param = true - Kdump.alocated_memory = Builtins.tostring(Ops.get(options, "alloc_mem")) + Kdump.allocated_memory = Builtins.tostring(Ops.get(options, "alloc_mem")) #TRANSLATORS: CommandLine printed text if Kdump.crashkernel_list_ranges CommandLine.Print( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/src/include/kdump/dialogs.rb new/yast2-kdump-3.1.4/src/include/kdump/dialogs.rb --- old/yast2-kdump-3.1.2/src/include/kdump/dialogs.rb 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/src/include/kdump/dialogs.rb 2014-01-29 17:15:41.000000000 +0100 @@ -90,7 +90,7 @@ ), Left( IntField( - Id("memory_buffer"), + Id("allocated_memory"), Opt(:notify), _("Kdump Memor&y [MB]"), 32, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/src/include/kdump/uifunctions.rb new/yast2-kdump-3.1.4/src/include/kdump/uifunctions.rb --- old/yast2-kdump-3.1.2/src/include/kdump/uifunctions.rb 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/src/include/kdump/uifunctions.rb 2014-01-29 17:15:41.000000000 +0100 @@ -1382,9 +1382,9 @@ Builtins.tostring(Kdump.total_memory) ) UI.ChangeWidget( - Id("memory_buffer"), + Id("allocated_memory"), :Value, - Builtins.tointeger(Kdump.alocated_memory) + Builtins.tointeger(Kdump.allocated_memory) ) UI.ChangeWidget( Id("usable_memory"), @@ -1392,14 +1392,14 @@ Builtins.tostring( Ops.subtract( Kdump.total_memory, - Convert.to_integer(UI.QueryWidget(Id("memory_buffer"), :Value)) + Convert.to_integer(UI.QueryWidget(Id("allocated_memory"), :Value)) ) ) ) else UI.ChangeWidget(Id("total_memory"), :Value, "0") UI.ChangeWidget(Id("usable_memory"), :Value, "0") - UI.ChangeWidget(Id("memory_buffer"), :Enabled, false) + UI.ChangeWidget(Id("allocated_memory"), :Enabled, false) end nil @@ -1411,10 +1411,10 @@ def HandleKdumpMemory(key, event) event = deep_copy(event) ret = Ops.get(event, "ID") - if ret == "memory_buffer" - value = Convert.to_integer(UI.QueryWidget(Id("memory_buffer"), :Value)) + if ret == "allocated_memory" + value = Convert.to_integer(UI.QueryWidget(Id("allocated_memory"), :Value)) if Ops.greater_than(value, Kdump.total_memory) - UI.ChangeWidget(Id("memory_buffer"), :Value, Kdump.total_memory) + UI.ChangeWidget(Id("allocated_memory"), :Value, Kdump.total_memory) UI.ChangeWidget(Id("usable_memory"), :Value, "0") else UI.ChangeWidget( @@ -1423,7 +1423,7 @@ Builtins.tostring( Ops.subtract( Kdump.total_memory, - Convert.to_integer(UI.QueryWidget(Id("memory_buffer"), :Value)) + Convert.to_integer(UI.QueryWidget(Id("allocated_memory"), :Value)) ) ) ) @@ -1454,8 +1454,8 @@ def StoreKdumpMemory(key, event) event = deep_copy(event) - Kdump.alocated_memory = Builtins.tostring( - UI.QueryWidget(Id("memory_buffer"), :Value) + Kdump.allocated_memory = Builtins.tostring( + UI.QueryWidget(Id("allocated_memory"), :Value) ) nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/src/modules/Kdump.rb new/yast2-kdump-3.1.4/src/modules/Kdump.rb --- old/yast2-kdump-3.1.2/src/modules/Kdump.rb 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/src/modules/Kdump.rb 2014-01-29 17:15:41.000000000 +0100 @@ -138,7 +138,7 @@ # "crashkernel" # # string value number of alocate memory - @alocated_memory = "0" + @allocated_memory = "0" # Boolean option indicates that Import() # was called and data was proposed @@ -465,12 +465,12 @@ end - # get alocated memory from value of crashkernel option + # get allocated memory from value of crashkernel option # there can be several ranges -> take the first range # @param string 64M@16M or 128M-:64M@16M [(reserved_memory*2)-:reserved_memory] - # @return [String] value of alocated memory (64M) + # @return [String] value of allocated memory (64M) - def getAlocatedMemory(crash_value) + def getAllocatedMemory(crash_value) result = "" allocated = "" range = "" @@ -496,7 +496,7 @@ result end - # Build crashkernel value from alocated memory + # Build crashkernel value from allocated memory # # @return [String] value of crashkernel @@ -506,7 +506,7 @@ return @crashkernel_param_value if @crashkernel_list_ranges crash_value = "" - crash_value = Ops.add(@alocated_memory, "M") + crash_value = Ops.add(@allocated_memory, "M") # bnc#563905 problem with offset in crashkernel if Arch.i386 || Arch.x86_64 || Arch.ia64 || Arch.ppc64 @@ -523,7 +523,7 @@ end reserved_memory = Builtins.tostring( - Ops.multiply(2, Builtins.tointeger(@alocated_memory)) + Ops.multiply(2, Builtins.tointeger(@allocated_memory)) ) @@ -542,7 +542,7 @@ def convertCrashkernelForXEN(crash) crash_value = "" if crash != "" - crash_value = Ops.add(getAlocatedMemory(crash), "M") + crash_value = Ops.add(getAllocatedMemory(crash), "M") # bnc#563905 problem with offset in crashkernel #if ((Arch::i386()) ||(Arch::x86_64()) || Arch::ppc64()) # crash_value = crash_value + "@16M"; @@ -621,7 +621,7 @@ @crashkernel_param = true @add_crashkernel_param = true @crashkernel_param_value = getCrashKernelValue(crash_arg) - @alocated_memory = getAlocatedMemory(@crashkernel_param_value) + @allocated_memory = getAllocatedMemory(@crashkernel_param_value) else @crashkernel_param = false @add_crashkernel_param = false @@ -662,61 +662,48 @@ @crashkernel_param_value = result if result != "false" - @alocated_memory = getAlocatedMemory(@crashkernel_param_value) + @allocated_memory = getAllocatedMemory(@crashkernel_param_value) end true end - # Propose reserved/allocated memory - # - # - # @return [Boolean] successfull + TEMPORARY_CONFIG_FILE = "/var/lib/YaST2/kdump.sysconfig" - def ProposeAlocatedMemory - if @alocated_memory == "0" - if Ops.greater_or_equal(@total_memory, 512) && - Ops.less_than(Ops.divide(@total_memory, 1024), 2) - @alocated_memory = "64" - elsif Ops.greater_or_equal(Ops.divide(@total_memory, 1024), 2) - @alocated_memory = "128" - end + def write_temporary_config_file + # In inst_sys there is not kdump_file + return unless FileUtils.Exists(@kdump_file) + + # FIXME parameterize Write instead of copying the old config + # NOTE make sure we do not lose 600 mode (cp is ok) + command = "cp #{@kdump_file} #{TEMPORARY_CONFIG_FILE}" + retcode = SCR.Execute(path(".target.bash"), command) + # if this fails the system is broken; SCR has logged the details + raise "cannot copy files" if retcode != 0 + end + + PROPOSE_ALLOCATED_MEMORY_MB_COMMAND = "kdumptool --configfile #{TEMPORARY_CONFIG_FILE} calibrate" + # if the command fails + PROPOSE_ALLOCATED_MEMORY_MB_FALLBACK = "128" - # bnc #431492 - UPT-LTE: /proc/vmcore is empty in kdump kerne - if Arch.ppc64 && @alocated_memory != "" - al_mem = Builtins.tointeger(@alocated_memory) - al_mem = Ops.multiply(al_mem, 2) - @alocated_memory = Builtins.tostring(al_mem) - end - # bnc #446480 - Fine-tune kdump memory proposal - if Arch.ia64 && Ops.greater_or_equal(@total_memory, 1024) - total_memory_gigabyte = Ops.divide(@total_memory, 1024) - if Ops.greater_or_equal(total_memory_gigabyte, 1) && - Ops.less_than(total_memory_gigabyte, 8) - @alocated_memory = "256" - elsif Ops.greater_or_equal(total_memory_gigabyte, 8) && - Ops.less_than(total_memory_gigabyte, 128) - @alocated_memory = "512" - elsif Ops.greater_or_equal(total_memory_gigabyte, 128) && - Ops.less_than(total_memory_gigabyte, 256) - @alocated_memory = "768" - elsif Ops.greater_or_equal(total_memory_gigabyte, 256) && - Ops.less_than(total_memory_gigabyte, 378) - @alocated_memory = "1024" - elsif Ops.greater_or_equal(total_memory_gigabyte, 378) && - Ops.less_than(total_memory_gigabyte, 512) - @alocated_memory = "1536" - elsif Ops.greater_or_equal(total_memory_gigabyte, 512) && - Ops.less_than(total_memory_gigabyte, 768) - @alocated_memory = "2048" - elsif Ops.greater_or_equal(total_memory_gigabyte, 768) - @alocated_memory = "3072" - end - end + # Propose reserved/allocated memory + # Store the result as a string! to @allocated_memory + # @return [Boolean] true, always successful + def ProposeAllocatedMemory + # only propose once + return true if @allocated_memory != "0" + + write_temporary_config_file + out = SCR.Execute(path(".target.bash_output"), PROPOSE_ALLOCATED_MEMORY_MB_COMMAND) + @allocated_memory = out["stdout"].chomp + if out["exit"] != 0 or @allocated_memory.empty? + # stderr has been already logged + Builtins.y2error("failed to propose allocated memory") + @allocated_memory = PROPOSE_ALLOCATED_MEMORY_MB_FALLBACK end Builtins.y2milestone( "[kdump] allocated memory if not set in \"crashkernel\" param: %1", - @alocated_memory + @allocated_memory ) true end @@ -756,7 +743,7 @@ "[kdump] (ReadAvailableMemory) total phys. memory [MB]: %1", Builtins.tostring(@total_memory) ) - ProposeAlocatedMemory() + ProposeAllocatedMemory() true end @@ -1356,7 +1343,7 @@ publish :variable => :crashkernel_param, :type => "boolean" publish :variable => :crashkernel_param_value, :type => "string" publish :variable => :add_crashkernel_param, :type => "boolean" - publish :variable => :alocated_memory, :type => "string" + publish :variable => :allocated_memory, :type => "string" publish :variable => :import_called, :type => "boolean" publish :variable => :actual_boot_section, :type => "string" publish :variable => :write_only, :type => "boolean" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/test/Makefile.am new/yast2-kdump-3.1.4/test/Makefile.am --- old/yast2-kdump-3.1.2/test/Makefile.am 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/test/Makefile.am 2014-01-29 17:15:41.000000000 +0100 @@ -1,5 +1,6 @@ TESTS = \ - fadump_test.rb + fadump_test.rb \ + kdump_test.rb TEST_EXTENSIONS = .rb RB_LOG_COMPILER = rspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/test/kdump_test.rb new/yast2-kdump-3.1.4/test/kdump_test.rb --- old/yast2-kdump-3.1.2/test/kdump_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-kdump-3.1.4/test/kdump_test.rb 2014-01-29 17:15:41.000000000 +0100 @@ -0,0 +1,43 @@ +#!/usr/bin/env rspec +ENV["Y2DIR"] = File.expand_path("../../src", __FILE__) + +require "yast" +include Yast +Yast.import "Kdump" + +describe Kdump do + # allocated_memory is a string in megabytes + # total_memory is an integer in megabytes + describe "#ProposeAllocatedMemory" do + context "when already proposed" do + before(:each) do + Kdump.allocated_memory = "42" + end + it "proposes the current value" do + Kdump.ProposeAllocatedMemory + expect(Kdump.allocated_memory).to eq "42" + end + end + + context "when not yet proposed" do + before(:each) do + Kdump.allocated_memory = "0" + end + + context "when the proposal tool is not implemented yet" do + before(:each) do + SCR.stub(:Execute). + with(path(".target.bash"), /^cp/).and_return(0) + SCR.stub(:Execute). + with(path(".target.bash_output"), /^kdumptool/). + and_return({"exit" => 1, "stdout" => "", "stderr" => "not there" }) + end + + it "proposes a positive integer" do + Kdump.ProposeAllocatedMemory + expect(Kdump.allocated_memory.to_i).to be > 0 + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/testsuite/Makefile.am new/yast2-kdump-3.1.4/testsuite/Makefile.am --- old/yast2-kdump-3.1.2/testsuite/Makefile.am 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/testsuite/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,21 +0,0 @@ -# -# Makefile.am for .../testsuite -# -# Do not edit this file (Makefile.am) as it will be overwritten! -# - -AUTOMAKE_OPTIONS = dejagnu -EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.rb) - -testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite - -all-local: $(testsuite_prepare) - make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) - -clean-local: $(testsuite_prepare) - make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) clean - -check-local: $(testsuite_prepare) - make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) check - -# EOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-kdump-3.1.2/testsuite/tests/Kdump.rb new/yast2-kdump-3.1.4/testsuite/tests/Kdump.rb --- old/yast2-kdump-3.1.2/testsuite/tests/Kdump.rb 2014-01-13 10:19:44.000000000 +0100 +++ new/yast2-kdump-3.1.4/testsuite/tests/Kdump.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -# encoding: utf-8 - -module Yast - class KdumpClient < Client - def main - # testedfiles: Kdump.ycp - - Yast.include self, "testsuite.rb" - # map I_READ = $[]; - # map I_WRITE = $[]; - # map I_EXEC = $[ - # "target" : $[ - # "bash_output" : $[], - # ], - # ]; - # - # TESTSUITE_INIT([I_EXEC, I_READ, I_WRITE], nil); - # - # - # import "Kdump"; - # - # - # DUMP("Kdump::Modified"); - # TEST(``(Kdump::Modified()), [], nil); - - nil - end - end -end - -Yast::KdumpClient.new.main -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
