Resolves: bz539812

This commit is contained in:
Neil Horman 2009-11-23 16:17:42 +00:00
parent 95b2cf1ec1
commit b3f251cfd0
2 changed files with 21 additions and 10 deletions

View File

@ -48,12 +48,13 @@ class moduleClass(Module):
self.priority = 100 self.priority = 100
self.sidebarTitle = N_("Kdump") self.sidebarTitle = N_("Kdump")
self.title = N_("Kdump") self.title = N_("Kdump")
self.reboot = False
# runPriority determines the order in which this module runs in firstboot # runPriority determines the order in which this module runs in firstboot
runPriority = 70 runPriority = 70
moduleName = _("Kdump") moduleName = _("Kdump")
windowName = moduleName windowName = moduleName
needsReboot = False reboot = False
# possible bootloaders we'll need to adjust # possible bootloaders we'll need to adjust
# bootloader : (config file, kdump offset) # bootloader : (config file, kdump offset)
@ -70,6 +71,9 @@ class moduleClass(Module):
kernelKdumpArches = [ "ppc64" ] kernelKdumpArches = [ "ppc64" ]
kernelKdumpInstalled = False kernelKdumpInstalled = False
def needsReboot(self):
return self.reboot
# toggle sensitivity of kdump config bits # toggle sensitivity of kdump config bits
def showHide(self, status): def showHide(self, status):
self.totalMem.set_sensitive(status) self.totalMem.set_sensitive(status)
@ -139,6 +143,7 @@ class moduleClass(Module):
self.kdumpMem = 0 self.kdumpMem = 0
self.kdumpOffset = 0 self.kdumpOffset = 0
self.origCrashKernel = "" self.origCrashKernel = ""
self.kdumpEnabled = False
chkConfigStatus=commands.getoutput('/sbin/chkconfig --list kdump') chkConfigStatus=commands.getoutput('/sbin/chkconfig --list kdump')
if chkConfigStatus.find("on") > -1: if chkConfigStatus.find("on") > -1:
self.kdumpEnabled = True self.kdumpEnabled = True
@ -148,13 +153,16 @@ class moduleClass(Module):
cmdLine.split())[0].split("=")[1] cmdLine.split())[0].split("=")[1]
if self.doDebug: if self.doDebug:
print "crashString is %s" % crashString print "crashString is %s" % crashString
if crashString.find("@") != -1:
(self.kdumpMem, self.kdumpOffset) = [int(m[:-1]) for m in crashString.split("@")] (self.kdumpMem, self.kdumpOffset) = [int(m[:-1]) for m in crashString.split("@")]
else:
self.kdumpMem = int(crashString[:-1])
self.kdumpOffset = 0
self.availMem += self.kdumpMem self.availMem += self.kdumpMem
self.origCrashKernel = "%dM@%dM" % (self.kdumpMem, self.kdumpOffset) self.origCrashKernel = "%dM" % (self.kdumpMem)
self.kdumpMemInitial = self.kdumpMem self.kdumpMemInitial = self.kdumpMem
else: else:
self.kdumpEnabled = False self.kdumpEnabled = False
self.kdumpMemInitial = 0
self.initialState = self.kdumpEnabled self.initialState = self.kdumpEnabled
# Do some sanity-checking and try to present only sane options. # Do some sanity-checking and try to present only sane options.
@ -325,10 +333,10 @@ class moduleClass(Module):
dlg.destroy() dlg.destroy()
if rc == gtk.RESPONSE_NO: if rc == gtk.RESPONSE_NO:
self.needsReboot = False self.reboot = False
return RESULT_SUCCESS return RESULT_SUCCESS
else: else:
self.needsReboot = True self.reboot = True
# Find bootloader if it exists, and update accordingly # Find bootloader if it exists, and update accordingly
if self.getBootloader() == None: if self.getBootloader() == None:
@ -341,8 +349,8 @@ class moduleClass(Module):
# Are we adding or removing the crashkernel param? # Are we adding or removing the crashkernel param?
if self.kdumpEnabled: if self.kdumpEnabled:
grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --args=crashkernel=%iM@%iM" \ grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --args=crashkernel=%iM" \
% (self.bootloader, self.runningKernel, reservedMem, self.offset) % (self.bootloader, self.runningKernel, reservedMem)
chkconfigStatus = "on" chkconfigStatus = "on"
else: else:
grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --remove-args=crashkernel=%s" \ grubbyCmd = "/sbin/grubby --%s --update-kernel=/boot/vmlinuz-%s --remove-args=crashkernel=%s" \
@ -358,7 +366,7 @@ class moduleClass(Module):
if self.bootloader == 'yaboot': if self.bootloader == 'yaboot':
os.system('/sbin/ybin') os.system('/sbin/ybin')
else: else:
self.needsReboot = False self.reboot = False
return RESULT_SUCCESS return RESULT_SUCCESS

View File

@ -1,6 +1,6 @@
Name: kexec-tools Name: kexec-tools
Version: 2.0.0 Version: 2.0.0
Release: 28%{?dist} Release: 29%{?dist}
License: GPLv2 License: GPLv2
Group: Applications/System Group: Applications/System
Summary: The kexec/kdump userspace component. Summary: The kexec/kdump userspace component.
@ -264,6 +264,9 @@ done
%changelog %changelog
* Mon Nov 23 2009 Neil Horman <nhorman@redhat.com> - 2.0.0-29
- Updating firstboot script to RHEL-6 version (bz 539812)
* Fri Nov 06 2009 Neil Horman <nhorman@redhat.com> - 2.0.0-28 * Fri Nov 06 2009 Neil Horman <nhorman@redhat.com> - 2.0.0-28
- Added abrt infrastructure to kdump init script (bz 533370) - Added abrt infrastructure to kdump init script (bz 533370)