|
|
@ -22,7 +22,8 @@ import re
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import traceback
|
|
|
|
import traceback
|
|
|
|
from os import path
|
|
|
|
from os import path
|
|
|
|
from cl_utils import process,pathJoin,getRunCommands,getTupleVersion
|
|
|
|
from cl_utils import process,pathJoin,getRunCommands,getTupleVersion,\
|
|
|
|
|
|
|
|
childMounts
|
|
|
|
from subprocess import STDOUT,PIPE
|
|
|
|
from subprocess import STDOUT,PIPE
|
|
|
|
from cl_print import color_print
|
|
|
|
from cl_print import color_print
|
|
|
|
from cl_datavars import DataVars
|
|
|
|
from cl_datavars import DataVars
|
|
|
@ -153,6 +154,15 @@ class cl_builder(color_print):
|
|
|
|
self.startMessage = ""
|
|
|
|
self.startMessage = ""
|
|
|
|
|
|
|
|
|
|
|
|
def prepareSourceDistributive(self,distr):
|
|
|
|
def prepareSourceDistributive(self,distr):
|
|
|
|
|
|
|
|
"""Unmount all bind,proc mount points from source distribute"""
|
|
|
|
|
|
|
|
mp = self.clVars.Get('cl_builder_path')
|
|
|
|
|
|
|
|
mps = filter(lambda x:x!=mp,map(lambda x:x[1],childMounts(mp)))
|
|
|
|
|
|
|
|
for target in sorted(mps, reverse=True):
|
|
|
|
|
|
|
|
self.printMessageForTest(_("Unmounting %s")%(target[len(mp):]))
|
|
|
|
|
|
|
|
umountProcess = process("umount",target)
|
|
|
|
|
|
|
|
if umountProcess.failed():
|
|
|
|
|
|
|
|
raise AssembleError(_("Can not umount %s")%target)
|
|
|
|
|
|
|
|
self.printByResult(True)
|
|
|
|
self.applyTemplatesForSquash(distr.convertToDirectory().getDirectory())
|
|
|
|
self.applyTemplatesForSquash(distr.convertToDirectory().getDirectory())
|
|
|
|
|
|
|
|
|
|
|
|
def isoPrepacking(self,directory):
|
|
|
|
def isoPrepacking(self,directory):
|
|
|
@ -311,8 +321,23 @@ class cl_builder(color_print):
|
|
|
|
self.printMessageForTest(_("Creating squash image"))
|
|
|
|
self.printMessageForTest(_("Creating squash image"))
|
|
|
|
self.targetDistr.installFrom(self.sourceDistr)
|
|
|
|
self.targetDistr.installFrom(self.sourceDistr)
|
|
|
|
self.printByResult(True)
|
|
|
|
self.printByResult(True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.targetDistr = PartitionDistributive(rootPartdev,flagRemoveDir=False)
|
|
|
|
|
|
|
|
dd = DirectoryDistributive(mp,parent=self.targetDistr)
|
|
|
|
|
|
|
|
self.removeVars('os_assemble_linux_ver', 'os_assemble_linux_shortname',
|
|
|
|
|
|
|
|
'cl_assemble_image', 'cl_assemble_step_system',
|
|
|
|
|
|
|
|
'cl_assemble_make', 'cl_assemble_step_world',
|
|
|
|
|
|
|
|
'cl_assemble_step_newuse', 'cl_assemble_step_update',
|
|
|
|
|
|
|
|
'cl_assemble_path')
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def removeVars(self,*varsname):
|
|
|
|
|
|
|
|
"""Remove vars specified by varsname"""
|
|
|
|
|
|
|
|
res = True
|
|
|
|
|
|
|
|
for var in varsname:
|
|
|
|
|
|
|
|
res = res and self.clVars.Delete(var,True,'default','assemble')
|
|
|
|
|
|
|
|
return bool(res)
|
|
|
|
|
|
|
|
|
|
|
|
def _rescratchLogic(self,force=False):
|
|
|
|
def _rescratchLogic(self,force=False):
|
|
|
|
self.clVars.Set('cl_builder_iso_path','/mnt/flash',True)
|
|
|
|
self.clVars.Set('cl_builder_iso_path','/mnt/flash',True)
|
|
|
|
self.clVars.Get('cl_builder_remove_squash')
|
|
|
|
self.clVars.Get('cl_builder_remove_squash')
|
|
|
|