Handle new crashkernel= syntax in firstboot
Resolves: bz805782 Port from below patch from rhel: commit 6a6816e97fccaf7805ba9d04fcb3f58d87bd2517 Author: amwang <amwang@redhat.com> Date: Fri Feb 11 06:53:27 2011 +0000 Resolves: bug 676758. Signed-off-by: Dave Young <dyoung@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
a3ee4fffe0
commit
dfb10612a2
|
@ -147,7 +147,6 @@ class moduleClass(Module):
|
|||
|
||||
# Fix up memory calculations if kdump is already on
|
||||
cmdLine = open("/proc/cmdline").read()
|
||||
self.kdumpMem = 0
|
||||
self.kdumpOffset = 0
|
||||
self.origCrashKernel = ""
|
||||
self.kdumpEnabled = False
|
||||
|
@ -155,7 +154,11 @@ class moduleClass(Module):
|
|||
if chkConfigStatus.find("enabled") > -1:
|
||||
self.kdumpEnabled = True
|
||||
self.kdumpMemInitial = 0
|
||||
if cmdLine.find("crashkernel") > -1:
|
||||
|
||||
kexec_crash_size = open("/sys/kernel/kexec_crash_size").read()
|
||||
self.kdumpMem = int(kexec_crash_size)/(1024*1024)
|
||||
|
||||
if self.kdumpMem != 0:
|
||||
crashString = filter(lambda t: t.startswith("crashkernel="),
|
||||
cmdLine.split())[0].split("=")[1]
|
||||
if self.doDebug:
|
||||
|
@ -163,7 +166,6 @@ class moduleClass(Module):
|
|||
if crashString.find("@") != -1:
|
||||
(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.origCrashKernel = "%dM" % (self.kdumpMem)
|
||||
|
@ -171,6 +173,7 @@ class moduleClass(Module):
|
|||
self.kdumpEnabled = True
|
||||
else:
|
||||
self.kdumpEnabled = False
|
||||
|
||||
self.initialState = self.kdumpEnabled
|
||||
|
||||
# Do some sanity-checking and try to present only sane options.
|
||||
|
|
Loading…
Reference in New Issue