|
|
@ -358,11 +358,32 @@ class cl_kernel(color_print):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
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):
|
|
|
|
def cleanInitrd(self):
|
|
|
|
"""Discard from initrd non-critical modules"""
|
|
|
|
"""Discard from initrd non-critical modules"""
|
|
|
|
clVars = self.clVars
|
|
|
|
clVars = self.clVars
|
|
|
|
if self.skipByChrootAndShortname():
|
|
|
|
if self.skipByChrootAndShortname():
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
# check conflict options
|
|
|
|
|
|
|
|
if self.checkConflictOptions():
|
|
|
|
|
|
|
|
return True
|
|
|
|
bootDir = clVars.Get('cl_kernel_boot_path')
|
|
|
|
bootDir = clVars.Get('cl_kernel_boot_path')
|
|
|
|
clKernelUid = clVars.Get('cl_kernel_uid')
|
|
|
|
clKernelUid = clVars.Get('cl_kernel_uid')
|
|
|
|
initrdName = path.join(bootDir,"initramfs-%s-install"%clKernelUid)
|
|
|
|
initrdName = path.join(bootDir,"initramfs-%s-install"%clKernelUid)
|
|
|
|