rpms/system-config-kdump/devel s-c-kdump-1.0.14-reflect-current-settings.patch, NONE, 1.1 system-config-kdump.spec, 1.3, 1.4

Roman Rakus rrakus at fedoraproject.org
Thu Sep 11 12:27:51 UTC 2008


Author: rrakus

Update of /cvs/extras/rpms/system-config-kdump/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6790

Modified Files:
	system-config-kdump.spec 
Added Files:
	s-c-kdump-1.0.14-reflect-current-settings.patch 
Log Message:
Resolves: #461602. Don't specify any offset in cmdline argument

s-c-kdump-1.0.14-reflect-current-settings.patch:

--- NEW FILE s-c-kdump-1.0.14-reflect-current-settings.patch ---
diff -up system-config-kdump-1.0.14/src/system-config-kdump.py.reflect system-config-kdump-1.0.14/src/system-config-kdump.py
--- system-config-kdump-1.0.14/src/system-config-kdump.py.reflect	2008-03-20 16:40:48.000000000 +0100
+++ system-config-kdump-1.0.14/src/system-config-kdump.py	2008-08-27 14:19:17.000000000 +0200
@@ -115,6 +115,7 @@ class mainWindow:
         self.kdumpMem = 0
         self.usableMem = 0
         self.origCrashKernel = ""
+	self.defKern = ""
 
         self.bootloader = None
 
@@ -125,6 +126,7 @@ class mainWindow:
         self.memoryTable = self.xml.get_widget("memoryTable")
         self.kdumpEnableCheckButton = self.xml.get_widget("kdumpEnableCheckButton")
         self.totalMemLabel = self.xml.get_widget("totalMem")
+	self.kdumpMemCurrentLabel = self.xml.get_widget("kdumpMemCurrent")
         self.kdumpMemSpinButton = self.xml.get_widget("kdumpMemSpinButton")
         self.usableMemLabel = self.xml.get_widget("usableMem")
 
@@ -163,7 +165,9 @@ class mainWindow:
         # Check to see if kdump memory is already reserved
         # Read from /proc/iomem so we're portable across xen and non-xen
         kdumpMem = 0
+	kdumpMemGrubby = 0
         kdumpOffset = 0
+	kdumpOffsetGrubby = 0
         # PowerPC64 doesn't list crashkernel reservation in /proc/iomem
         if self.arch != 'ppc64':
             ioMem = open("/proc/iomem").readlines()
@@ -193,24 +197,29 @@ class mainWindow:
                         self.xenKdumpKernel = "kernel-PAE"
                         break
 
-        # Fix up memory calculations, if need be
-        if kdumpMem != 0:
-            self.kdumpEnabled = True
-            self.kdumpEnableCheckButton.set_active(True)
-            totalMem += kdumpMem
-            self.origCrashKernel = "%dM@%dM" % (kdumpMem, kdumpOffset)
-        else:
-            self.kdumpEnableCheckButton.set_active(False)
+        # read current kdump settings from grubby
+        self.defKern = os.popen("/sbin/grubby --default-kernel").read().rstrip('\n')
+	if debug:
+		print "grubby --default-kernel: %s" % (self.defKern,)
+	grubbyInfo = os.popen("/sbin/grubby --info=%s" \
+				% (self.defKern,)).readlines()
+	for line in grubbyInfo:
+		if line.find("crashkernel") != -1:
+			line = line.replace('"', '')
+			crashString = filter(lambda t: t.startswith("crashkernel="),
+					     line.split())[0].split("=")[1]
+			(kdumpMemGrubby, kdumpOffsetGrubby) = \
+				[int(m[:-1]) for m in crashString.split("@")]
+			if debug:
+				print "grubby --info: crashkernel=%iM@%iM" \
+					% (kdumpMemGrubby, kdumpOffsetGrubby)
 
-        self.totalMemLabel.set_text("%s" % (totalMem,))
-
-        # Do some sanity-checking and try to present only sane options.
-        #
         # Defaults
         lowerBound = 128
         minUsable = 512
         step = 64
 
+
         if self.arch == 'ia64':
             # ia64 needs at least 256M, page-aligned
             lowerBound = 256
@@ -219,6 +228,22 @@ class mainWindow:
             lowerBound = 256
             minUsable = 2048
 
