Fix opengl configure. Add os_install_language,cl_format_type,cl_format_use

netsetup
Mike Hiretsky 14 years ago
parent a6b6bc2f13
commit 59b9b89481

@ -27,6 +27,7 @@ from cl_fill import clLocale
from operator import itemgetter
from cl_template import _terms
from subprocess import PIPE, Popen
from cl_install import convertDictOpt
class fillVars(object, glob_attr):
nonTransferedDirs = ["/","/bin", "/dev", "/etc",
@ -949,3 +950,20 @@ class fillVars(object, glob_attr):
else:
retList.append("Yes")
return retList
def get_os_format_type(self):
"""Filesystem format support by calcualte-install"""
return filter(lambda x:not x in ("default","noformat"),
filter(lambda x:not x.startswith("_"),
convertDictOpt._fileSystemOpt.keys())+\
convertDictOpt._propertiesFileSystem.keys())
def get_os_format_use(self):
"""Avialable format by mkfs utility"""
return map(lambda x:"yes"
if pathexists(convertDictOpt._fileSystemOpt[x]["makefs"])
else "no", self.Get('os_format_type'))
def get_os_install_lang(self):
"""Supported languages"""
return clLocale().getLangs()

@ -144,8 +144,10 @@ class convertDictOpt:
["grpquota","noquota","quota",
"usrquota"],
["oldalloc","orlov"],
["user_xattr","nouser_xattr"]]}
["user_xattr","nouser_xattr"]],
"makefs":"/sbin/mkfs.ext2"}
_ext3Options = _ext2Options.copy()
_ext3Options.update({"makefs":"/sbin/mkfs.ext3"})
_ext3Options["options"] += ["journal", "noload", "data", "barrier",
"commit", "data_err"]
_ext3Options["pair"].update({"journal":{"options":["update", "inum"],
@ -258,7 +260,8 @@ class convertDictOpt:
["bh","nobh"],
["delalloc", "nodelalloc"],
["auto_da_alloc",
"noauto_da_alloc"]]},
"noauto_da_alloc"]],
"makefs":"/sbin/mkfs.ext4"},
"reiserfs":{"options":["conv","hash","hashed_relocation",
"no_unhashed_relocation",
"noborder", "nolog", "notail",
@ -272,7 +275,8 @@ class convertDictOpt:
"detect"]},
"resize":{"options":re.compile("\d+"),
"incompatible":[]}},
"incompatible":[]},
"incompatible":[],
"makefs":"/sbin/mkfs.reiserfs"},
"xfs":{"options":["allocsize", "attr2", "noattr2",
"barrier", "dmapi", "grpid",
"bsdgroups", "nogrpid", "sysvgroups",
@ -313,7 +317,8 @@ class convertDictOpt:
["uquota", "usrquota",
"uqnoenforce", "quota"],
["pquota", "prjquota",
"pqnoenforce"]]}}
"pqnoenforce"]],
"makefs":"/sbin/mkfs.xfs"}}
listFileSystemCorrupted = []
def __init__(self, clVars):
@ -331,7 +336,13 @@ class convertDictOpt:
"""Get list all file system"""
return filter(lambda x: not x.startswith("_"),
self._fileSystemOpt.keys()) +\
self._propertiesFileSystem.keys()
self._propertiesFileSystem.keys()
def getAllAvailableFileSystemOpt(self):
return filter(lambda x: not x in ("default","noformat") and
(not "makefs" in self._fileSystemOpt[x] or
pathexists(self._fileSystemOpt[x]["makefs"])),
self.getAllSupportFileSystemOpt())
def _getFileSystemData(self, realFileSystem):
"""Get data in _fileSystemOpt"""
@ -523,6 +534,7 @@ class convertDictOpt:
optMountPoint = "/"
dictUpdateProperty["mountPoint"] = optMountPoint
supportedFS = self.getAllSupportFileSystemOpt()
availableFS = self.getAllAvailableFileSystemOpt()
# if fs not specified and current fs not supported
if not optFileSystem:
if not (format and format in supportedFS):
@ -536,6 +548,9 @@ class convertDictOpt:
if not optFileSystem in supportedFS:
raise InstallError(_("Wrong file system options '%s'")\
%optFileSystem)
if not optFileSystem in availableFS:
raise InstallError(_("File system '%s' is not available")\
%optFileSystem)
dictOptions.update(self.getDefaultOptFileSystem(optFileSystem))
if optFileSystem == "noformat":
if not format:
@ -1169,6 +1184,7 @@ class cl_install(color_print):
'usr/lib/opengl')
openGLenv = pathjoin(self.clVars.Get('cl_chroot_path'),
'etc/env.d/03opengl')
openGlMods = filter(lambda x:x != "global",
os.listdir(pathGlModules))
mapGL_drivers = {'fglrx':"ati" if "ati" in openGlMods
@ -1206,8 +1222,12 @@ class cl_install(color_print):
self.printByResult(objUsers.addUsers("guest","guest"))
else:
self.printOK("%s ..."%configureMessage)
self.printMessageForTest(_("Configure OpenGL"))
self.printByResult(self.setupOpenGL())
pathGlModules = pathjoin(self.clVars.Get('cl_chroot_path'),
'usr/lib/opengl')
if pathexists(pathGlModules):
self.printMessageForTest(_("Configure OpenGL"))
self.printByResult(self.setupOpenGL())
except (InstallError,DistributiveError),e:
error = e

@ -241,7 +241,7 @@ class install_cmd(share_cmd):
else:
self.logicObj.clVars.Set('cl_action','system',True)
if options.s:
self.setLinuxName(options.s.upper())
self.logicObj.setLinuxName(options.s.upper())
return True
def checkAndSetInstallOptions(self,diskOptions, swapOptions, bindOptions):

@ -262,6 +262,15 @@ class Data:
# install initramfs filename
os_install_initrd_install = {}
# filesystem format support by calcualte-install
os_format_type = {}
# avialable format by mkfs utility
os_format_use = {}
# supported languages
os_install_lang = {}
# current grub
os_grub_conf = {}

Loading…
Cancel
Save