|
|
|
@ -1045,7 +1045,6 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
"""Apply templates for root of system."""
|
|
|
|
|
#self.clVars.Set("cl_root_path","/", True)
|
|
|
|
|
self.clVars.Set("cl_chroot_path","/", True)
|
|
|
|
|
self.clVars.Set("cl_chroot_grub","/", True)
|
|
|
|
|
self.clTempl = template(self.clVars,cltFilter=False)
|
|
|
|
|
dirsFiles = self.clTempl.applyTemplates()
|
|
|
|
|
if self.clTempl.getError():
|
|
|
|
@ -1067,9 +1066,10 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
else:
|
|
|
|
|
return dirsFiles
|
|
|
|
|
|
|
|
|
|
def applyTemplates(self,directory):
|
|
|
|
|
def applyTemplates(self,directory,grubDirectory):
|
|
|
|
|
"""Apply templates for root of system."""
|
|
|
|
|
self.clVars.Set("cl_chroot_path",directory, True)
|
|
|
|
|
self.clVars.Set("cl_chroot_grub",grubDirectory, True)
|
|
|
|
|
clTemplateCltPath = \
|
|
|
|
|
filter(lambda x:path.exists(x),
|
|
|
|
|
map(lambda x:pathJoin(directory,x),
|
|
|
|
@ -1923,17 +1923,10 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
# get path to initrd and initrd-install in new system
|
|
|
|
|
# (/boot/initramfs-...-install,/boot/initramfs-...)
|
|
|
|
|
chrootPath = path.join(self.clVars.Get('cl_chroot_path'),'boot')
|
|
|
|
|
chrootGrub = path.join(self.clVars.Get('cl_chroot_grub'),'boot')
|
|
|
|
|
initrdPath = path.join(chrootPath,self.clVars.Get('os_install_initrd'))
|
|
|
|
|
initrdInstallPath = path.join(chrootPath,
|
|
|
|
|
self.clVars.Get('os_install_initrd_install'))
|
|
|
|
|
copy2(initrdInstallPath,initrdPath);
|
|
|
|
|
# if chrootGrub and chrootPath different then it is scratch mode
|
|
|
|
|
if chrootGrub != chrootPath:
|
|
|
|
|
# copy initrd to scratch device
|
|
|
|
|
initrdPathScratch = path.join(chrootGrub,
|
|
|
|
|
self.clVars.Get('os_install_initrd'))
|
|
|
|
|
copy2(initrdInstallPath,initrdPathScratch);
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def afterCopyHDDinstall(self,targetDistr, addUsers, changePwdUsers,
|
|
|
|
@ -1957,14 +1950,13 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
|
|
|
|
|
# optimize initrd
|
|
|
|
|
self.clVars.Set("cl_chroot_path",targetDistr.getDirectory(), True)
|
|
|
|
|
self.clVars.Set("cl_chroot_grub",
|
|
|
|
|
targetDistr.getBootDirectory()[:-4], True)
|
|
|
|
|
self.printMessageForTest(_("Creating new initrd file"))
|
|
|
|
|
self.printByResult(self.cleanInitrd())
|
|
|
|
|
|
|
|
|
|
# join templates
|
|
|
|
|
self.printMessageForTest(_("Updating config"))
|
|
|
|
|
self.applyTemplates(targetDistr.getDirectory())
|
|
|
|
|
self.applyTemplates(targetDistr.getDirectory(),
|
|
|
|
|
targetDistr.getBootDirectory()[:-4])
|
|
|
|
|
# mount bind mount points
|
|
|
|
|
|
|
|
|
|
self.printByResult(True)
|
|
|
|
|