+
+
+        # Fix up memory calculations, if need be
+	if kdumpMemGrubby != 0:
+            self.kdumpEnabled = True
+            self.kdumpEnableCheckButton.set_active(True)
+            totalMem += kdumpMem
+            self.origCrashKernel = "%dM@%dM" % (kdumpMem, kdumpOffset)
+        else:
+	    self.kdumpMem = kdumpMemGrubby = lowerBound
+            self.kdumpEnableCheckButton.set_active(False)
+
+        self.totalMemLabel.set_text("%s" % (totalMem,))
+
+        # Do some sanity-checking and try to present only sane options.
+        #
         upperBound = (totalMem - minUsable) - (totalMem % step) 
 
         if upperBound < lowerBound:
@@ -227,27 +252,27 @@ class mainWindow:
             sys.exit(1)
 
         # Set spinner to lowerBound unless already set on kernel command line
-        if kdumpMem == 0:
-            kdumpMem = lowerBound
-        else:
+        if kdumpMem != 0:
             # round it down to a multiple of %step
             kdumpMem = kdumpMem - (kdumpMem % step)
+            self.kdumpMem = kdumpMem
 
         self.totalMem = totalMem
-        self.kdumpMem = kdumpMem
         self.usableMem = self.totalMem - self.kdumpMem
 
+	self.kdumpMemCurrentLabel.set_text(_("%s" % (kdumpMem)))
+
         kdumpMemAdj = gtk.Adjustment(kdumpMem, lowerBound, upperBound, step, step, 64)
         self.kdumpMemSpinButton.set_adjustment(kdumpMemAdj)
         self.kdumpMemSpinButton.set_update_policy(gtk.UPDATE_IF_VALID)
         self.kdumpMemSpinButton.set_numeric(True)
         self.kdumpMemSpinButton.connect("value_changed", self.updateUsableMem)
-        self.kdumpMemSpinButton.set_value(kdumpMem)
+        self.kdumpMemSpinButton.set_value(kdumpMemGrubby)
 
         self.usableMemLabel.set_text("%s" % (self.usableMem,))
 
         if debug:
-            print "totalMem = %dM\nkdumpMem = %dM\nusableMem = %dM" % (totalMem, kdumpMem, self.usableMem)
+            print "totalMem = %dM\nkdumpMem = %dM\nkdumpMemGrubby = %dM\nusableMem = %dM" % (totalMem, kdumpMem, kdumpMemGrubby, self.usableMem)
 
         self.defaultActionCombo = self.xml.get_widget("defaultActionCombo")
 
@@ -685,8 +710,8 @@ class mainWindow:
         # Are we adding or removing the crashkernel param?
         if self.kdumpEnabled:
             crashKernel = "%iM@%iM" % (self.kdumpMem, offset)
