Change scratch installation.

netsetup
Mike Hiretsky 13 years ago
parent b627531eb5
commit ff0f55e7bd

@ -1378,22 +1378,15 @@ class ScratchPartitionDistributive(PartitionDistributive):
def prepareScratch(self,directory):
"""Create need scratch directories"""
for scrDirectory in ("calculate","delta","workspace","boot"):
for scrDirectory in ("calculate","delta","workspace"):
self._makeDirectory(path.join(directory,scrDirectory))
os.symlink('workspace/etc',path.join(directory,'etc'))
def getBootDirectory(self):
"""Get directory which contains boot"""
return path.join(self.convertToScratch().directory,"boot")
def syncBoot(self):
"""Copy boot from aufs to scratch partition"""
dirDistr = self.convertToDirectory().directory
realBootDir = self.getBootDirectory()
self.rsync(path.join(dirDistr,"boot"),realBootDir,hideSpin=True)
def postinstallMountBind(self):
self.syncBoot()
pass
def installFrom(self, source):
"""Install distributive to partition from source distributive"""
@ -1416,7 +1409,6 @@ class ScratchPartitionDistributive(PartitionDistributive):
# prepare scratch
self.prepareScratch(scratchDirectory)
self.syncBoot()
except DistributiveError,e:
raise e
except KeyboardInterrupt,e:

@ -1308,4 +1308,7 @@ class fillVars(object, glob_attr):
def get_cl_chroot_grub(self):
"""Chroot for grub-mkconfig"""
return self.Get('cl_chroot_path')
if self.Get('os_install_scratch') == "on":
return path.join(self.Get('cl_chroot_path'),"mnt/scratch")
else:
return self.Get('cl_chroot_path')

@ -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)

Loading…
Cancel
Save