Add check conflict options.

master
Mike Hiretsky 13 years ago
parent 33e8789357
commit a5d446cde8

Binary file not shown.

@ -358,11 +358,32 @@ class cl_kernel(color_print):
return False
return True
def checkConflictOptions(self):
"""Clean initrd from needless modules"""
# section which must contains equealent modules and kernel buildins
importantSections = ['File systems','Pseudo filesystems',
'CDROM.*Filesystems', 'DOS.*Filesystems',
'SCSI Transport']
# get dictionary from current config
curConfig = dict(KernelConfig().getSectionParams(*importantSections))
# get config of new kernel
newConfig = KernelConfig(configFile=self._getNewName("config"))
newConfig = newConfig.getSectionParams(*importantSections)
# find and return conflict option
# options, which M in new config and Y in current config
return filter(lambda x: x[1]=="M" and
x[0] in curConfig and
curConfig[x[0]]=="Y",
newConfig)
def cleanInitrd(self):
"""Discard from initrd non-critical modules"""
clVars = self.clVars
if self.skipByChrootAndShortname():
return True
# check conflict options
if self.checkConflictOptions():
return True
bootDir = clVars.Get('cl_kernel_boot_path')
clKernelUid = clVars.Get('cl_kernel_uid')
initrdName = path.join(bootDir,"initramfs-%s-install"%clKernelUid)

Loading…
Cancel
Save