Hello community,

here is the log from the commit of package yast2-kdump for openSUSE:Factory 
checked in at 2013-12-08 19:50:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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  2013-10-20 
10:54:44.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-kdump.new/yast2-kdump.changes     
2013-12-08 19:50:21.000000000 +0100
@@ -1,0 +2,7 @@
+Fri Nov 29 11:04:38 CET 2013 - loci...@suse.com
+
+- Added support for firmware-assisted dump (for ppc64 only)
+  (FATE#315780)
+- 3.1.1
+
+-------------------------------------------------------------------

Old:
----
  yast2-kdump-3.1.0.tar.bz2

New:
----
  yast2-kdump-3.1.1.tar.bz2

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

Other differences:
------------------
++++++ yast2-kdump.spec ++++++
--- /var/tmp/diff_new_pack.4gf8tu/_old  2013-12-08 19:50:22.000000000 +0100
+++ /var/tmp/diff_new_pack.4gf8tu/_new  2013-12-08 19:50:22.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-kdump
-Version:        3.1.0
+Version:        3.1.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -27,6 +27,7 @@
 Requires:       yast2-bootloader
 Requires:       yast2-storage
 BuildRequires:  perl-XML-Writer
+BuildRequires:  rubygem-rspec
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2
 BuildRequires:  yast2-bootloader

++++++ yast2-kdump-3.1.0.tar.bz2 -> yast2-kdump-3.1.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/CONTRIBUTING.md 
new/yast2-kdump-3.1.1/CONTRIBUTING.md
--- old/yast2-kdump-3.1.0/CONTRIBUTING.md       1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-kdump-3.1.1/CONTRIBUTING.md       2013-11-28 12:45:33.000000000 
+0100
@@ -0,0 +1,87 @@
+YaST Contribution Guidelines
+============================
+
+YaST is an open source project and as such it welcomes all kinds of
+contributions. If you decide to contribute, please follow these guidelines to
+ensure the process is effective and pleasant both for you and YaST maintainers.
+
+There are two main forms of contribution: reporting bugs and performing code
+changes.
+
+Bug Reports
+-----------
+
+If you find a problem, please report it either using
+[Bugzilla](https://bugzilla.novell.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2)
+or [GitHub issues](../../issues). (For Bugzilla, use the [simplified
+registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp)
+if you don't have an account yet.)
+
+If you find a problem, please report it either using
+[Bugzilla](https://bugzilla.novell.com/) or GitHub issues. We can't guarantee
+that every bug will be fixed, but we'll try.
+
+When creating a bug report, please follow our [bug reporting
+guidelines](http://en.opensuse.org/openSUSE:Report_a_YaST_bug).
+
+Code Changes
+------------
+
+We welcome all kinds of code contributions, from simple bug fixes to 
significant
+refactorings and implementation of new features. However, before making any
+non-trivial contribution, get in touch with us first — this can prevent wasted
+effort on both sides. Also, have a look at our [development
+documentation](http://en.opensuse.org/openSUSE:YaST_development).
+
+To send us your code change, use GitHub pull requests. The workflow is as
+follows:
+
+  1. Fork the project.
+
+  2. Create a topic branch based on `master`.
+
+  3. Implement your change, including tests (if possible). Make sure you adhere
+     to the [Ruby style
+     guide](https://github.com/SUSE/style-guides/blob/master/Ruby.md).
+
+  4. Make sure your change didn't break anything by building the RPM package
+     (`rake osc:build`). The build process includes running the full testsuite.
+
+  5. Publish the branch and create a pull request.
+
+  6. YaST developers will review your change and possibly point out issues.
+     Adapt the code under their guidance until they are all resolved.
+
+  7. Finally, the pull request will get merged or rejected.
+
+See also [GitHub's guide on
+contributing](https://help.github.com/articles/fork-a-repo).
+
+If you want to do multiple unrelated changes, use separate branches and pull
+requests.
+
+Do not change the `VERSION` and `*.changes` files as this could lead to
+conflicts.
+
+### Commits
+
+Each commit in the pull request should do only one thing, which is clearly
+described by its commit message. Especially avoid mixing formatting changes and
+functional changes into one commit. When writing commit messages, adhere to
+[widely used
+conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
+
+If your commit is related to a bug in Buzgilla or an issue on GitHub, make sure
+you mention it in the commit message for cross-reference. Use format like
+bnc#775814 or gh#yast/yast-foo#42. See also [GitHub
+autolinking](https://help.github.com/articles/github-flavored-markdown#references)
+and [openSUSE abbreviation
+reference](http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines#Current_set_of_abbreviations).
+
+Additional Information
+----------------------
+
+If you have any question, feel free to ask at the [development mailing
+list](http://lists.opensuse.org/yast-devel/) or at the
+[#yast](http://webchat.freenode.net/?channels=%23yast) IRC channel on freenode.
+We'll do our best to provide a timely and accurate answer.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/VERSION 
new/yast2-kdump-3.1.1/VERSION
--- old/yast2-kdump-3.1.0/VERSION       2013-10-16 09:05:51.000000000 +0200
+++ new/yast2-kdump-3.1.1/VERSION       2013-12-06 16:20:13.000000000 +0100
@@ -1 +1 @@
-3.1.0
+3.1.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/package/yast2-kdump.changes 
new/yast2-kdump-3.1.1/package/yast2-kdump.changes
--- old/yast2-kdump-3.1.0/package/yast2-kdump.changes   2013-10-16 
09:05:51.000000000 +0200
+++ new/yast2-kdump-3.1.1/package/yast2-kdump.changes   2013-12-06 
16:20:13.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Nov 29 11:04:38 CET 2013 - loci...@suse.com
+
+- Added support for firmware-assisted dump (for ppc64 only)
+  (FATE#315780)
+- 3.1.1
+
+-------------------------------------------------------------------
 Wed Sep 18 17:33:12 UTC 2013 - lsle...@suse.cz
 
 - do not use *.spec.in template, use *.spec file with RPM macros
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/package/yast2-kdump.spec 
new/yast2-kdump-3.1.1/package/yast2-kdump.spec
--- old/yast2-kdump-3.1.0/package/yast2-kdump.spec      2013-10-16 
09:05:51.000000000 +0200
+++ new/yast2-kdump-3.1.1/package/yast2-kdump.spec      2013-12-06 
16:20:13.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-kdump
-Version:        3.1.0
+Version:        3.1.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -28,6 +28,7 @@
 Requires:      yast2 yast2-storage yast2-bootloader
 BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-testsuite 
yast2-storage yast2-bootloader
 BuildRequires:  yast2-devtools >= 3.0.6
+BuildRequires:  rubygem-rspec
 
 Recommends:     kdump makedumpfile
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/src/include/kdump/dialogs.rb 
new/yast2-kdump-3.1.1/src/include/kdump/dialogs.rb
--- old/yast2-kdump-3.1.0/src/include/kdump/dialogs.rb  2013-10-16 
09:05:51.000000000 +0200
+++ new/yast2-kdump-3.1.1/src/include/kdump/dialogs.rb  2013-12-06 
16:20:13.000000000 +0100
@@ -119,6 +119,13 @@
           ),
           "help"              => HelpKdump("KdumpMemory")
         },
+        "FADump"   => {
+          "widget" => :custom,
+          "custom_widget" => Empty(),
+          "init"   => fun_ref(method(:InitFADump), "void (string)"),
+          "handle" => fun_ref(method(:HandleFADump), "void (string, map)"),
+          "help"   => HelpKdump("FADump"),
+        },
         #---------============ Dump Filtering screen=============------------
         "DumpLevel"              => {
           "widget"            => :custom,
@@ -411,8 +418,8 @@
         "start_up"           => {
           "contents"        => VBox(
             "EnableDisalbeKdump",
-            #`VStretch ()
             VSpacing(1),
+            Left(ReplacePoint(Id("FADump"), Empty())),
             Frame(
               _("Kdump Memory"),
               HBox(HSpacing(1), VBox(Left("KdumpMemory")))
@@ -424,6 +431,7 @@
           "widget_names"    => [
             "DisBackButton",
             "EnableDisalbeKdump",
+            (Kdump.fadump_supported? ? "FADump":""),
             "KdumpMemory"
           ]
         },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/src/include/kdump/helps.rb 
new/yast2-kdump-3.1.1/src/include/kdump/helps.rb
--- old/yast2-kdump-3.1.0/src/include/kdump/helps.rb    2013-10-16 
09:05:51.000000000 +0200
+++ new/yast2-kdump-3.1.1/src/include/kdump/helps.rb    2013-12-06 
16:20:13.000000000 +0100
@@ -42,6 +42,17 @@
         "KdumpMemory"            => _(
           "<p><b>Kdump Memory</b><br>\n    Allocation of memory for kdump 
kernel. <br></p>\n"
         ),
+        # fadump
+        "FADump"                 => _(
+          # T: help text for a combo box
+          # description taken from http://lparbox.com/how-to/aix/19
+          "<p><b>Firmware-Assisted Dump</b><br>\n" +
+            "    Dumps are not generated before the partition is reinitialized 
but take place " +
+            "    when the partition is restarting. When performing a 
firmware-assisted dump, " +
+            "    system memory is frozen and the partition rebooted, which 
allows a new instance " + 
+            "    of the operating system to dump data from the previous kernel 
crash." +
+            "    This feature is suitable only when the system has more than 
1.5 GB of memory.</p>"
+        ),
         # Kdump Memor&y [MB] - IntField 1/1
         "DumpLevel"              => _(
           "<p><b>Dump Level</b><br>\n" +
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/src/include/kdump/uifunctions.rb 
new/yast2-kdump-3.1.1/src/include/kdump/uifunctions.rb
--- old/yast2-kdump-3.1.0/src/include/kdump/uifunctions.rb      2013-10-16 
09:05:51.000000000 +0200
+++ new/yast2-kdump-3.1.1/src/include/kdump/uifunctions.rb      2013-12-06 
16:20:13.000000000 +0100
@@ -1461,6 +1461,35 @@
       nil
     end
 
+    # Initializes FADump settings in UI
+    def InitFADump(key)
+      if Kdump.fadump_supported? && UI.WidgetExists(Id("FADump"))
+        UI.ReplaceWidget(
+          Id("FADump"),
+          VBox(
+            CheckBox(
+              Id("use_fadump"),
+              Opt(:notify),
+              # T: Checkbox label
+              _("Use &Firmware-Assisted Dump"),
+              Kdump.use_fadump?
+            ),
+            VSpacing(1)
+          )
+        )
+      end
+    end
+
+    def HandleFADump(key, event)
+      return if event["ID"] != "use_fadump"
+
+      # If cannot adjust the fadump usage
+      if ! Kdump.use_fadump(UI.QueryWidget(Id("use_fadump"), :Value))
+        UI.ChangeWidget(Id("use_fadump"), :Value, false)
+      end
+
+      nil
+    end
 
     # Function initializes option
     # "Custom kdump Kernel"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/src/modules/Kdump.rb 
new/yast2-kdump-3.1.1/src/modules/Kdump.rb
--- old/yast2-kdump-3.1.0/src/modules/Kdump.rb  2013-10-16 09:05:51.000000000 
+0200
+++ new/yast2-kdump-3.1.1/src/modules/Kdump.rb  2013-12-06 16:20:13.000000000 
+0100
@@ -32,6 +32,8 @@
 
 module Yast
   class KdumpClass < Module
+    FADUMP_KEY = "KDUMP_FADUMP"
+
     def main
       textdomain "kdump"
 
@@ -51,6 +53,7 @@
       Yast.import "ProductFeatures"
       Yast.import "PackagesProposal"
       Yast.import "FileUtils"
+      Yast.import "Directory"
 
       # Data was modified?
       @modified = false
@@ -189,6 +192,9 @@
       # map <string, string > of kdump settings
       #
       @KDUMP_SETTINGS = {}
+
+      # initial kdump settings replaced in Read function
+      @initial_kdump_settings = deep_copy(@KDUMP_SETTINGS)
     end
 
     # Abort function
@@ -780,10 +786,36 @@
       )
       Builtins.y2milestone("---------------------------------------------")
 
+      @initial_kdump_settings = deep_copy(@KDUMP_SETTINGS)
+
       true
     end
 
+    # Updates initrd and reports whether it was successful.
+    # Failed update is reported using Report library.
+    #
+    # @return [Boolean] whether successful
+    def update_initrd
+      # See FATE#315780
+      # See https://www.suse.com/support/kb/doc.php?id=7012786
+      update_command = (using_fadump? ? "mkdumprd -f" : "mkinitrd")
+      update_logfile = File.join(Directory.vardir, "y2logmkinitrd")
+
+      run_command = update_command + " >> #{update_logfile} 2>&1"
+      y2milestone("Running command: #{run_command}")
+      ret = SCR.Execute(path(".target.bash"), run_command)
+
+      if ret != 0
+        y2error("Error updating initrd, see #{update_logfile} or call 
{update_command} manually")
+        Report.Error(_(
+          "Error updating initrd while calling '%{cmd}'.\n" +
+          "See %{log} for details."
+        ) % { :cmd => update_command, :log => update_logfile })
+        return false
+      end
 
+      true
+    end
 
     # Write current kdump configuration
     #
@@ -808,6 +840,9 @@
       end
       SCR.Write(path(".sysconfig.kdump"), nil)
 
+      if using_fadump_changed? && ! update_initrd
+        return false
+      end
 
       if checkPassword
         Chmod(@kdump_file, "600")
@@ -1041,7 +1076,10 @@
       return false if Abort()
       Progress.NextStage
       # Error message
-      Report.Error(_("Cannot write settings.")) if !WriteKdumpSettings()
+      if ! WriteKdumpSettings()
+        Report.Error(_("Cannot write settings."))
+        return false
+      end
 
       # write/delete bootloader option for kernel "crashkernel"
       return false if Abort()
@@ -1267,6 +1305,44 @@
       result
     end
 
+    # Returns whether FADump (Firmware assisted dump) is supported
+    # by the current system
+    #
+    # @return [Boolean] is supported
+    def fadump_supported?
+      Arch.ppc64
+    end
+
+    # Sets whether to use FADump (Firmware assisted dump)
+    #
+    # @param [Boolean] new state
+    # @return [Boolean] whether successfully set
+    def use_fadump(new_value)
+      # Trying to use fadump on unsupported hardware
+      if !fadump_supported? && new_value
+        Builtins.y2milestone("FADump is not supported on this hardware")
+        Report.Error(_("Cannot use Firmware-assisted dump.\nIt is not 
supported on this hardware."))
+        return false
+      end
+
+      @KDUMP_SETTINGS[FADUMP_KEY] = (new_value ? "yes" : "no")
+      true
+    end
+
+    # Returns whether FADump (Firmware assisted dump) is currently in use
+    #
+    # @return [Boolean] currently in use
+    def using_fadump?
+      @KDUMP_SETTINGS[FADUMP_KEY] == "yes"
+    end
+
+    # Has the using_fadump? been changed?
+    #
+    # @return [Boolean] whether changed
+    def using_fadump_changed?
+      @initial_kdump_settings[FADUMP_KEY] != @KDUMP_SETTINGS[FADUMP_KEY]
+    end
+
     publish :function => :GetModified, :type => "boolean ()"
     publish :function => :SetModified, :type => "void ()"
     publish :variable => :modified, :type => "boolean"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/test/Makefile.am 
new/yast2-kdump-3.1.1/test/Makefile.am
--- old/yast2-kdump-3.1.0/test/Makefile.am      1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-kdump-3.1.1/test/Makefile.am      2013-12-06 16:20:13.000000000 
+0100
@@ -0,0 +1,7 @@
+TESTS = \
+  fadump_test.rb
+
+TEST_EXTENSIONS = .rb
+RB_LOG_COMPILER = rspec
+VERBOSE = 1
+EXTRA_DIST = $(TESTS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-kdump-3.1.0/test/fadump_test.rb 
new/yast2-kdump-3.1.1/test/fadump_test.rb
--- old/yast2-kdump-3.1.0/test/fadump_test.rb   1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-kdump-3.1.1/test/fadump_test.rb   2013-12-06 16:20:13.000000000 
+0100
@@ -0,0 +1,71 @@
+#! /usr/bin/env rspec
+
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+require "yast"
+
+Yast.import "Kdump"
+Yast.import "Arch"
+
+describe "#fadump_supported?" do
+  it "returns that fadump is supported on ppc64 architecture" do
+    Yast::Arch.stub(:ppc64).and_return(true)
+    expect(Yast::Kdump.fadump_supported?).to be_true
+  end
+
+  it "return that fadump is not supported on other architectures" do
+    Yast::Arch.stub(:ppc64).and_return(false)
+    expect(Yast::Kdump.fadump_supported?).to be_false
+  end
+end
+
+describe "#use_fadump" do
+  it "returns true if fadump is supported on this architecture" do
+    Yast::Kdump.stub(:fadump_supported?).and_return(true)
+    expect(Yast::Kdump.use_fadump(true)).to be_true
+    expect(Yast::Kdump.use_fadump(false)).to be_true
+  end
+
+  it "returns false if it's not supported on this architecture" do
+    Yast::Kdump.stub(:fadump_supported?).and_return(false)
+    expect(Yast::Kdump.use_fadump(true)).to be_false
+  end
+
+  it "returns true if disabling fadump" do
+    Yast::Kdump.stub(:fadump_supported?).and_return(true)
+    expect(Yast::Kdump.use_fadump(false)).to be_true
+
+    Yast::Kdump.stub(:fadump_supported?).and_return(false)
+    expect(Yast::Kdump.use_fadump(false)).to be_true
+  end
+end
+
+describe "#using_fadump?" do
+ it "returns that fadump is in use if previously set" do
+   Yast::Kdump.stub(:fadump_supported?).and_return(true)
+
+   Yast::Kdump.use_fadump(true)
+   expect(Yast::Kdump.using_fadump?).to be_true
+
+   Yast::Kdump.use_fadump(false)
+   expect(Yast::Kdump.using_fadump?).to be_false
+ end
+end
+
+describe "#using_fadump_changed?" do
+  it "returns false if use_fadump not changed" do
+    Yast::Kdump.ReadKdumpSettings
+
+    expect(Yast::Kdump.using_fadump_changed?).to be_false
+  end
+
+  it "returns true if use_fadump changed" do
+    Yast::Kdump.ReadKdumpSettings
+
+    Yast::Kdump.stub(:fadump_supported?).and_return(true)
+    original_value = Yast::Kdump.using_fadump?
+    Yast::Kdump.use_fadump(! original_value)
+
+    expect(Yast::Kdump.using_fadump_changed?).to be_true
+  end
+end

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to