Add check for kernel support compress format.

Mike Hiretsky 13 years ago
parent 7f9ecc3354
commit 6052781cf6

Binary file not shown.

@ -316,6 +316,24 @@ class cl_builder(color_print):
return filter(lambda x:x['root'].startswith(rootPath),
map(psax,procid))
def checkSquashCompress(self):
configPath = path.join(self.clVars.Get('cl_builder_path'),
'boot',
self.clVars.Get('cl_builder_kernel_config'))
optCheck = {'xz':"CONFIG_SQUASHFS_XZ=y",
'lzma':"CONFIG_SQUASHFS_XZ=y",
'lzo':"CONFIG_SQUASHFS_LZO=y"}.get(self.compression,None)
if not optCheck:
return True
res = filter(lambda x:optCheck in x,
open(configPath,'r'))
if not res:
self.printWARNING(_("WARNING") +": " +
_("kernel not support '%s' compression format for squashfs")%
self.compression)
return False
return True
def printInfo(self):
self.printSUCCESS(_("Creating image of") + " Calculate Linux")
self.defaultPrint("%s\n"%_("System information"))
@ -338,6 +356,7 @@ class cl_builder(color_print):
imagefile = self.clVars.Get('cl_builder_image')
if imagefile:
self.printSUCCESS(_("Image will be created at: %s")% imagefile)
self.checkSquashCompress()
if path.exists(imagefile):
self.printWARNING(_("WARNING") +": " +
_("image already exists") + ", "+
@ -383,6 +402,7 @@ class cl_builder(color_print):
self.printSUCCESS(_("Image will be created in: %s")%
self.clVars.Get('cl_builder_iso_path'))
self.checkSquashCompress()
if self.clVars.Get('cl_builder_remove_squash'):
self.printSUCCESS(
_("Follow squash images will be removed: %s\n")%

Loading…
Cancel
Save