diff --git a/i18n/cl_install_ru.mo b/i18n/cl_install_ru.mo index ac2f2f9..9c998dd 100644 Binary files a/i18n/cl_install_ru.mo and b/i18n/cl_install_ru.mo differ diff --git a/pym/cl_fill_install.py b/pym/cl_fill_install.py index 41dae0d..d328583 100644 --- a/pym/cl_fill_install.py +++ b/pym/cl_fill_install.py @@ -23,7 +23,7 @@ from cl_datavars import glob_attr from os import path from os import readlink,access,R_OK from cl_utils import isMount,typeFile,getTupleVersion,pathJoin,isFstabMount,\ - listDirectory + listDirectory, getAvailableX11Drivers from cl_distr import DistributiveRepository,PartitionDistributive from cl_fill import clLocale from operator import itemgetter @@ -864,11 +864,7 @@ class fillVars(object, glob_attr): def get_os_install_x11_video_drv(self): """Video driver used by xorg""" if self.Get('os_install_root_type') == 'usb-hdd': - xorg_modules_dir = '/usr/lib/xorg/modules/drivers' - avialable_drivers = \ - map(lambda x: x[:-7], - filter(lambda x: x.endswith('_drv.so'), - listDirectory(xorg_modules_dir))) + avialable_drivers = getAvailableX11Drivers() videoVal = self.getValueFromCmdLine("calculate","video") videoVal = {'i915':'intel'}.get(videoVal,videoVal) if videoVal in list_avialable_drivers: diff --git a/pym/cl_install.py b/pym/cl_install.py index 760d080..8a2e816 100644 --- a/pym/cl_install.py +++ b/pym/cl_install.py @@ -849,6 +849,8 @@ class cl_install(color_print, SignalInterrupt): self.clVars.Get('hr_cpu_num')) self.printSUCCESS(_("Videocard vendor")+": %s"% self.clVars.Get('hr_video')) + self.printSUCCESS(_("{0} video driver").format("Xorg")+": %s"% + self.clVars.Get('os_install_x11_video_drv')) self.printSUCCESS(_("Screen resolution")+": %s"% self.clVars.Get('os_install_x11_resolution')) self.defaultPrint("%s\n"%_("Localization")) @@ -1767,7 +1769,20 @@ class cl_install(color_print, SignalInterrupt): if path.exists(pathGlModules): self.printMessageForTest(_("Configure OpenGL")) self.printByResult(self.setupOpenGL()) - + # if change video driver, then restore initramfs + installDrv = self.clVars.Get('os_install_x11_video_drv') + if self.clVars.Get('os_x11_video_drv') != installDrv: + initrdPath = path.join('/boot', + self.clVars.Get('os_install_initrd')) + initrdInstallPath = path.join('/boot', + self.clVars.Get('os_install_initrd_install')) + needMod = {'radeon':'radeon', + 'intel':'i915', + 'nouveau':'nouveau'}.get(installDrv,'uvesafb') + if not InitRamFs(initrdPath).isModuleInside(needMod): + self.printMessageForTest(_("Restore initramfs")) + self.printByResult(InitRamFs(initrdInstallPath)\ + .cleanInitRamFs(initrdPath, x11_video_drv)) except (InstallError,DistributiveError),e: error = e except Exception,e: diff --git a/pym/cl_kernel_utils.py b/pym/cl_kernel_utils.py index 42944cc..2cae14b 100644 --- a/pym/cl_kernel_utils.py +++ b/pym/cl_kernel_utils.py @@ -133,6 +133,16 @@ class InitRamFs: os.chdir(self.prevDir) return res + def searchInside(self,searchFunc): + """Search data in file list of initramfs""" + cpioProcess = process("cpio", "-tf", + stdin=process("gzip", "-dc", self.initrdFile)) + return filter(searchFunc,cpioProcess) + + def isModuleInside(self,moduleName): + """Search module in initramfs""" + return bool(self.searchInside(lambda x: "%s.ko"%moduleName in x)) + def _packInitRamfs(self,newInitramfsFile=None): """Pack initramfs""" self.prevDir = os.getcwd()