-            grubbyCmd = '/sbin/grubby --%s --update-kernel=%s/vmlinuz-%s --%s="crashkernel=%s"' \
-                        % (self.bootloader, kpath, self.runningKernel, 
+            grubbyCmd = '/sbin/grubby --%s --update-kernel=%s --%s="crashkernel=%s"' \
+                        % (self.bootloader, self.defKern, 
                            args, crashKernel)
             chkconfigStatus = "on"
             if self.origCrashKernel:
@@ -694,8 +719,8 @@ class mainWindow:
             else:
                 serviceOp = "start"
         else:
-            grubbyCmd = '/sbin/grubby --%s --update-kernel=%s/vmlinuz-%s --remove-%s="crashkernel=%s"' \
-                        % (self.bootloader, kpath, self.runningKernel, 
+            grubbyCmd = '/sbin/grubby --%s --update-kernel=%s --remove-%s="crashkernel=%s"' \
+                        % (self.bootloader, self.defKern, 
                            args, self.origCrashKernel)
             chkconfigStatus = "off"
             serviceOp = "stop"
diff -up system-config-kdump-1.0.14/src/system-config-kdump.glade.reflect system-config-kdump-1.0.14/src/system-config-kdump.glade
--- system-config-kdump-1.0.14/src/system-config-kdump.glade.reflect	2006-12-20 20:49:40.000000000 +0100
+++ system-config-kdump-1.0.14/src/system-config-kdump.glade	2008-08-27 14:08:21.000000000 +0200
@@ -62,7 +62,7 @@
       <child>
 	<widget class="GtkTable" id="memoryTable">
 	  <property name="visible">True</property>
-	  <property name="n_rows">3</property>
+	  <property name="n_rows">4</property>
 	  <property name="n_columns">2</property>
 	  <property name="homogeneous">False</property>
 	  <property name="row_spacing">5</property>
@@ -125,9 +125,9 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="kdumpMemLabel">
+	    <widget class="GtkLabel" id="kdumpMemCurrentLabel">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">kdump Memory (MB):</property>
+	      <property name="label" translatable="yes">Current kdump Memory (MB):</property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_RIGHT</property>
@@ -153,12 +153,12 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="usableMemLabel">
+	    <widget class="GtkLabel" id="kdumpMemCurrent">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Usable Memory (MB):</property>
+	      <property name="label" translatable="yes"></property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_RIGHT</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
 	      <property name="selectable">False</property>
 	      <property name="xalign">0</property>
@@ -167,26 +167,26 @@
 	      <property name="ypad">0</property>
 	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">True</property>
+	      <property name="single_line_mode">False</property>
 	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
-	      <property name="left_attach">0</property>
-	      <property name="right_attach">1</property>
-	      <property name="top_attach">2</property>
-	      <property name="bottom_attach">3</property>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="usableMem">
+	    <widget class="GtkLabel" id="kdumpMemLabel">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes"></property>
+	      <property name="label" translatable="yes">New kdump Memory (MB):</property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="justify">GTK_JUSTIFY_RIGHT</property>
 	      <property name="wrap">False</property>
 	      <property name="selectable">False</property>
 	      <property name="xalign">0</property>
@@ -195,14 +195,14 @@
 	      <property name="ypad">0</property>
 	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">False</property>
+	      <property name="single_line_mode">True</property>
 	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
-	      <property name="left_attach">1</property>
-	      <property name="right_attach">2</property>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
 	      <property name="top_attach">2</property>
-	      <property name="bottom_attach">3</property>
+	      <property name="bottom_attach">4</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
@@ -223,8 +223,64 @@
 	    <packing>
 	      <property name="left_attach">1</property>
 	      <property name="right_attach">2</property>
-	      <property name="top_attach">1</property>
-	      <property name="bottom_attach">2</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">4</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="usableMemLabel">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Usable Memory (MB):</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_RIGHT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">True</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">4</property>
+	      <property name="bottom_attach">6</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="usableMem">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes"></property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">4</property>
+	      <property name="bottom_attach">6</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>


Index: system-config-kdump.spec
===================================================================
RCS file: /cvs/extras/rpms/system-config-kdump/devel/system-config-kdump.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- system-config-kdump.spec	9 Sep 2008 11:20:11 -0000	1.3
+++ system-config-kdump.spec	11 Sep 2008 12:27:21 -0000	1.4
@@ -1,7 +1,7 @@
 Summary: A graphical interface for configuring kernel crash dumping
 Name: system-config-kdump
 Version: 1.0.14
-Release: 1%{?dist}
+Release: 2%{?dist}
 URL: http://fedora.redhat.com/projects/config-tools/
 License: GPLv2+
 Group: System Environment/Base
@@ -18,7 +18,9 @@
 Requires: kexec-tools
 Requires(pre): gtk2 >= 2.8.20
 Requires(pre): hicolor-icon-theme
-Patch1: system-config-kdump-1.0.14-fedora.patch
+Patch1: s-c-kdump-1.0.14-reflect-current-settings.patch
+Patch2: system-config-kdump-1.0.14-fedora.patch
+Patch3: system-config-kdump-1.0.14-ommit-offset.patch
 
 %description
 system-config-kdump is a graphical tool for configuring kernel crash
@@ -26,7 +28,9 @@
 
 %prep
 %setup -q
-%patch1 -p1 -b .fedora
+%patch1 -p1 -b .reflect
+%patch2 -p1 -b .fedora
+%patch3 -p1 -b .ommit-offset
 %build
 make
 
@@ -70,7 +74,11 @@
 %doc ChangeLog COPYING
 
 %changelog
-* Tue Sep 09 2008 Roman Rakus <rrakus at redhatm.com> 1.0.14-1
+* Thu Sep 11 2008 Roman Rakus <rrakus at redhat.com> 1.0.14-2
+- Don't specify any offset in cmdline argument
+  Resolves: #461602
+
+* Tue Sep 09 2008 Roman Rakus <rrakus at redhat.com> 1.0.14-1
 - Bump to version 1.0.14
 
 * Fri Feb 01 2008 Dave Lehman <dlehman at redhat.com> 1.0.13-2%{?dist}




More information about the fedora-extras-commits mailing list