Fix initrd optimization.

netsetup
Mike Hiretsky 13 years ago
parent 50ed7c2d52
commit 68fc70b545

@ -1751,11 +1751,20 @@ class cl_install(color_print, SignalInterrupt):
return True
def cleanInitrd(self):
"""Clean initrd from needless modules"""
# get path to initrd and initrd-install in new system
# (/boot/initramfs-...-install,/boot/initramfs-...)
initrdPath = path.join(self.clVars.Get('cl_chroot_path'),
'boot',self.clVars.Get('os_install_initrd'))
initrdInstallPath = path.join(self.clVars.Get('cl_chroot_path'),
'boot',self.clVars.Get('os_install_initrd_install'))
# section which must contains equealent modules and kernel buildins
importantSections = ['File systems','Pseudo filesystems',
'CDROM.*Filesystems', 'DOS.*Filesystems',
'SCSI Transport']
curConfig = dict(KernelConfig().getSectionParams(*importantSections))
if not self.clVars.Get('os_install_kernel_config'):
copy2(initrdInstallPath,initrdPath);
return True
newConfig = KernelConfig( configFile=
path.join(self.clVars.Get('cl_chroot_path'),
@ -1766,11 +1775,8 @@ class cl_install(color_print, SignalInterrupt):
curConfig[x[0]]=="Y",
newConfig)
if conflictOptions:
copy2(initrdInstallPath,initrdPath);
return True
initrdPath = path.join(self.clVars.Get('cl_chroot_path'),
'boot',self.clVars.Get('os_install_initrd'))
initrdInstallPath = path.join(self.clVars.Get('cl_chroot_path'),
'boot',self.clVars.Get('os_install_initrd_install'))
return InitRamFs(initrdInstallPath).cleanInitRamFs(initrdPath)
def afterCopyHDDinstall(self,targetDistr, addUsers, changePwdUsers,

Loading…
Cancel
Save